From 1b2c29e31c47c522c7bed4ba645a4e9a39cdf378 Mon Sep 17 00:00:00 2001 From: msapiro Date: Sun, 19 Feb 2006 21:03:59 +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(-) (limited to 'Mailman/Handlers/Scrubber.py') diff --git a/Mailman/Handlers/Scrubber.py b/Mailman/Handlers/Scrubber.py index 712280a70..4a4a3c59e 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-70-g09d2