summaryrefslogtreecommitdiffstats
path: root/Doc/library/tarfile.rst
diff options
context:
space:
mode:
authorAndrey Doroschenko <dorosch.github.io@yandex.ru>2020-10-20 14:05:01 (GMT)
committerGitHub <noreply@github.com>2020-10-20 14:05:01 (GMT)
commitec42789e6e14f6b6ac13569aeadc13798d7173a8 (patch)
tree4354f760371a9d4d0430d8ec0b610baf4d3703c5 /Doc/library/tarfile.rst
parentfaddc7449d07e883b8ad8bb95dd68ce6dbdc06e8 (diff)
downloadcpython-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 'Doc/library/tarfile.rst')
-rw-r--r--Doc/library/tarfile.rst9
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index cca466b..7a114fd 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -445,10 +445,11 @@ 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 or a link, an
- :class:`io.BufferedReader` object is returned. Otherwise, :const:`None` is
- returned.
+ 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 or
+ a link, an :class:`io.BufferedReader` object is returned. For all other
+ existing members, :const:`None` is returned. If *member* does not appear
+ in the archive, :exc:`KeyError` is raised.
.. versionchanged:: 3.3
Return an :class:`io.BufferedReader` object.