Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1:/tmp/cvs-serv15915
Modified Files:
Scrubber.py
Log Message:
process(): In the msg.is_multipart() clause, inside the clause that
tries to convert t to something reasonable <wink>, we need to use
errors='replace' when we encode from unicode to string. This is
because the preceding unicode('ascii', 'replace') could end up
inserted U+FFFD, which can't be encoded to ascii.
Index: Scrubber.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Scrubber.py,v
retrieving revision 2.24
retrieving revision 2.25
diff -u -d -r2.24 -r2.25
--- Scrubber.py 24 Jan 2003 00:18:35 -0000 2.24
+++ Scrubber.py 13 Sep 2003 06:00:43 -0000 2.25
@@ -301,8 +301,11 @@
try:
t = unicode(t, partcharset, 'replace')
except (UnicodeError, LookupError):
- # Replace funny characters
- t = unicode(t, 'ascii', 'replace').encode('ascii')
+ # Replace funny characters. We use errors='replace' for
+ # both calls since the first replace will leave U+FFFD,
+ # which isn't ASCII encodeable.
+ u = unicode(t, 'ascii', 'replace')
+ t = u.encode('ascii', 'replace')
try:
# Should use HTML-Escape, or try generalizing to UTF-8
t = t.encode(charset, 'replace')
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins