test_mmap started breaking on Windows, only when run after test_bsddb.
authorTim Peters <tim.peters@gmail.com>
Tue, 23 Apr 2002 23:07:28 +0000 (23:07 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 23 Apr 2002 23:07:28 +0000 (23:07 +0000)
On Win2K it thought 'foo' started at byte offset 0 instead of at the
pagesize, and on Win98 it thought 'foo' didn't exist at all.  Somehow
or other this is related to the new "in memory file" gimmicks in
bsddb, but the old bsddb we use on Windows sucks so bad anyway I don't
want to bother digging deeper.  Flushing the file in test_mmap after
writing to it makes the problem go away, so good enough.

Lib/test/test_mmap.py

index fcf3c92ca752f0752281a6da680801a68740ccf6..4fb4ec10c504503c895fe85f39e9e0be61404369 100644 (file)
@@ -17,7 +17,7 @@ def test_both():
         f.write('\0'* PAGESIZE)
         f.write('foo')
         f.write('\0'* (PAGESIZE-3) )
-
+        f.flush()
         m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
         f.close()