[Python-checkins] cpython (merge 3.3 -> default): Issue #12037: Fix test_email for desktop Windows.
terry.reedy
python-checkins at python.org
Sat Aug 31 23:17:08 CEST 2013
http://hg.python.org/cpython/rev/5600e9a5c35d
changeset: 85480:5600e9a5c35d
parent: 85478:7605847c15a4
parent: 85479:f0eedca4b2a2
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Sat Aug 31 17:16:45 2013 -0400
summary:
Issue #12037: Fix test_email for desktop Windows.
files:
Lib/test/test_email/test_email.py | 8 ++++----
Misc/NEWS | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -180,8 +180,8 @@
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 @@
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')
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -165,6 +165,8 @@
Tests
-----
+- Issue #12037: Fix test_email for desktop Windows.
+
- Issue #15507: test_subprocess's test_send_signal could fail if the test
runner were run in an environment where the process inherited an ignore
setting for SIGINT. Restore the SIGINT handler to the desired
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list