]> granicus.if.org Git - python/commitdiff
Open the test files in binary mode so the \r\n files won't cause
authorBarry Warsaw <barry@python.org>
Wed, 18 Sep 2002 22:17:57 +0000 (22:17 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 18 Sep 2002 22:17:57 +0000 (22:17 +0000)
failures on Windows.  Closes SF bug # 609988.

Lib/email/test/test_email.py
Lib/email/test/test_email_torture.py

index 95eb0e86b72effb2750f685a42253517ad52bc07..7df5fcc5874d4a98e2c840f31924968ba9189e9a 100644 (file)
@@ -46,7 +46,7 @@ warnings.filterwarnings('ignore', '', DeprecationWarning, __name__)
 \f
 def openfile(filename):
     path = os.path.join(os.path.dirname(landmark), 'data', filename)
-    return open(path)
+    return open(path, 'rb')
 
 
 \f
@@ -743,7 +743,7 @@ Blah blah blah
 class TestMIMEAudio(unittest.TestCase):
     def setUp(self):
         # In Python, audiotest.au lives in Lib/test not Lib/test/data
-        fp = open(findfile('audiotest.au'))
+        fp = open(findfile('audiotest.au'), 'rb')
         try:
             self._audiodata = fp.read()
         finally:
index 1bff09c18cba2e9ea8eb00690f783bcc46a6535d..76d66a9ba71ec61bc82586294be65fa9ef326ecc 100644 (file)
@@ -22,7 +22,7 @@ from email.Iterators import _structure
 def openfile(filename):
     from os.path import join, dirname, abspath
     path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename))
-    return open(path)
+    return open(path, 'rb')
 
 # Prevent this test from running in the Python distro
 try: