]> 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:24:33 +0000 (09:24 -0700)
committerGitHub <noreply@github.com>
Wed, 20 Jul 2022 16:24:33 +0000 (09:24 -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 90dcaa7d7682a498d4b9e4c78ecef0109454d47d..0d278801b8a6cbbfdec263d80791f12257d286c4 100644 (file)
@@ -1108,6 +1108,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()