[issue41035] zipfile.Path does not work properly with zip archives where paths start with /

sorrow report at bugs.python.org
Fri Jun 19 08:14:31 EDT 2020


sorrow <lynx1534 at gmail.com> added the comment:

>>> import zipfile
>>> import io
>>> data = io.BytesIO()
>>> zf = zipfile.ZipFile(data, 'w')
>>> zf.writestr('/a.txt', 'content of a')
>>> zf.filename = 'abcde.zip'
>>> root = zipfile.Path(zf)
>>> list(root.iterdir())
[]
>>> root.exists()
False

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41035>
_______________________________________


More information about the Python-bugs-list mailing list