summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-30 07:06:28 (GMT)
committerƁukasz Langa <lukasz@langa.pl>2019-09-30 07:06:28 (GMT)
commit1aeb720d64021e544043ca4619a44a7da0cd00dd (patch)
tree7b790ffe2741d9c92089119372d90e2d15276c64
parent2f87a7dc5a1ad7f37787f0adee242c931643f878 (diff)
downloadcpython-1aeb720d64021e544043ca4619a44a7da0cd00dd.zip
cpython-1aeb720d64021e544043ca4619a44a7da0cd00dd.tar.gz
cpython-1aeb720d64021e544043ca4619a44a7da0cd00dd.tar.bz2
bpo-37408: Precise that Tarfile "format" argument only concerns writing. (GH-14389) (#16465)
(cherry picked from commit c5a7e0ce194c0eafe82eb3e431881012398e7d46) Co-authored-by: Pascal Chambon <pythoniks@gmail.com>
-rw-r--r--Doc/library/tarfile.rst5
1 files changed, 3 insertions, 2 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index f25af8c..c34f2c4 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -290,9 +290,10 @@ be finalized; only the internally used file object will be closed. See the
*fileobj* is not closed, when :class:`TarFile` is closed.
- *format* controls the archive format. It must be one of the constants
+ *format* controls the archive format for writing. It must be one of the constants
:const:`USTAR_FORMAT`, :const:`GNU_FORMAT` or :const:`PAX_FORMAT` that are
- defined at module level.
+ defined at module level. When reading, format will be automatically detected, even
+ if different formats are present in a single archive.
The *tarinfo* argument can be used to replace the default :class:`TarInfo` class
with a different one.