Prevent UnicodeDecodeErrors from being swallowed

UnicodeDecodeError is a subclass of ValueError, so these exceptions were being swallowed by the InvalidParameterError handling.
This commit is contained in:
Matthew Sital-Singh 2013-11-25 16:34:59 +00:00
parent af5719b40c
commit 465315a7f6
1 changed files with 4 additions and 0 deletions

View File

@ -65,6 +65,10 @@ def create(
try:
container.invokeFactory(type, content_id, **kwargs)
except UnicodeDecodeError:
# UnicodeDecodeError is a subclass of ValueError,
# so will be swallowed below unless we re-raise it here
raise
except ValueError, e:
if ISiteRoot.providedBy(container):
allowed_types = container.allowedContentTypes()