Fix ZIP attribute "external_attr" getting reset

This commit is contained in:
NoDRM
2022-08-06 13:53:03 +02:00
parent 9a11f480b5
commit 80cbaa4841
7 changed files with 114 additions and 9 deletions

View File

@@ -394,6 +394,19 @@ class ZipInfo (object):
extra = extra[ln+4:]
class ZeroedZipInfo(ZipInfo):
def __init__(self, zinfo):
for k in self.__slots__:
if hasattr(zinfo, k):
setattr(self, k, getattr(zinfo, k))
def __getattribute__(self, name):
if name == "external_attr":
return 0
return object.__getattribute__(self, name)
class _ZipDecrypter:
"""Class to handle decryption of files stored within a ZIP archive.