[Python-checkins] python/dist/src/Lib/test test_mmap.py,1.19.8.1,1.19.8.2

mwh@users.sourceforge.net mwh@users.sourceforge.net
Fri, 23 Aug 2002 08:50:59 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv6764

Modified Files:
      Tag: release22-maint
	test_mmap.py 
Log Message:
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).


Index: test_mmap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mmap.py,v
retrieving revision 1.19.8.1
retrieving revision 1.19.8.2
diff -C2 -d -r1.19.8.1 -r1.19.8.2
*** test_mmap.py	8 Mar 2002 13:39:25 -0000	1.19.8.1
--- test_mmap.py	23 Aug 2002 15:50:57 -0000	1.19.8.2
***************
*** 239,242 ****
--- 239,243 ----
              else:
                  verify(0, "Incompatible parameters should raise ValueError.")
+             f.close()
      finally:
          try:
***************
*** 253,256 ****
--- 254,258 ----
          n = len(data)
          f.write(data)
+         f.flush()
          m = mmap.mmap(f.fileno(), n)
          f.close()