homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Bob.Glickstein
Recipients Bob.Glickstein
Date 2012年05月07日.13:36:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1336397793.0.0.246147056664.issue14740@psf.upfronthosting.co.za>
In-reply-to
Content
Passing both a value for i and decode=True to email.message.Message.get_payload(), when self is a multipart, returns None when it should return a string. The reason is that an is_multipart() test is done on self when it should instead be done on the selected payload part. Here's a patch that fixes this:
--- /usr/lib64/python2.7/email/message.py	2011年10月26日 18:40:36.000000000 -0700
+++ /home/bobg/tmp/message.py	2012年05月07日 06:34:28.579401481 -0700
@@ -192,9 +192,9 @@
 else:
 payload = self._payload[i]
 if decode:
- if self.is_multipart():
+ if payload.is_multipart():
 return None
- cte = self.get('content-transfer-encoding', '').lower()
+ cte = payload.get('content-transfer-encoding', '').lower()
 if cte == 'quoted-printable':
 return utils._qdecode(payload)
 elif cte == 'base64':
History
Date User Action Args
2012年05月07日 13:36:33Bob.Glicksteinsetrecipients: + Bob.Glickstein
2012年05月07日 13:36:32Bob.Glicksteinsetmessageid: <1336397793.0.0.246147056664.issue14740@psf.upfronthosting.co.za>
2012年05月07日 13:36:32Bob.Glicksteinlinkissue14740 messages
2012年05月07日 13:36:32Bob.Glicksteincreate

AltStyle によって変換されたページ (->オリジナル) /