bpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040)

This commit is contained in:
Serhiy Storchaka 2020-06-22 11:24:11 +03:00 committed by GitHub
parent c88239f864
commit 36ff513f82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -1534,7 +1534,7 @@ class ZipFile:
# strong encryption
raise NotImplementedError("strong encryption (flag bit 6)")
if zinfo.flag_bits & 0x800:
if fheader[_FH_GENERAL_PURPOSE_FLAG_BITS] & 0x800:
# UTF-8 filename
fname_str = fname.decode("utf-8")
else: