Message372018
When open a ZIP archive, write a file with non-ascii name in it, and, not closing the archive, read that file back, it fails:
>>> import zipfile
>>> with zipfile.ZipFile('test.zip', 'w') as zf:
... zf.writestr('йцукен', '')
... zf.read('йцукен')
...
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/lib/python3.8/zipfile.py", line 1440, in read
with self.open(name, "r", pwd) as fp:
File "/usr/lib/python3.8/zipfile.py", line 1521, in open
raise BadZipFile(
zipfile.BadZipFile: File name in directory 'йцукен' and header b'\xd0\xb9\xd1\x86\xd1\x83\xd0\xba\xd0\xb5\xd0\xbd' differ. |
|
Date |
User |
Action |
Args |
2020-06-21 20:08:04 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka |
2020-06-21 20:08:04 | serhiy.storchaka | set | messageid: <1592770084.24.0.0586983888963.issue41068@roundup.psfhosted.org> |
2020-06-21 20:08:04 | serhiy.storchaka | link | issue41068 messages |
2020-06-21 20:08:03 | serhiy.storchaka | create | |
|