diff options
author | Andrey Doroschenko <dorosch.github.io@yandex.ru> | 2020-10-20 14:05:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-20 14:05:01 (GMT) |
commit | ec42789e6e14f6b6ac13569aeadc13798d7173a8 (patch) | |
tree | 4354f760371a9d4d0430d8ec0b610baf4d3703c5 /Lib/tarfile.py | |
parent | faddc7449d07e883b8ad8bb95dd68ce6dbdc06e8 (diff) | |
download | cpython-ec42789e6e14f6b6ac13569aeadc13798d7173a8.zip cpython-ec42789e6e14f6b6ac13569aeadc13798d7173a8.tar.gz cpython-ec42789e6e14f6b6ac13569aeadc13798d7173a8.tar.bz2 |
bpo-39693: mention KeyError in tarfile extractfile documentation (GH-18639)
Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>
Diffstat (limited to 'Lib/tarfile.py')
-rwxr-xr-x | Lib/tarfile.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 1fae294..e422794 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -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") |