From 232910aaea8b6719f40e42924afa11515d8cd1fe Mon Sep 17 00:00:00 2001 From: Joni Orponen Date: Sat, 11 May 2019 16:54:20 +0200 Subject: [PATCH] Use a better type check in the payload parser. --- news/7.bugfix | 2 ++ plone/rfc822/_utils.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 news/7.bugfix 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 "