diff --git a/Lib/email/encoders.py b/Lib/email/encoders.py index 2e77e619e1d..20feb026fdf 100644 --- a/Lib/email/encoders.py +++ b/Lib/email/encoders.py @@ -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' diff --git a/Misc/NEWS b/Misc/NEWS index 0ca4bd3194b..e34d63e99bf 100644 --- 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.