diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 16:21:39 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 16:21:39 (GMT) |
commit | 2f655b73e4903a218e09cb4c58f7a2b8a706582a (patch) | |
tree | ad17879220d57e7b4048d175d03f9316c02f25f7 /Lib/test/test_mmap.py | |
parent | 3909da7fca2ef92b8483f39b7cf89cac4b6e4826 (diff) | |
parent | a6d2c769fb38129b6654f8e4ad5b6b27af182f2c (diff) | |
download | cpython-2f655b73e4903a218e09cb4c58f7a2b8a706582a.zip cpython-2f655b73e4903a218e09cb4c58f7a2b8a706582a.tar.gz cpython-2f655b73e4903a218e09cb4c58f7a2b8a706582a.tar.bz2 |
(merge 3.2) Issue #12451: Open files in binary mode in some tests when the text
file is not needed.
Remove also an unused variable (blank) in test_threading.
Diffstat (limited to 'Lib/test/test_mmap.py')
-rw-r--r-- | Lib/test/test_mmap.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 4bbb19b..1cfcee6 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -108,7 +108,7 @@ class MmapTests(unittest.TestCase): # Check that the underlying file is truncated too # (bug #728515) - f = open(TESTFN) + f = open(TESTFN, 'rb') try: f.seek(0, 2) self.assertEqual(f.tell(), 512) @@ -308,7 +308,7 @@ class MmapTests(unittest.TestCase): f.write(2**16 * b'a') # Arbitrary character f.close() - f = open(TESTFN) + f = open(TESTFN, 'rb') mf = mmap.mmap(f.fileno(), 2**16, access=mmap.ACCESS_READ) mf.close() mf.close() @@ -530,7 +530,7 @@ class MmapTests(unittest.TestCase): self.assertEqual(m[0:3], b'foo') # Check that the underlying file is truncated too - f = open(TESTFN) + f = open(TESTFN, 'rb') f.seek(0, 2) self.assertEqual(f.tell(), halfsize + 512) f.close() |