]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
#14291: if a header has non-ascii unicode, default to CTE using utf-8
authorR David Murray <rdmurray@bitdance.com>
Wed, 14 Mar 2012 06:59:51 +0000 (02:59 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 14 Mar 2012 06:59:51 +0000 (02:59 -0400)
commit7441a7aedd251d529eb14eff9a16708e9cb32409
tree1d525eb5ac468752cacf460b4228a0150ee48814
parent21c71bac5f684b0ec1665d841d05f91e078c3964
#14291: if a header has non-ascii unicode, default to CTE using utf-8

In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.

Patch by Ali Ikinci, assisted by R. David Murray.

I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error.  It now uses support.patch to induce an error during
message serialization.
Lib/email/header.py
Lib/email/test/test_email.py
Lib/test/test_mailbox.py
Misc/ACKS
Misc/NEWS