New submission from py.user: It depends on encoded part in the header, what email.header.decode_header() returns. If the header has both raw part and encoded part, the function returns (bytes, None) for the raw part. But if the header has only raw part, the function returns (str, None) for it.
>>> import email.header >>> >>> s = 'abc=?koi8-r?q?\xc1\xc2\xd7?=' >>> email.header.decode_header(s) [(b'abc', None), (b'\xc1\xc2\xd7', 'koi8-r')] >>> >>> s = 'abc' >>> email.header.decode_header(s) [('abc', None)] >>> There should be (bytes, None) for both cases. ---------- components: Library (Lib), email messages: 230932 nosy: barry, py.user, r.david.murray priority: normal severity: normal status: open title: The decode_header() function decodes raw part to bytes or str, depending on encoded part versions: Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22833> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com