mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-39693: mention KeyError in tarfile extractfile documentation (GH-18639)
Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>
This commit is contained in:
parent
faddc7449d
commit
ec42789e6e
4 changed files with 11 additions and 7 deletions
|
@ -2093,9 +2093,10 @@ class TarFile(object):
|
|||
|
||||
def extractfile(self, member):
|
||||
"""Extract a member from the archive as a file object. `member' may be
|
||||
a filename or a TarInfo object. If `member' is a regular file or a
|
||||
link, an io.BufferedReader object is returned. Otherwise, None is
|
||||
returned.
|
||||
a filename or a TarInfo object. If `member' is a regular file or
|
||||
a link, an io.BufferedReader object is returned. For all other
|
||||
existing members, None is returned. If `member' does not appear
|
||||
in the archive, KeyError is raised.
|
||||
"""
|
||||
self._check("r")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue