From bfad4a96aa95c99d00a1bd4f120bd1c55a294664 Mon Sep 17 00:00:00 2001 From: msapiro <> Date: Sun, 19 Feb 2006 21:03:38 +0000 Subject: Fixed bug 1430236 by catching TypeError when trying to get a decoded payload when payload is None. --- Mailman/Handlers/Scrubber.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py index 712280a7..4a4a3c59 100644 --- a/Mailman/Handlers/Scrubber.py +++ b/Mailman/Handlers/Scrubber.py @@ -343,7 +343,12 @@ Url : %(url)s continue try: t = part.get_payload(decode=True) - except binascii.Error: + # MAS: TypeError exception can occur if payload is None. This + # was observed with a message that contained an attached + # message/delivery-status part. Because of the special parsing + # of this type, this resulted in a text/plain sub-part with a + # null body. See bug 1430236. + except (binascii.Error, TypeError): t = part.get_payload() # TK: get_content_charset() returns 'iso-2022-jp' for internally # crafted (scrubbed) 'euc-jp' text part. So, first try -- cgit v1.2.3