Message160144
| 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:33 | Bob.Glickstein | set | recipients:
+ Bob.Glickstein |
| 2012年05月07日 13:36:32 | Bob.Glickstein | set | messageid: <1336397793.0.0.246147056664.issue14740@psf.upfronthosting.co.za> |
| 2012年05月07日 13:36:32 | Bob.Glickstein | link | issue14740 messages |
| 2012年05月07日 13:36:32 | Bob.Glickstein | create |
|