[New-bugs-announce] [issue41643] make shutil.make_archive always accepts pathlib objects

Thomas Grainger report at bugs.python.org
Wed Aug 26 06:55:12 EDT 2020

New submission from Thomas Grainger <tagrain at gmail.com>:

>>> shutil.make_archive(pathlib.Path("./foo"), root_dir=pathlib.Path("./foo"), format="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

components: Library (Lib)
messages: 375927
nosy: graingert
priority: normal
severity: normal
status: open
title: make shutil.make_archive always accepts pathlib objects
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list