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 Sebastian Kreft
Recipients Sebastian Kreft
Date 2015-08-05.15:18:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438787925.35.0.0505694721939.issue24797@psf.upfronthosting.co.za>
In-reply-to
Content
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)]
History
Date User Action Args
2015-08-05 15:18:45Sebastian Kreftsetrecipients: + Sebastian Kreft
2015-08-05 15:18:45Sebastian Kreftsetmessageid: <1438787925.35.0.0505694721939.issue24797@psf.upfronthosting.co.za>
2015-08-05 15:18:45Sebastian Kreftlinkissue24797 messages
2015-08-05 15:18:43Sebastian Kreftcreate