diff options
author | Yaroslav Halchenko <debian@onerussian.com> | 2012-07-06 15:26:26 -0400 |
---|---|---|
committer | Yaroslav Halchenko <debian@onerussian.com> | 2012-07-06 15:26:26 -0400 |
commit | 613589e2286b03171829bf4ff8cb5c9c863df4be (patch) | |
tree | a713b38fac339af4f25728b44725b57d2088cfd8 | |
parent | c35c83c2e7b9f0cd51606d5a63c36cc68cf4556a (diff) | |
download | numpy-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.py | 6 |
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() |