Open the test files in binary mode so the \r\n files won't cause
failures on Windows. Closes SF bug # 609988.
This commit is contained in:
parent
f027eac92b
commit
40363b63f0
|
@ -46,7 +46,7 @@ warnings.filterwarnings('ignore', '', DeprecationWarning, __name__)
|
||||||
|
|
||||||
def openfile(filename):
|
def openfile(filename):
|
||||||
path = os.path.join(os.path.dirname(landmark), 'data', filename)
|
path = os.path.join(os.path.dirname(landmark), 'data', filename)
|
||||||
return open(path)
|
return open(path, 'rb')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -743,7 +743,7 @@ Blah blah blah
|
||||||
class TestMIMEAudio(unittest.TestCase):
|
class TestMIMEAudio(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
# In Python, audiotest.au lives in Lib/test not Lib/test/data
|
# In Python, audiotest.au lives in Lib/test not Lib/test/data
|
||||||
fp = open(findfile('audiotest.au'))
|
fp = open(findfile('audiotest.au'), 'rb')
|
||||||
try:
|
try:
|
||||||
self._audiodata = fp.read()
|
self._audiodata = fp.read()
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -22,7 +22,7 @@ from email.Iterators import _structure
|
||||||
def openfile(filename):
|
def openfile(filename):
|
||||||
from os.path import join, dirname, abspath
|
from os.path import join, dirname, abspath
|
||||||
path = abspath(join(dirname(testfile), os.pardir, 'moredata', filename))
|
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
|
# Prevent this test from running in the Python distro
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue