Tokio Kikuchi wrote:
> It looks like the problem is something to do with email package
> behavior.  Here is a test code to reproduce the problem:

That's neat.  I like how you can do

if not p:
    print p

and it'll print out "A message without header".  :)

Would an (ugly, amateurish) work-around like the following be a start?
I don't know what sort of test message would trigger bug 1099138 so I
didn't test for that case to see that this wouldn't be a regression.
Also, this only gets the first message part from Werner's message to
show up in the archives, the second part is still scrubbed, but at
least there is a link to download it.

--- Scrubber.py~        2006-10-01 16:28:57.000000000 -0400
+++ Scrubber.py 2006-12-09 11:41:25.000000000 -0500
@@ -334,7 +334,12 @@
         text = []
         for part in msg.walk():
             # TK: bug-id 1099138 and multipart
-            if not part or part.is_multipart():
+            if not part:
+                try:
+                    part.as_string()
+                except:
+                    continue
+            elif part.is_multipart():
                 continue
             # All parts should be scrubbed to text/plain by now.
             partctype = part.get_content_type()

Thanks Mark and Tokio for digging into this.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
Ever notice that even the busiest people are never too busy to tell
you just how busy they are?

Attachment: pgppkLQ6NlV83.pgp
Description: PGP signature

------------------------------------------------------
Mailman-Users mailing list
Mailman-Users@python.org
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp

Reply via email to