From ed0adf071ced3aef5799ab9d08503142553703af Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 31 Mar 2021 14:56:21 -0700 Subject: Improve fix for lp:1921682. --- Mailman/Queue/CommandRunner.py | 6 ++++-- 1 file 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() -- cgit v1.2.3