[issue17505] email.header.Header.__unicode__ does not decode header

2013-03-22 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Thanks for pointing out the make_header(decode_header(...)) idiom, which I was indeed not aware of. It solves the problem perfectly. I agree that it is a doc bug. While make_header is documented on the same place as decode_header and Header itself, it is not

[issue17505] email.header.Header.__unicode__ does not decode header

2013-03-21 Thread R. David Murray
R. David Murray added the comment: Erg, somehow I failed to read the second half of your message before writing mine...clearly you *didn't* know about that idiom, so the doc patch is obviously an important thing to do. To clarify about the 3.3 example: the policy=default is key, it tells the e

[issue17505] email.header.Header.__unicode__ does not decode header

2013-03-21 Thread R. David Murray
R. David Murray added the comment: I agree that this is not the worlds best API. However, it is the API that we have in 2.7/3.2, and we can't change how Header.__unicode__ behaves without breaking backward compatibility. What we could do is add an example of how to use this API to get unico

[issue17505] email.header.Header.__unicode__ does not decode header

2013-03-21 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: An example of the confusion that lack of a clear "convert to unicode" method creates is illustrated by this StackOverflow question: http://stackoverflow.com/q/15516958/1600898 -- ___ Python tracker

[issue17505] email.header.Header.__unicode__ does not decode header

2013-03-21 Thread Hrvoje Nikšić
Changes by Hrvoje Nikšić : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue17505] email.header.Header.__unicode__ does not decode header

2013-03-21 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić: The __unicode__ method is documented to "return the header as a Unicode string". For this to be useful, I would expect it to decode a string such as "=?gb2312?b?1eLKx9bQzsSy4srUo6E=?=" into a Unicode string that can be displayed to the user, in this case u'\u