Author r.david.murray
Recipients r.david.murray
Date 2009-06-18.01:36:14
SpamBayes Score 0.00148752
Marked as misclassified No
Message-id <1245288976.09.0.298419063758.issue6302@psf.upfronthosting.co.za>
In-reply-to
Content
decode_header only accepts str as input.  If the input contains no
encoded words, the output is str (ie: the input string) and None.  If it
does contain encoded words, the output is pairs of bytes plus str
charset identifiers (or None).  This makes it difficult to use this
function to decode headers, since one has to test for the special case
of str output when there are no encoded words.

I think decode_header should take bytes as input, and output (bytes.
str) pairs consistently.

In any case, the documentation is wrong since it says it returns
strings.  The example is also wrong, since the actual output is:

[(b'p\xf6stal', 'iso-8859-1')]
History
Date User Action Args
2009-06-18 01:36:16r.david.murraysetrecipients: + r.david.murray
2009-06-18 01:36:16r.david.murraysetmessageid: <1245288976.09.0.298419063758.issue6302@psf.upfronthosting.co.za>
2009-06-18 01:36:14r.david.murraylinkissue6302 messages
2009-06-18 01:36:14r.david.murraycreate