From: Tim Peters Date: Thu, 18 Apr 2002 04:30:18 +0000 (+0000) Subject: SF bug 544733: Cygwin test_mmap fix for Python 2.2.1 X-Git-Tag: v2.3c1~5895 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5379dea2a7ad0639ce15d06a198f71990d039462;p=python SF bug 544733: Cygwin test_mmap fix for Python 2.2.1 Close a file before trying to unlink it, and apparently Cygwin needs writes to an mmap'ed file to get flushed before they're visible. Bugfix candidate, but I think only for the 2.2 line (it's testing features that I think were new in 2.2). --- diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 0f34758925..fcf3c92ca7 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -238,6 +238,7 @@ def test_both(): pass else: verify(0, "Incompatible parameters should raise ValueError.") + f.close() finally: try: os.unlink(TESTFN) @@ -252,6 +253,7 @@ def test_both(): data = 'aabaac\x00deef\x00\x00aa\x00' n = len(data) f.write(data) + f.flush() m = mmap.mmap(f.fileno(), n) f.close()