[New-bugs-announce] [issue21492] email.header.decode_header sometimes returns bytes, sometimes str

Jim Minter report at bugs.python.org
Tue May 13 11:08:05 CEST 2014


New submission from Jim Minter:

Python 3.3.2 (default, Mar  5 2014, 08:21:05) 
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.header
>>> email.header.decode_header("foo")
[('foo', None)]
>>> email.header.decode_header("foo=?windows-1252?Q?bar?=")
[(b'foo', None), (b'bar', 'windows-1252')]

I may well be wrong, but I believe it's erroneous that in the second example above, b'foo' is returned instead of the expected 'foo'.

----------
components: Library (Lib)
messages: 218419
nosy: jim_minter
priority: normal
severity: normal
status: open
title: email.header.decode_header sometimes returns bytes, sometimes str
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21492>
_______________________________________


More information about the New-bugs-announce mailing list