------------------------------------------------------------
revno: 1867
fixes bug: https://launchpad.net/bugs/1921682
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Tue 2021-03-30 12:32:42 -0700
message:
  Decode message bodies for replies in CommandRunner.
modified:
  Mailman/Queue/CommandRunner.py
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'Mailman/Queue/CommandRunner.py'
--- Mailman/Queue/CommandRunner.py	2018-06-17 23:47:34 +0000
+++ Mailman/Queue/CommandRunner.py	2021-03-30 19:32:42 +0000
@@ -100,6 +100,9 @@
             # 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()

=== modified file 'NEWS'
--- NEWS	2021-03-06 02:24:12 +0000
+++ NEWS	2021-03-30 19:32:42 +0000
@@ -15,6 +15,10 @@
     - 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

_______________________________________________
Mailman-checkins mailing list -- mailman-checkins@python.org
To unsubscribe send an email to mailman-checkins-le...@python.org
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: arch...@jab.org

Reply via email to