Jan-30-2023, 02:37 AM
Greetings!
I used this snippet for a while but yesterday the script crashed...
with the error:
'That compression method is not supported'
I'm expecting try/except part of the scripts to skip the 'Bad' file but it did not...
Part of the script:
Thank you.
I used this snippet for a while but yesterday the script crashed...
with the error:
'That compression method is not supported'
I'm expecting try/except part of the scripts to skip the 'Bad' file but it did not...
Part of the script:
from zipfile import ZipFile
from zipfile import BadZipfile
from pathlib import Path
# Some code here
try :
with ZipFile(ef) as zz:
for file in zz.namelist():
zp_name = Path(file).name
#print(f" ZIP NAME : {zp_name}")
if 'Trace' in file :
zz.extract(file,temp_temp_dr_out)
except BadZipfile as er :
print(f" Bad ZIP found -> {er}")
continue Any help is appreciated.Thank you.
