Mailing List Archive

python/dist/src/Lib/test test_mmap.py,1.21,1.22
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv25035/python/Lib/test

Modified Files:
test_mmap.py
Log Message:
test_mmap started breaking on Windows, only when run after test_bsddb.
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.


Index: test_mmap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mmap.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** test_mmap.py 18 Apr 2002 04:30:18 -0000 1.21
--- test_mmap.py 23 Apr 2002 23:07:28 -0000 1.22
***************
*** 18,22 ****
f.write('foo')
f.write('\0'* (PAGESIZE-3) )
!
m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
f.close()
--- 18,22 ----
f.write('foo')
f.write('\0'* (PAGESIZE-3) )
! f.flush()
m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
f.close()