summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mmap.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-06-30 16:20:11 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-06-30 16:20:11 (GMT)
commita6d2c769fb38129b6654f8e4ad5b6b27af182f2c (patch)
treed45f5ca3e8633072da875d9944012f644d440bc3 /Lib/test/test_mmap.py
parenteaf399e3355e6d62b1bb5810b66ad4ff431ece57 (diff)
downloadcpython-a6d2c769fb38129b6654f8e4ad5b6b27af182f2c.zip
cpython-a6d2c769fb38129b6654f8e4ad5b6b27af182f2c.tar.gz
cpython-a6d2c769fb38129b6654f8e4ad5b6b27af182f2c.tar.bz2
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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 712378b..0e18aab 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()