diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2013-08-31 21:16:45 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2013-08-31 21:16:45 (GMT) |
commit | 7e7cf8bc51cc8a8148a0ac891bd5c88092272bab (patch) | |
tree | 407e7842ec6a641fedbcbca5f1bde41f200a2e27 /Lib/test/test_email | |
parent | 2e87c87933338c9ef1a1235b04e654264ea2cc0e (diff) | |
parent | 740d6b6f39b169fe8c1ba2322fbab270aae731ea (diff) | |
download | cpython-7e7cf8bc51cc8a8148a0ac891bd5c88092272bab.zip cpython-7e7cf8bc51cc8a8148a0ac891bd5c88092272bab.tar.gz cpython-7e7cf8bc51cc8a8148a0ac891bd5c88092272bab.tar.bz2 |
Issue #12037: Fix test_email for desktop Windows.
Diffstat (limited to 'Lib/test/test_email')
-rw-r--r-- | Lib/test/test_email/test_email.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 202cee8..b62a889 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -180,8 +180,8 @@ class TestMessageAPI(TestEmailBase): def test_byte_message_rfc822_only(self): # Make sure new bytes header parser also passes this. - with openfile('msg_46.txt', 'rb') as fp: - msgdata = fp.read() + with openfile('msg_46.txt') as fp: + msgdata = fp.read().encode('ascii') parser = email.parser.BytesHeaderParser() msg = parser.parsebytes(msgdata) out = BytesIO() @@ -269,8 +269,8 @@ class TestMessageAPI(TestEmailBase): def test_as_bytes(self): msg = self._msgobj('msg_01.txt') - with openfile('msg_01.txt', 'rb') as fp: - data = fp.read() + with openfile('msg_01.txt') as fp: + data = fp.read().encode('ascii') self.assertEqual(data, bytes(msg)) fullrepr = msg.as_bytes(unixfrom=True) lines = fullrepr.split(b'\n') |