diff --git a/news/7.bugfix b/news/7.bugfix new file mode 100644 index 0000000..0479f09 --- /dev/null +++ b/news/7.bugfix @@ -0,0 +1,2 @@ +- Use a better type check in the payload parser. + [Rotonen] diff --git a/plone/rfc822/_utils.py b/plone/rfc822/_utils.py index 403c8b4..8bcd098 100644 --- a/plone/rfc822/_utils.py +++ b/plone/rfc822/_utils.py @@ -246,7 +246,7 @@ def initializeObject(context, fields, message, defaultCharset="utf-8"): return # A single payload is a string, multiparts are lists - if isinstance(payloads, str): + if isinstance(payloads, six.string_types): if len(primary) != 1: raise ValueError( "Got a single string payload for message, but no primary "