Skip to content

gh-94844: Add pathlib support to shutil archive management #94846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 20, 2022
2 changes: 2 additions & 0 deletions Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,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()
Expand Down