From c4f5cab18ab575360fa2b5a5c1464974af716679 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Tue, 13 Jan 2009 10:53:19 -0800 Subject: Work around email 3.0.1 issue when set_payload charset arg is unicode. --- Mailman/Handlers/Scrubber.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Mailman/Handlers') 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) -- cgit v1.2.3