This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2020-06-21.20:08:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592770084.24.0.0586983888963.issue41068@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-06-21 20:08:04serhiy.storchakasetrecipients: + serhiy.storchaka
2020-06-21 20:08:04serhiy.storchakasetmessageid: <1592770084.24.0.0586983888963.issue41068@roundup.psfhosted.org>
2020-06-21 20:08:04serhiy.storchakalinkissue41068 messages
2020-06-21 20:08:03serhiy.storchakacreate