diff options
author | tkikuchi <> | 2005-01-12 04:01:44 +0000 |
---|---|---|
committer | tkikuchi <> | 2005-01-12 04:01:44 +0000 |
commit | e710bc0c0829afe33058671bee491d268c00b7df (patch) | |
tree | a09d3b691276683905ededa085b408bde81a56b7 /Mailman/Handlers | |
parent | 2f4bdc0951ec498f4dae26ffb89cf80037f3b2a5 (diff) | |
download | mailman2-e710bc0c0829afe33058671bee491d268c00b7df.tar.gz mailman2-e710bc0c0829afe33058671bee491d268c00b7df.tar.xz mailman2-e710bc0c0829afe33058671bee491d268c00b7df.zip |
Provision for part == None case. Closing bug# 1099138
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r-- | Mailman/Handlers/Scrubber.py | 6 |
1 files 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() |