[Python-checkins] python/dist/src/Lib/test test_mmap.py,1.20,1.21

tim_one@sourceforge.net tim_one@sourceforge.net
Wed, 17 Apr 2002 21:30:20 -0700


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

Modified Files:
	test_mmap.py 
Log Message:
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.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** test_mmap.py	8 Mar 2002 05:43:32 -0000	1.20
--- test_mmap.py	18 Apr 2002 04:30:18 -0000	1.21
***************
*** 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()