[Python-checkins] python/dist/src/Lib gzip.py,1.40,1.41
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
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19290/Lib
Modified Files:
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: gzip.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/gzip.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** gzip.py 12 Feb 2004 17:35:06 -0000 1.40
--- gzip.py 27 Jul 2004 21:02:01 -0000 1.41
***************
*** 6,10 ****
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
! import struct, sys, time
import zlib
import __builtin__
--- 6,10 ----
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
! import os, struct, sys, time
import zlib
import __builtin__
***************
*** 335,338 ****
--- 335,346 ----
self.fileobj.flush()
+ def fileno(self):
+ """Invoke the underlying file object's fileno() method.
+
+ This will raise AttributeError if the underlying file object
+ doesn't support fileno().
+ """
+ return self.fileobj.fileno()
+
def isatty(self):
return False
More information about the Python-checkins
mailing list