From f6f8645bd7c6ebae7b84fcbc8fcfeee410318a67 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 26 Aug 2020 12:07:11 +0100 Subject: [PATCH 1/3] bpo-41643: always support pathlib in shutil.make_archive --- Lib/shutil.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/shutil.py b/Lib/shutil.py index a4ce2c0290bc932..6cd4c388bb7e050 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -1030,8 +1030,10 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, uses the current owner and group. """ sys.audit("shutil.make_archive", base_name, format, root_dir, base_dir) + base_name = os.fsdecode(base_dir) save_cwd = os.getcwd() if root_dir is not None: + root_dir = os.fsdecode(root_dir) if logger is not None: logger.debug("changing into '%s'", root_dir) base_name = os.path.abspath(base_name) @@ -1040,6 +1042,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, if base_dir is None: base_dir = os.curdir + base_dir = os.fsdecode(base_dir) kwargs = {'dry_run': dry_run, 'logger': logger} From 3c1d2c90edecc5ae64497d1fadd413c72956e271 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 26 Aug 2020 12:16:47 +0100 Subject: [PATCH 2/3] Update Lib/shutil.py --- Lib/shutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/shutil.py b/Lib/shutil.py index 6cd4c388bb7e050..bb2496fe2ecb03f 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -1030,7 +1030,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, uses the current owner and group. """ sys.audit("shutil.make_archive", base_name, format, root_dir, base_dir) - base_name = os.fsdecode(base_dir) + base_name = os.fsdecode(base_name) save_cwd = os.getcwd() if root_dir is not None: root_dir = os.fsdecode(root_dir) From 8d4167e441117855a8f3ad7f41342ee88bc19d35 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2020 11:56:37 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2020-08-26-11-56-35.bpo-41643.1ESh-R.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2020-08-26-11-56-35.bpo-41643.1ESh-R.rst diff --git a/Misc/NEWS.d/next/Library/2020-08-26-11-56-35.bpo-41643.1ESh-R.rst b/Misc/NEWS.d/next/Library/2020-08-26-11-56-35.bpo-41643.1ESh-R.rst new file mode 100644 index 000000000000000..32c608eb9dbe016 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-26-11-56-35.bpo-41643.1ESh-R.rst @@ -0,0 +1 @@ +always support pathlib in shutil.make_archive \ No newline at end of file