summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2002-10-20 14:48:14 +0000
committerbwarsaw2002-10-20 14:48:14 +0000
commit4dd915d724b6c38e69af0b3b6fa786eb1623cf58 (patch)
treebf3f4032e789da3eb5fea62053e010c0c569d9a9
parent60a40fbaeb4db6d686e930401962ce2ed3a61363 (diff)
downloadmailman-4dd915d724b6c38e69af0b3b6fa786eb1623cf58.tar.gz
mailman-4dd915d724b6c38e69af0b3b6fa786eb1623cf58.tar.zst
mailman-4dd915d724b6c38e69af0b3b6fa786eb1623cf58.zip
prefix_subject(): The charsets coming from headerbits can be strings
in some cases; coerce them to Charset instances.
-rw-r--r--Mailman/Handlers/CookHeaders.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py
index a8f910770..d3599e68d 100644
--- a/Mailman/Handlers/CookHeaders.py
+++ b/Mailman/Handlers/CookHeaders.py
@@ -228,6 +228,8 @@ def prefix_subject(mlist, msg, msgdata):
# Once again, convert the string to unicode.
if c is None:
c = Charset('iso-8859-1')
+ if not isinstance(c, Charset):
+ c = Charset(c)
if not _isunicode(s):
codec = c.input_codec or 'ascii'
s = unicode(s, codec, 'replace')