diff options
author | Lars Gustäbel <lars@gustaebel.de> | 2012-05-05 16:15:03 (GMT) |
---|---|---|
committer | Lars Gustäbel <lars@gustaebel.de> | 2012-05-05 16:15:03 (GMT) |
commit | 7a919e993052deec2826d6ba823156c805b1a9d9 (patch) | |
tree | 27fadbf121cdccef114d61d62f211a890d1455fe /Doc/library/tarfile.rst | |
parent | ef5a4636d078d87d30885a9c371671a217754c8d (diff) | |
download | cpython-7a919e993052deec2826d6ba823156c805b1a9d9.zip cpython-7a919e993052deec2826d6ba823156c805b1a9d9.tar.gz cpython-7a919e993052deec2826d6ba823156c805b1a9d9.tar.bz2 |
Issue #13815: TarFile.extractfile() now returns io.BufferedReader objects.
The ExFileObject class was removed, some of its code went into _FileInFile.
Diffstat (limited to 'Doc/library/tarfile.rst')
-rw-r--r-- | Doc/library/tarfile.rst | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst index 92e9df7..86dd33d 100644 --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -376,15 +376,12 @@ be finalized; only the internally used file object will be closed. See the .. method:: TarFile.extractfile(member) Extract a member from the archive as a file object. *member* may be a filename - or a :class:`TarInfo` object. If *member* is a regular file, a :term:`file-like - object` is returned. If *member* is a link, a file-like object is constructed from - the link's target. If *member* is none of the above, :const:`None` is returned. + or a :class:`TarInfo` object. If *member* is a regular file or a link, an + :class:`io.BufferedReader` object is returned. Otherwise, :const:`None` is + returned. - .. note:: - - The file-like object is read-only. It provides the methods - :meth:`read`, :meth:`readline`, :meth:`readlines`, :meth:`seek`, :meth:`tell`, - and :meth:`close`, and also supports iteration over its lines. + .. versionchanged:: 3.3 + Return an :class:`io.BufferedReader` object. .. method:: TarFile.add(name, arcname=None, recursive=True, exclude=None, *, filter=None) |