diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-06-22 08:47:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-22 08:47:25 (GMT) |
commit | fda4b2f06364ae5ef91ecd9c09e2af380c8b0b4c (patch) | |
tree | fb0f9d691445d6d875857c65746493714e4142a7 /Doc/library/shutil.rst | |
parent | f805d37641bd982fd7f252e51e2fdae836fce61c (diff) | |
download | cpython-fda4b2f06364ae5ef91ecd9c09e2af380c8b0b4c.zip cpython-fda4b2f06364ae5ef91ecd9c09e2af380c8b0b4c.tar.gz cpython-fda4b2f06364ae5ef91ecd9c09e2af380c8b0b4c.tar.bz2 |
gh-74696: Do not change the current working directory in shutil.make_archive() if possible (GH-93160)
It is no longer changed when create a zip or tar archive.
It is still changed for custom archivers registered with shutil.register_archive_format()
if root_dir is not None.
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Doc/library/shutil.rst')
-rw-r--r-- | Doc/library/shutil.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst index 9a25b0d..e79caec 100644 --- a/Doc/library/shutil.rst +++ b/Doc/library/shutil.rst @@ -574,12 +574,18 @@ provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules. .. note:: - This function is not thread-safe. + This function is not thread-safe when custom archivers registered + with :func:`register_archive_format` are used. In this case it + temporarily changes the current working directory of the process + to perform archiving. .. versionchanged:: 3.8 The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU format for archives created with ``format="tar"``. + .. versionchanged:: 3.10.6 + This function is now made thread-safe during creation of standard + ``.zip`` and tar archives. .. function:: get_archive_formats() |