[issue46024] Different behaviour with zipfile
flvn.dev added the comment: The output of: ```python print(repr(path), repr(ZipPath(path))) ``` gives this in both versions: ``` PosixPath('logs/2020/2020101.zip') Path('logs/2020/2020101.zip', '') PosixPath('logs/2021/2021101.zip') Path('logs/2021/2021101.zip', '') ``` -- ___ Python tracker <https://bugs.python.org/issue46024> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46024] Different behaviour with zipfile
New submission from flvn.dev : Given the this directory structure: ``` logs ├── 2020 │ ├── 2020101.zip | ├── ... ├── 2021 │ ├── 2021101.zip | ├── ... ``` The following piece of code: ```python from pathlib import Path from zipfile import Path as ZipPath for item in Path("logs").iterdir(): if item.is_dir(): path = next(item.iterdir()) print(ZipPath(path).name) ``` gives different results between Python 3.9.7 (empty strings) and 3.10.0 (the zip files name) -- messages: 408104 nosy: flvn.dev priority: normal severity: normal status: open title: Different behaviour with zipfile type: behavior versions: Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46024> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com