https://github.com/python/cpython/commit/3ca93ab198497da9451101019b67c52e7873377d
commit: 3ca93ab198497da9451101019b67c52e7873377d
branch: main
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-06-10T14:36:14+03:00
summary:
Add yet one assertion in test_set_text_charset_cp949 (GH-151224)
Check bytes(m), not only str(m).
files:
M Lib/test/test_email/test_contentmanager.py
diff --git a/Lib/test/test_email/test_contentmanager.py
b/Lib/test/test_email/test_contentmanager.py
index bc0e5d356181591..0b1b6e89f8c9922 100644
--- a/Lib/test/test_email/test_contentmanager.py
+++ b/Lib/test/test_email/test_contentmanager.py
@@ -352,7 +352,14 @@ def test_set_text_charset_cp949(self):
x9Gxub7uCoFBCg==
"""))
- self.assertEqual(m.get_payload(decode=True).decode('ks_c_5601-1987'),
content)
+ self.assertEqual(bytes(m), textwrap.dedent("""\
+ Content-Type: text/plain; charset="ks_c_5601-1987"
+ Content-Transfer-Encoding: 8bit
+
+ \ud55c\uad6d\uc5b4
+ \uac02
+ """).encode('ks_c_5601-1987'))
+ self.assertEqual(m.get_payload(decode=True),
content.encode('ks_c_5601-1987'))
self.assertEqual(m.get_content(), content)
def test_set_text_plain_long_line_heuristics(self):
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]