summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaroslav Halchenko <debian@onerussian.com>2012-07-06 15:26:26 -0400
committerYaroslav Halchenko <debian@onerussian.com>2012-07-06 15:26:26 -0400
commit613589e2286b03171829bf4ff8cb5c9c863df4be (patch)
treea713b38fac339af4f25728b44725b57d2088cfd8
parentc35c83c2e7b9f0cd51606d5a63c36cc68cf4556a (diff)
downloadnumpy-613589e2286b03171829bf4ff8cb5c9c863df4be.tar.gz
BF(PY3): open file handles in tests in binary mode
otherwise zipfile of python3 gets confused to receive bytes for the header whenever handle is opened for a text (unicode) file
-rw-r--r--numpy/lib/tests/test_io.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index f6cc365ef..c539c040a 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -174,11 +174,11 @@ class TestSavezLoad(RoundtripTest, TestCase):
fd, tmp = mkstemp(suffix='.npz')
os.close(fd)
try:
- fp = open(tmp, 'w')
+ fp = open(tmp, 'wb')
np.savez(fp, data='LOVELY LOAD')
fp.close()
- fp = open(tmp, 'r', 10000)
+ fp = open(tmp, 'rb', 10000)
fp.seek(0)
assert_(not fp.closed)
_ = np.load(fp)['data']
@@ -199,7 +199,7 @@ class TestSavezLoad(RoundtripTest, TestCase):
os.close(fd)
try:
- fp = open(tmp, 'w')
+ fp = open(tmp, 'wb')
np.savez(fp, data='LOVELY LOAD')
fp.close()