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

Hrvoje Nikšić report at bugs.python.org
Sat Mar 23 07:48:13 CET 2013

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 explained *why* I should call it if I already have in hand a perfectly valid Header instance.  Specifically, it is not at all clear that while unicode(h) and unicode(make_header(decode_header(h)) will return different things -- I would have expected make_header(decode_header(h)) to return an object indistinguishable from h.

Also, the policy=default parameter in Python 3 sounds great, it's exactly what one would expect.


Python tracker <report at bugs.python.org>

More information about the docs mailing list