]> granicus.if.org Git - python/commitdiff
Issue #27445: Merge from 3.5
authorBerker Peksag <berker.peksag@gmail.com>
Thu, 8 Sep 2016 16:42:11 +0000 (19:42 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Thu, 8 Sep 2016 16:42:11 +0000 (19:42 +0300)
1  2 
Lib/email/mime/text.py
Lib/test/test_email/test_email.py
Misc/NEWS

index 87de8d235f9019fdd9dacd8927981dbfb59be53f,da03086ee8a7646c4a8c6a07e2c8eafa4a3c6ef0..35b442383002b222692b8cb7d0b445f8ee1391c2
@@@ -35,10 -35,8 +35,8 @@@ class MIMEText(MIMENonMultipart)
                  _charset = 'us-ascii'
              except UnicodeEncodeError:
                  _charset = 'utf-8'
-         if isinstance(_charset, Charset):
-             _charset = str(_charset)
  
 -        MIMENonMultipart.__init__(self, 'text', _subtype,
 +        MIMENonMultipart.__init__(self, 'text', _subtype, policy=policy,
-                                   **{'charset': _charset})
+                                   **{'charset': str(_charset)})
  
          self.set_payload(_text, _charset)
Simple merge
diff --cc Misc/NEWS
index 1fc6d638f376d826b8af7a0f25abba0516ebe5f6,a18ceb674e875ca61d16f35e0f2990d7ccb03071..b03e3d54558ade3528dd8a06050525e93f1c63f9
+++ b/Misc/NEWS
@@@ -92,9 -39,30 +92,12 @@@ Core and Builtin
  Library
  -------
  
+ - Issue #27445: Don't pass str(_charset) to MIMEText.set_payload().
+   Patch by Claude Paroz.
 +- Issue #24277: The new email API is no longer provisional, and the docs
 +  have been reorganized and rewritten to emphasize the new API.
 +
  - lib2to3.pgen3.driver.load_grammar() now creates a stable cache file
    between runs given the same Grammar.txt input regardless of the hash
    randomization setting.