]> granicus.if.org Git - python/commitdiff
Merge #14291: if a header has non-ascii unicode, default to CTE using utf-8
authorR David Murray <rdmurray@bitdance.com>
Wed, 14 Mar 2012 07:03:27 +0000 (03:03 -0400)
committerR David Murray <rdmurray@bitdance.com>
Wed, 14 Mar 2012 07:03:27 +0000 (03:03 -0400)
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.

1  2 
Lib/test/test_email/test_email.py
Lib/test/test_mailbox.py
Misc/ACKS
Misc/NEWS

Simple merge
Simple merge
diff --cc Misc/ACKS
index a11d4ebdd87e14afe40abd894150025f6410aa77,2b3dad5424fc4acfff9e69d14de885f9091c6bcc..eeb61e08e0d077947ce78e154016a1eeef6bb767
+++ b/Misc/ACKS
@@@ -468,8 -429,8 +468,9 @@@ Eric Hus
  Jeremy Hylton
  Gerhard Häring
  Fredrik Håård
 +Catalin Iacob
  Mihai Ibanescu
+ Ali Ikinci
  Lars Immisch
  Bobby Impollonia
  Meador Inge
diff --cc Misc/NEWS
index 9b4d2c2ef95cf084634b3a2bb810c325a942aa5c,b4dcf82608220a7354c785ee6975d063df6b2bc9..0d6cdbb13d0dee54b6423c32d6e4df0fc2034fca
+++ b/Misc/NEWS
@@@ -24,14 -22,11 +24,17 @@@ Core and Builtin
  Library
  -------
  
+ - Issue #14291: Email now defaults to utf-8 for non-ASCII unicode headers
+   instead of raising an error.  This fixes a regression relative to 2.7.
 +- Issue #989712: Support using Tk without a mainloop.
 +
  - Issue #5219: Prevent event handler cascade in IDLE.
  
 +- Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
 +
 +- Issue #2843: Add new Tk API to Tkinter.
 +
  - Issue #14184: Increase the default stack size for secondary threads on
    Mac OS X to avoid interpreter crashes when using threads on 10.7.