bop-40172: fixed old zip filename corruption

This commit is contained in:
nergall2 2020-04-03 18:11:38 +03:00 committed by GitHub
parent 77c623ba3d
commit 9ff84c7e33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -454,7 +454,7 @@ class ZipInfo (object):
def _encodeFilenameFlags(self):
try:
return self.filename.encode('ascii'), self.flag_bits
return self.filename.encode('cp437'), self.flag_bits
except UnicodeEncodeError:
return self.filename.encode('utf-8'), self.flag_bits | 0x800