[Pkg-mailman-hackers] Bug#358892: Uncaught runner exception: len() of unsized object

Sven Hartge sven at svenhartge.de
Sat Mar 25 00:27:33 UTC 2006


Package: mailman
Version: 2.1.5-8sarge1
Severity: important
Tags: patch

Hello.

Mailman 2.1.5 contains a subtle bug inside its Scrubber.py, which can
cause some messages with badly formed mime multiparts and sometimes all
messaged received after the defective one to be shunted, thus rendering
the specific list to be unusable. (Thus the slightly increased
severity.)

See also http://mail.python.org/pipermail/mailman-users/2005-June/045107.html

Example for one traceback:

(The date is so old, because I since fixed this problem locally but never
got around to submitting this bug to the BTS.)

Feb 19 08:26:35 2006 (2786) SHUNTING: 1140333994.5416+92548399c95eda0df954edc5b01362c2ddda88bf
Feb 19 09:04:19 2006 (2786) Uncaught runner exception: len() of unsized object
Feb 19 09:04:19 2006 (2786) Traceback (most recent call last):
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 111, in _oneloop
    self._onefile(msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 167, in _onefile
    keepqueued = self._dispose(mlist, msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/IncomingRunner.py", line 130, in _dispose
    more = self._dopipeline(mlist, msg, msgdata, pipeline)
  File "/usr/lib/mailman/Mailman/Queue/IncomingRunner.py", line 153, in _dopipeline
    sys.modules[modname].process(mlist, msg, msgdata)
  File "/var/lib/mailman/Mailman/Handlers/ToDigest.py", line 91, in process
    send_digests(mlist, mboxfp)
  File "/var/lib/mailman/Mailman/Handlers/ToDigest.py", line 132, in send_digests
    send_i18n_digests(mlist, mboxfp)
  File "/var/lib/mailman/Mailman/Handlers/ToDigest.py", line 306, in send_i18n_digests
    msg = scrubber(mlist, msg)
  File "/var/lib/mailman/Mailman/Handlers/Scrubber.py", line 262, in process
    size = len(payload)
TypeError: len() of unsized object

The patch (attached for your convenience) is also in 2.1.6, see 
https://sourceforge.net/tracker/?func=detail&atid=100103&aid=1099138&group_id=103

Please include this simple fix in the next point release.

Grüße,
Sven Hartge
-------------- next part --------------
diff -ur mailman-2.1.5.orig/Mailman/Handlers/Scrubber.py mailman-2.1.5/Mailman/Handlers/Scrubber.py
--- mailman-2.1.5.orig/Mailman/Handlers/Scrubber.py	2003-12-01 02:43:18.000000000 +0100
+++ mailman-2.1.5/Mailman/Handlers/Scrubber.py	2006-03-25 01:25:57.000000000 +0100
@@ -259,6 +259,14 @@
         elif not part.is_multipart():
             payload = part.get_payload(decode=True)
             ctype = part.get_type()
+            # XXX Under email 2.5, it is possible that payload will be None.
+            # This can happen when you have a Content-Type: multipart/* with
+            # only one part and that part has two blank lines between the
+            # first boundary and the end boundary.  In email 3.0 you end up
+            # with a string in the payload.  I think in this case it's safe to
+            # ignore the part.
+            if payload is None:
+                continue
             size = len(payload)
             omask = os.umask(002)
             try:


More information about the Pkg-mailman-hackers mailing list