classification
Title: Documentation: mention 'close' and iteration for tarfile.TarFile.extractfile()
Type: enhancement Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: bennorth, georg.brandl
Priority: normal Keywords: patch

Created on 2009-04-23 13:03 by bennorth, last changed 2009-04-25 15:05 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
tarfile.rst.patch bennorth, 2009-04-23 13:03 Patch to Doc/library/tarfile.rst
Messages (2)
msg86366 - (view) Author: Ben North (bennorth) * Date: 2009-04-23 13:03
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

  def process_and_close_file(f_in):
      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
wouldn't hurt.)
msg86525 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-25 15:05
Thanks, applied in r71903.
History
Date User Action Args
2009-04-25 15:05:14georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg86525
2009-04-23 13:03:08bennorthcreate