Message270399
An unfortunate combination of get_all and getaddresses results in a Traceback:
Traceback (most recent call last):
File "misc/decode_from_header.py", line 17, in <module>
print('From: %s' % email.utils.getaddresses(val))
File "/usr/lib64/python3.4/email/utils.py", line 112, in getaddresses
all = COMMASPACE.join(fieldvalues)
TypeError: sequence item 0: expected str instance, Header found
Here's the relevant part of it:
Content-type: text/html;charset=iso-8859-1
From: Itaú Uniclass. <comunicado.com.br@atendimento.gotdns.ch>
Obviously, the From header is iso-8859-1 encoded as well, and violates RFC 2822 as such. But making it crash in the usual combination of
val = msg.get('from')
email.utils.getaddresses([val])
isn't the real McCoy either.. |
|
Date |
User |
Action |
Args |
2016-07-14 10:50:11 | frispete | set | recipients:
+ frispete, barry, r.david.murray |
2016-07-14 10:50:11 | frispete | set | messageid: <1468493411.01.0.0415400585896.issue27513@psf.upfronthosting.co.za> |
2016-07-14 10:50:10 | frispete | link | issue27513 messages |
2016-07-14 10:50:10 | frispete | create | |
|