]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-94844: Add pathlib support to shutil archive management (GH-94846)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 20 Jul 2022 16:19:35 +0000 (09:19 -0700)
committerGitHub <noreply@github.com>
Wed, 20 Jul 2022 16:19:35 +0000 (09:19 -0700)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
(cherry picked from commit ed4441567ec480d1e4d8f982bd1f7347e4d03c42)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Lib/shutil.py

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