From 94da31bb972b2d62d7d979eab0c8aa43e95a76f1 Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Fri, 23 Aug 2002 15:50:57 +0000 Subject: [PATCH] backport tim_one's checkin of revision 1.21 of test_mmap.py 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). --- Lib/test/test_mmap.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 0f34758925e5..fcf3c92ca752 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() -- 2.47.3