[Python-Dev] Suggested doc patch for tarfile
ben at redfrontdoor.org
Thu Apr 23 14:54:59 CEST 2009
The current documentation for tarfile.TarFile.extractfile() does not
mention that the returned 'file-like object' supports close() and also
iteration. The attached patch (against svn trunk) fixes this.
(Background: I was wondering whether I could write
with closing(f_in) as f:
# Do stuff with f.
and have it work whether f_in was a true file or the return value of
extractfile(), and thought from the documentation that I couldn't. Of
course, I could have just tried it, but I think fixing the documentation
Alternative: enhance the tarfile.ExFileObject class to support use as a
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 612 bytes
Desc: not available
More information about the Python-Dev