]> granicus.if.org Git - python/commitdiff
Merged revisions 79994 via svnmerge from
authorR. David Murray <rdmurray@bitdance.com>
Mon, 12 Apr 2010 14:48:58 +0000 (14:48 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Mon, 12 Apr 2010 14:48:58 +0000 (14:48 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79994 | r.david.murray | 2010-04-12 10:26:06 -0400 (Mon, 12 Apr 2010) | 9 lines

  Issue #7472: ISO-2022 charsets now consistently use 7bit CTE.

  Fixed a typo in the email.encoders module so that messages output using
  an ISO-2022 character set will use a content-transfer-encoding of
  7bit consistently.  Previously if the input data had any eight bit
  characters the output data would get marked as 8bit even though it
  was actually 7bit.
........

Lib/email/encoders.py
Misc/NEWS

index 2e77e619e1d6281daa475b95025e17630d489ce5..20feb026fdf02975bdee07ad879c101577cfbc8b 100644 (file)
@@ -62,7 +62,7 @@ def encode_7or8bit(msg):
         # iso-2022-* is non-ASCII but still 7-bit
         charset = msg.get_charset()
         output_cset = charset and charset.output_charset
-        if output_cset and output_cset.lower().startswith('iso-2202-'):
+        if output_cset and output_cset.lower().startswith('iso-2022-'):
             msg['Content-Transfer-Encoding'] = '7bit'
         else:
             msg['Content-Transfer-Encoding'] = '8bit'
index 0ca4bd3194b7823545d26390cd3be83e17213698..e34d63e99bf780b1ab473f5472bf4ed110349461 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -312,6 +312,10 @@ C-API
 Library
 -------
 
+- Issue #7472: Fixed typo in email.encoders module; messages using ISO-2022
+  character sets will now consistently use a Content-Transfer-Encoding of
+  7bit rather than sometimes being marked as 8bit.
+
 - Issue #8375: test_distutils now checks if the temporary directory are still
   present before it cleans them.