From e710bc0c0829afe33058671bee491d268c00b7df Mon Sep 17 00:00:00 2001 From: tkikuchi <> Date: Wed, 12 Jan 2005 04:01:44 +0000 Subject: Provision for part == None case. Closing bug# 1099138 --- Mailman/Handlers/Scrubber.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py index 070c307d..67ec6bf4 100644 --- a/Mailman/Handlers/Scrubber.py +++ b/Mailman/Handlers/Scrubber.py @@ -283,7 +283,8 @@ Url: %(url)s # 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. - elif not part.is_multipart(): + # 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() size = len(payload) @@ -326,7 +327,8 @@ Url : %(url)s # generalizing to utf-8, and that's probably a good idea (eventually). text = [] for part in msg.walk(): - if part.get_content_maintype() == 'multipart': + # TK: bug-id 1099138 and multipart + if not part or part.is_multipart(): continue # All parts should be scrubbed to text/plain by now. partctype = part.get_content_type() -- cgit v1.2.3