diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 18:20:11 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-30 18:20:11 +0200 |
commit | 160f374a62b3a6871fb7fe8bb988d2836b602277 (patch) | |
tree | ac3bba18e1dbb3dc74a044283f81f036c5ba20ea /Lib/test/test_mmap.py | |
parent | 76939f9daaaba3be470c5f6275e568c9c2d4fc46 (diff) | |
download | cpython-160f374a62b3a6871fb7fe8bb988d2836b602277.tar.gz |
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 712378b4a6..0e18aabd66 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() @@ -501,7 +501,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() |