Update of /cvsroot/mailman/mailman/Mailman/Queue
In directory sc8-pr-cvs1:/tmp/cvs-serv14552/Mailman/Queue

Modified Files:
        CommandRunner.py 
Log Message:

Another instance of mixing unicode with 8-bit-dirty strings. Since email
will assume it's 8-bit encoded to the passed-in character set, convert
unicode objects to that encoding.



Index: CommandRunner.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Queue/CommandRunner.py,v
retrieving revision 2.28
retrieving revision 2.29
diff -u -d -r2.28 -r2.29
--- CommandRunner.py    11 Mar 2003 22:51:44 -0000      2.28
+++ CommandRunner.py    20 Mar 2003 01:54:19 -0000      2.29
@@ -150,9 +150,15 @@
             resp.append(_('\n- Ignored:'))
             resp.extend(indent(self.ignored))
         resp.append(_('\n- Done.\n\n'))
-        results = MIMEText(
-            NL.join(resp),
-            _charset=Utils.GetCharSet(self.mlist.preferred_language))
+        # Encode any unicode strings into the list characterset,
+        # so we don't try to join unicode strings and invalid ASCII.
+        charset = Utils.GetCharSet(self.mlist.preferred_language)
+        encoded_resp = []
+        for item in resp:
+            if isinstance(item, UnicodeType):
+                item = item.encode(charset, 'replace')
+            encoded_resp.append(item)
+        results = MIMEText(NL.join(encoded_resp), _charset=charset)
         # Safety valve for mail loops with misconfigured email 'bots.  We
         # don't respond to commands sent with "Precedence: bulk|junk|list"
         # unless they explicitly "X-Ack: yes", but not all mail 'bots are



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to