[Python-checkins] python/dist/src/Lib/test test_gzip.py,1.11,1.12

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Tue Jul 27 23:02:04 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19290/Lib/test
Modified Files:
	test_gzip.py 
Log Message:
Added a new fileno() method. ZODB's repozo.py wants this so it can
apply os.fsync() to the GzipFile backup files it creates.
Index: test_gzip.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gzip.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** test_gzip.py	9 Aug 2002 16:37:35 -0000	1.11
--- test_gzip.py	27 Jul 2004 21:02:02 -0000	1.12
***************
*** 17,22 ****
 """
 
! f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50) ; f.close()
 
 f = gzip.GzipFile(filename, 'r') ; d = f.read() ; f.close()
 verify(d == data1*50)
--- 17,30 ----
 """
 
! f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50)
! 
! # Try flush and fileno.
! f.flush()
! f.fileno()
! if hasattr(os, 'fsync'):
! os.fsync(f.fileno())
! f.close()
 
+ # Try reading.
 f = gzip.GzipFile(filename, 'r') ; d = f.read() ; f.close()
 verify(d == data1*50)


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /