We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29f3802 commit 64d2bd3Copy full SHA for 64d2bd3
Lib/test/test_email/test_email.py
@@ -4019,8 +4019,14 @@ def test_bytes_parser_uses_policy_utf8_setting(self):
4019
4020
""".lstrip()
4021
M_BYTES = BytesIO(m.encode())
4022
+
4023
msg = email.message_from_binary_file(M_BYTES, policy=email.policy.default.clone(utf8=True))
- self.assertEqual(msg.as_string(), m)
4024
+ for i, part in enumerate(msg.iter_parts(), 1):
4025
+ _ = part.as_string()
4026
4027
+ msg_string = msg.as_string()
4028
+ self.assertIn("This is the préamble.", msg_string)
4029
+ self.assertIn("Un petit café", msg_string)
4030
4031
def test_parser_does_not_close_file(self):
4032
with openfile('msg_02.txt', encoding="utf-8") as fp:
0 commit comments