I am in France and when trying to extract with the python ZipFile module encrypted zip files coming from Australia or India, files that were encrypted with WINZIP, I get the following error:
File "C:\ProgramData\Anaconda3\lib\zipfile.py", line 719, in _get_decompressor
_check_compression(compress_type)
File "C:\ProgramData\Anaconda3\lib\zipfile.py", line 699, in _check_compression
raise NotImplementedError("That compression method is not supported")
NotImplementedError: That compression method is not supported
I was told the sender started by compressing the file with 7-Zip and then added encryption with Winzip, so I asked her to send the file doing both the compressing and the encryption with Winzip but I get the same error message.
Prior to the encryption the sender only compressed the file with 7-Zip with no password and the extraction worked correctly with the same code.
Any ideas?
The python code used is the following:
with ZipFile(self.DIR_ATT + att) as zipObj:
listOfFileNames = zipObj.namelist()
print(listOfFileNames)
for file in listOfFileNames:
print("FILE:", file)
if str(att.strip(".zip") + "/SR1000C01A") in file:
print("FILE FOUND")
print("password:", password)
zipObj.extract(file, path=self.DIR_ATT, pwd=password.encode())
zipObj.close()
df = pd.read_csv(self.DIR_ATT + file)