diff options
author | William Woodruff <william@yossarian.net> | 2020-01-23 02:24:16 (GMT) |
---|---|---|
committer | Ethan Furman <ethan@stoneleaf.us> | 2020-01-23 02:24:16 (GMT) |
commit | dd754caf144009f0569dda5053465ba2accb7b4d (patch) | |
tree | 536217d96dcb3e1d5f57b0bcd53da66059a15ad3 /Doc | |
parent | 41f0ef6abbd304409c55612a08788cdd59fbc8a3 (diff) | |
download | cpython-dd754caf144009f0569dda5053465ba2accb7b4d.zip cpython-dd754caf144009f0569dda5053465ba2accb7b4d.tar.gz cpython-dd754caf144009f0569dda5053465ba2accb7b4d.tar.bz2 |
bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)
`is_tarfile()` now supports `name` being a file or file-like object.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/tarfile.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst index c34f2c4..459e4ad 100644 --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -159,7 +159,10 @@ Some facts and figures: .. function:: is_tarfile(name) Return :const:`True` if *name* is a tar archive file, that the :mod:`tarfile` - module can read. + module can read. *name* may be a :class:`str`, file, or file-like object. + + .. versionchanged:: 3.9 + Support for file and file-like objects. The :mod:`tarfile` module defines the following exceptions: |