[Python-checkins] gh-94844: Add pathlib support to shutil archive management (GH-94846)

miss-islington webhook-mailer at python.org
Wed Jul 20 12:24:43 EDT 2022


https://github.com/python/cpython/commit/cbe3ad51ed63e2e5afc408f0bbeb8bb0e9fb7f44
commit: cbe3ad51ed63e2e5afc408f0bbeb8bb0e9fb7f44
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-07-20T09:24:33-07:00
summary:

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


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

Co-authored-by: Oleg Iarygin <oleg at arhadthedev.net>

files:
M Lib/shutil.py

diff --git a/Lib/shutil.py b/Lib/shutil.py
index 90dcaa7d7682a..0d278801b8a6c 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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()



More information about the Python-checkins mailing list