summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mmap.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_mmap.py')
-rw-r--r--Lib/test/test_mmap.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 417080f..69d3cd5 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -297,6 +297,24 @@ def test_both():
except OSError:
pass
+ # make sure a double close doesn't crash on Solaris (Bug# 665913)
+ f = open(TESTFN, 'w+')
+
+ try: # unlink TESTFN no matter what
+ f.write(2**24 * 'a') # Arbitrary character
+ f.close()
+
+ f = open(TESTFN)
+ mf = mmap.mmap(f.fileno(), 2**24, access=mmap.ACCESS_READ)
+ mf.close()
+ mf.close()
+ f.close()
+
+ finally:
+ try:
+ os.unlink(TESTFN)
+ except OSError:
+ pass
print ' Test passed'