From: Barry Warsaw Date: Thu, 9 Feb 2006 04:10:03 +0000 (+0000) Subject: Port of r42279 to email 3.0, but without the Python 2.1 backward compatible X-Git-Tag: v2.4.3c1~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=261058cc1cb2f4ee3e9efb58f7a543626f93fd59;p=thirdparty%2FPython%2Fcpython.git Port of r42279 to email 3.0, but without the Python 2.1 backward compatible nonsense. Resolve SF bug 1409403: email.Message should supress warning from uu.decode. --- diff --git a/Lib/email/Message.py b/Lib/email/Message.py index bc7641634125..a5a8ff2856db 100644 --- a/Lib/email/Message.py +++ b/Lib/email/Message.py @@ -198,7 +198,7 @@ class Message: elif cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'): sfp = StringIO() try: - uu.decode(StringIO(payload+'\n'), sfp) + uu.decode(StringIO(payload+'\n'), sfp, quiet=True) payload = sfp.getvalue() except uu.Error: # Some decoding problem diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index 5a42c2272d05..1360bbe309ba 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -211,6 +211,19 @@ class TestMessageAPI(TestEmailBase): msg.set_payload('foo') eq(msg.get_payload(decode=True), 'foo') + def test_decode_bogus_uu_payload_quietly(self): + msg = Message() + msg.set_payload('begin 664 foo.txt\n%