aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Queue/CommandRunner.py
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2021-03-31 14:56:21 -0700
committerMark Sapiro <mark@msapiro.net>2021-03-31 14:56:21 -0700
commited0adf071ced3aef5799ab9d08503142553703af (patch)
tree06e6521de92e10f9d807694e3c90faa2272de953 /Mailman/Queue/CommandRunner.py
parente1f509efe72b433fdedea7ef24526b09934768d2 (diff)
downloadmailman2-ed0adf071ced3aef5799ab9d08503142553703af.tar.gz
mailman2-ed0adf071ced3aef5799ab9d08503142553703af.tar.xz
mailman2-ed0adf071ced3aef5799ab9d08503142553703af.zip
Improve fix for lp:1921682.
Diffstat (limited to '')
-rw-r--r--Mailman/Queue/CommandRunner.py6
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()