Python Forum
That compression method is not supported
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
That compression method is not supported
#7
Buran might be right. What is the error message? Does it say : Bad ZIP found -> That compression method is not supported? If the message starts with "Bad ZIP found", your exception handler caught the error. If it doesn't, the exception was not caught. You've been posting to this forum for over 2 years. You know how it works. Post full error messages and the complete error trace.

Either way, your try/except will not work as you expect. If you catch the exception, the program will jump HERE (marked below) and execute the code in the exception block.

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}")   # <-- JUMP TO HERE IF BadZipFile exception
    continue 
Is the exception body inside or outside the loop?
tester_V likes this post
Reply


Messages In This Thread
RE: That compression method is not supported - by deanhystad - Jan-30-2023, 05:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  compression module for lz4? Skaperen 1 1,619 Oct-27-2021, 01:47 PM
Last Post: DeaD_EyE
  CPC File Format (Cartesian Perceptual Compression) - Can Python Convert / Handle Them PSKrieger 2 2,533 Nov-11-2020, 02:57 PM
Last Post: PSKrieger
  Rebuild LZ compression from C code via Python's LZMA module TD2 0 1,896 Apr-25-2019, 02:42 PM
Last Post: TD2
  problem with lambda and list compression Prince_Bhatia 1 2,390 Aug-06-2018, 11:50 AM
Last Post: ichabod801
  Compression/Decompression Code not working Zanbezi 3 3,769 May-10-2017, 04:46 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020