Issue #10184: Touch directories only once when extracting a tarfile.
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index 0dfb065..d7fbf39 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -336,12 +336,13 @@
dots ``".."``.
-.. method:: TarFile.extract(member, path="")
+.. method:: TarFile.extract(member, path="", set_attrs=True)
Extract a member from the archive to the current working directory, using its
full name. Its file information is extracted as accurately as possible. *member*
may be a filename or a :class:`TarInfo` object. You can specify a different
- directory using *path*.
+ directory using *path*. File attributes (owner, mtime, mode) are set unless
+ *set_attrs* is False.
.. note::
@@ -352,6 +353,8 @@
See the warning for :meth:`extractall`.
+ .. versionchanged:: 3.2
+ Added the *set_attrs* parameter.
.. method:: TarFile.extractfile(member)