From 465315a7f64a495556770292ad339195c0737c85 Mon Sep 17 00:00:00 2001 From: Matthew Sital-Singh Date: Mon, 25 Nov 2013 16:34:59 +0000 Subject: [PATCH] Prevent UnicodeDecodeErrors from being swallowed UnicodeDecodeError is a subclass of ValueError, so these exceptions were being swallowed by the InvalidParameterError handling. --- src/plone/api/content.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plone/api/content.py b/src/plone/api/content.py index 9671f91..12f5600 100644 --- a/src/plone/api/content.py +++ b/src/plone/api/content.py @@ -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()