diff options
author | Mark Sapiro <mark@msapiro.net> | 2021-03-30 12:32:42 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2021-03-30 12:32:42 -0700 |
commit | e1f509efe72b433fdedea7ef24526b09934768d2 (patch) | |
tree | 44a8cb3179d23b378e11aae4321c79aaa54f1128 | |
parent | 416d2e6ef003869486dcf6d212133511114767be (diff) | |
download | mailman2-e1f509efe72b433fdedea7ef24526b09934768d2.tar.gz mailman2-e1f509efe72b433fdedea7ef24526b09934768d2.tar.xz mailman2-e1f509efe72b433fdedea7ef24526b09934768d2.zip |
Decode message bodies for replies in CommandRunner.
-rw-r--r-- | Mailman/Queue/CommandRunner.py | 3 | ||||
-rw-r--r-- | NEWS | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index 6ea50255..a2a9dab7 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -100,6 +100,9 @@ class Results: # E.g the outer Content-Type: was text/html return body = part.get_payload(decode=True) + if (part.get_content_charset(None)): + body = unicode(body, part.get_content_charset()).encode( + Utils.GetCharSet(self.msgdata['lang'])) # text/plain parts better have string payloads assert isinstance(body, StringType) or isinstance(body, UnicodeType) lines = body.splitlines() @@ -15,6 +15,10 @@ Here is a history of user visible changes to Mailman. - Plain text message bodies with Content-Disposition: and no declared charset are no longer scrubbed. (LP: #1917968) + - CommandRunner now recodes message bodies in the charset of the user's + or list's language to avoid a possible UnicodeError when including the + message body in the reply. (LP: #1921682) + 2.1.34 (26-Jun-2020) i18n |