Mar-10-2021, 09:24 PM
Greetings!
I’m having errors when extracting files from ZIP archives, see the errors below:
Here is a part of the code that produces errors:
Thank you.
Vlade
I’m having errors when extracting files from ZIP archives, see the errors below:
line 1698, in _extract_member with self.open(member, pwd=pwd) as source, \ ine 698, in _check_compression raise NotImplementedError("That compression method is not supported")I’m using “try-except ” to handle the errors, but the code stops anyway for some reason.
Here is a part of the code that produces errors:
if os.path.isfile(file_path): print("FILE path name:", file_path) try : with ZipFile (file_path, 'r') as zip_file : file_name_list = zip_file.namelist () for file_name in file_name_list : if 'Cell_' in file_name : print ("IN ZIP -->> ",file_path) print ("FILE NAME-->", file_name) try : zip_file.extract(file_name, zip_out) except BadZipfile : continue except BadZipfile : print ("Bad Zip File", zip_file) continueI really would like just to skip the file if failing to unzip, to process the next file if any.
Thank you.
Vlade