Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16487

Modified Files:
      Tag: Release_2_1-maint
        Scrubber.py 
Log Message:
process(): One more bug fix, though this one should be safe.  Under email 2.5,
it is possible for a message to be "not is_multipart()" but to have a None
payload.  I know of at least one situation where this can happen: you have a
Content-Type: multipart/* but there is nothing but two blank lines between the
first boundary and the end boundary.  Under email 3, you get a string payload
but under email 2.5 you get None.

Because there's nothing in such parts, they should be safe to ignore.


Index: Scrubber.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Scrubber.py,v
retrieving revision 2.18.2.12
retrieving revision 2.18.2.13
diff -u -d -r2.18.2.12 -r2.18.2.13
--- Scrubber.py 16 Jan 2005 21:57:04 -0000      2.18.2.12
+++ Scrubber.py 22 May 2005 19:55:08 -0000      2.18.2.13
@@ -282,10 +282,17 @@
         # If the message isn't a multipart, then we'll strip it out as an
         # attachment that would have to be separately downloaded.  Pipermail
         # will transform the url into a hyperlink.
-        # TK: Confirm also part is not None. (bug-id: 1099138)
         elif part and 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:

_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to