]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #7472: ISO-2022 charsets now consistently use 7bit CTE.
authorR. David Murray <rdmurray@bitdance.com>
Mon, 12 Apr 2010 14:26:06 +0000 (14:26 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Mon, 12 Apr 2010 14:26:06 +0000 (14:26 +0000)
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 06016cdea7c08064b655ac167c06594a23aadfb7..c1a44aa88c8d2c684474f512b9708e6b00fcefeb 100644 (file)
@@ -75,7 +75,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 ed6bccb7cfe591fab3e465d17392f79bf7570594..c95076eaed6f7e839c8798bf06f8698a2aff10d3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,6 +15,10 @@ Core and Builtins
 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 #8330: Fix expected output in test_gdb.
 
 - Issue #8374: Update the internal alias table in the :mod:`locale` module