From c7d812d92d8a0a8bbce8c33d95706d802f789fc3 Mon Sep 17 00:00:00 2001 From: Oleg Iarygin Date: Wed, 20 Jul 2022 18:55:12 +0300 Subject: [PATCH] gh-94844: Add pathlib support to shutil archive management (GH-94846) Co-authored-by: Barney Gale (cherry picked from commit ed4441567ec480d1e4d8f982bd1f7347e4d03c42) Co-authored-by: Oleg Iarygin --- Lib/shutil.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/shutil.py b/Lib/shutil.py index 90dcaa7d7682a49..0d278801b8a6cbb 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()