Message248047
The return type of email.header.decode_header is not consistent. When there are encoded parts the return type is a list of (bytes, charset or None) (Note that the documentation says it is a list of (str, charset)). However, when there are no encoded parts the return type is [(str, None)]. Note that, at the end of the function, there is a routine that converts everything to bytes.
Compare:
In [01]: email.header.decode_header('=?UTF-8?Q?foo?=bar')
Out[01]: [(b'foo', 'utf-8'), (b'bar', None)]
In [02]: email.header.decode_header('foobar')
Out[02]: [('foobar', None)] |
|
Date |
User |
Action |
Args |
2015-08-05 15:18:45 | Sebastian Kreft | set | recipients:
+ Sebastian Kreft |
2015-08-05 15:18:45 | Sebastian Kreft | set | messageid: <1438787925.35.0.0505694721939.issue24797@psf.upfronthosting.co.za> |
2015-08-05 15:18:45 | Sebastian Kreft | link | issue24797 messages |
2015-08-05 15:18:43 | Sebastian Kreft | create | |
|