diff options
author | Mark Sapiro <mark@msapiro.net> | 2021-03-31 14:56:21 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2021-03-31 14:56:21 -0700 |
commit | ed0adf071ced3aef5799ab9d08503142553703af (patch) | |
tree | 06e6521de92e10f9d807694e3c90faa2272de953 | |
parent | e1f509efe72b433fdedea7ef24526b09934768d2 (diff) | |
download | mailman2-ed0adf071ced3aef5799ab9d08503142553703af.tar.gz mailman2-ed0adf071ced3aef5799ab9d08503142553703af.tar.xz mailman2-ed0adf071ced3aef5799ab9d08503142553703af.zip |
Improve fix for lp:1921682.
-rw-r--r-- | Mailman/Queue/CommandRunner.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index a2a9dab7..3c21065f 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -101,8 +101,10 @@ class Results: 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'])) + body = unicode(body, part.get_content_charset(), + errors='replace').encode( + Utils.GetCharSet(self.msgdata['lang']), + errors='replace') # text/plain parts better have string payloads assert isinstance(body, StringType) or isinstance(body, UnicodeType) lines = body.splitlines() |