sorrow added the comment:
>`iteritems()`
I meant `iterdir()` of course.
--
___
Python tracker
<https://bugs.python.org/issue41035>
___
___
Python-bugs-lis
sorrow added the comment:
Here's what I came up with:
```python
class ZipPath(zipfile.Path):
def __init__(self, root, at=""):
super().__init__(root, at)
if not at.startswith("/") and self.root.namelist()[0].startswith("/"):
self.at = f&quo
sorrow added the comment:
>When the class is created?
I mean the class instance
--
___
Python tracker
<https://bugs.python.org/issue41035>
___
___
Python-
sorrow added the comment:
>`Path` public AP.
API of course
--
___
Python tracker
<https://bugs.python.org/issue41035>
___
___
Python-bugs-list mai
sorrow added the comment:
>how common is this use-case
I don't know about that. I just know that I have to make my program work with
these files. Asking the clients to stop using this (presumably incorrect)
format (or the program that makes it) is not an option.
>It appears th
sorrow added the comment:
>It seems you may have discovered a use-case that violates that expectation, a
>case where `/a.txt` is identical to `a.txt`.
The thing is: it's not.
>Can you tell me more about your use-case and why zipp.Path/zipfile.Path should
>support it?
New submission from sorrow :
I encountered errors when I had to work with ZPI file where path start with "/"
--
components: Library (Lib)
messages: 371880
nosy: sorrow
priority: normal
severity: normal
status: open
title: zipfile.Path does not work properly with zip arch
sorrow added the comment:
>>> import zipfile
>>> import io
>>> data = io.BytesIO()
>>> zf = zipfile.ZipFile(data, 'w')
>>> zf.writestr('/a.txt', 'content of a')
>>> zf.filename = 'a