This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: make shutil.make_archive always accept pathlib objects
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: graingert
Priority: normal Keywords: patch

Created on 2020-08-26 10:55 by graingert, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 21962 open graingert, 2020-08-26 11:09
Messages (1)
msg375927 - (view) Author: Thomas Grainger (graingert) * Date: 2020-08-26 10:55
>>> shutil.make_archive(pathlib.Path("./foo"), root_dir=pathlib.Path("./foo"), format="zip")
'/home/graingert/projects/ham/foo.zip'


>>> shutil.make_archive(pathlib.Path("./foo"), root_dir=None, format="zip")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/shutil.py", line 1045, in make_archive
    filename = func(base_name, base_dir, **kwargs)
  File "/usr/lib/python3.8/shutil.py", line 912, in _make_zipfile
    zip_filename = base_name + ".zip"
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'

see also https://bugs.python.org/issue23241
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85809
2020-08-26 11:09:29graingertsetkeywords: + patch
stage: patch review
pull_requests: + pull_request21072
2020-08-26 10:55:22graingertsettitle: make shutil.make_archive always accepts pathlib objects -> make shutil.make_archive always accept pathlib objects
2020-08-26 10:55:12graingertcreate