aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2009-01-13 10:53:19 -0800
committerMark Sapiro <mark@msapiro.net>2009-01-13 10:53:19 -0800
commitc4f5cab18ab575360fa2b5a5c1464974af716679 (patch)
tree283461639c86efd618a09e679c8dd058e8bbe850
parentb58583ff133c3ab17d8dc53f33de5895cb4651eb (diff)
downloadmailman2-c4f5cab18ab575360fa2b5a5c1464974af716679.tar.gz
mailman2-c4f5cab18ab575360fa2b5a5c1464974af716679.tar.xz
mailman2-c4f5cab18ab575360fa2b5a5c1464974af716679.zip
Work around email 3.0.1 issue when set_payload charset arg is unicode.
-rw-r--r--Mailman/Handlers/Scrubber.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py
index 32ba0403..64b46eaf 100644
--- a/Mailman/Handlers/Scrubber.py
+++ b/Mailman/Handlers/Scrubber.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2009 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -167,6 +167,9 @@ def replace_payload_by_text(msg, text, charset):
# message by a text (scrubbing).
del msg['content-type']
del msg['content-transfer-encoding']
+ if isinstance(charset, unicode):
+ # email 3.0.1 (python 2.4) doesn't like unicode
+ charset = charset.encode('us-ascii')
msg.set_payload(text, charset)