Closed
Description
Bug report
This code works on Python 3.10 and Python 3.11.0a5 but raises a TypeError
in Python 3.11.0b4:
from pathlib import Path
from shutil import make_archive
path = Path.cwd().resolve()
make_archive(path, 'zip', path.parent, path.name)
Here's the output I see in Python 3.11.0b4:
>>> from pathlib import Path
>>> from shutil import make_archive
>>> path = Path.cwd().resolve()
>>> make_archive(path, 'zip', path.parent, path.name)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/trey/.pyenv/versions/3.11.0b4/lib/python3.11/shutil.py", line 1130, in make_archive
filename = func(base_name, base_dir, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/trey/.pyenv/versions/3.11.0b4/lib/python3.11/shutil.py", line 977, in _make_zipfile
zip_filename = base_name + ".zip"
~~~~~~~~~~^~~~~~~~
TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'
Your environment
- CPython versions tested on: Python 3.11.0b4
- Operating system and architecture: 64-bit Ubuntu Linux 20.04