[Mailman-Developers] unicode traceback

Jeroen Ruigrok/asmodai asmodai at in-nomine.org
Mon Jul 4 20:13:46 CEST 2005

Gents and ladies,

on the freedesktop.org site we encountered a lot of troubles with moderation

Some emails got stuck due to Logger.py dying.  This is with 2.1.5.  I
verified with a trunk version and spotted the problem has not been

Find attached a suggested patch which I think should solve this issue.

I find more unicode() calls in the Mailman 2.1.x source tree that do not
seem to guard against encoding failing or forget ValueError.  Perhaps these
also need either a(n) (additional) safeguard or 'replace' addition?

To note:
Mailman/Archiver/HyperArch.py:	charset = unicode(charset[2], charset[0])
Mailman/Archiver/HyperArch.py:  body = unicode(body, charset)
Mailman/Utils.py:            u = unicode(s, charset)

Awaiting your feedback, first time I delved into the Mailman sources. :)

Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
Free Tibet! http://www.savetibet.org/ | http://ashemedai.deviantart.com/
http://www.tendra.org/   | http://www.in-nomine.org/
Seize from every moment its unique novelty and do not prepare your joys...
-------------- next part --------------
--- Mailman/Logging/Logger.py.orig	2005-07-04 19:25:42.000000000 +0200
+++ Mailman/Logging/Logger.py	2005-07-04 20:00:38.000000000 +0200
@@ -85,7 +85,7 @@
     def write(self, msg):
         if isinstance(msg, StringType):
-            msg = unicode(msg, self.__encoding)
+            msg = unicode(msg, self.__encoding, 'replace')
         f = self.__get_f()

More information about the Mailman-Developers mailing list