diff --git a/Lib/shutil.py b/Lib/shutil.py index a4ce2c0290bc932..bb2496fe2ecb03f 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_name) 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} 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