gh-94844: Add pathlib support to shutil archive management (GH-94846)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
(cherry picked from commit ed4441567e)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
This commit is contained in:
Miss Islington (bot) 2022-07-20 09:19:35 -07:00 committed by GitHub
parent 16cb8ca52e
commit 6cc9489a3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1117,6 +1117,8 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
save_cwd = None save_cwd = None
if root_dir is not None: if root_dir is not None:
if support_root_dir: if support_root_dir:
# Support path-like base_name here for backwards-compatibility.
base_name = os.fspath(base_name)
kwargs['root_dir'] = root_dir kwargs['root_dir'] = root_dir
else: else:
save_cwd = os.getcwd() save_cwd = os.getcwd()