Message337091
This simple code:
```
import mailbox
mbox = mailbox.mbox("broken.mbox")
for msg in mbox:
msg.get_payload()
```
Fails rather unexpectedly:
```
$ python3 broken.py
Traceback (most recent call last):
File "broken.py", line 5, in <module>
msg.get_payload()
File "/usr/lib/python3.7/email/message.py", line 267, in get_payload
payload = bpayload.decode(self.get_param('charset', 'ascii'), 'replace')
TypeError: decode() argument 1 must be str, not tuple
```
(I'm attaching a zip with code and mailbox)
I would have expected either that the part past text/plain is ignored if it doesn't make sense, or that content-type is completely ignored.
I have to process a large mailbox archive, and this is currently how I had to work around this issue, and it's causing me to have to skip email content which would otherwise be reasonably accessible:
https://salsa.debian.org/nm-team/echelon/commit/617ce935a31f6256257ffb24e11a5666306406c3 |
|
Date |
User |
Action |
Args |
2019-03-04 11:03:37 | enrico | set | recipients:
+ enrico |
2019-03-04 11:03:37 | enrico | set | messageid: <1551697417.39.0.601639302301.issue36180@roundup.psfhosted.org> |
2019-03-04 11:03:37 | enrico | link | issue36180 messages |
2019-03-04 11:03:37 | enrico | create | |
|