Zip file failed to unzip using Python but extracted sucessfully on the Windows

44 views Asked by At

I am trying to unzip a .zip file using Python zipfile but got an error message below:

zipfile.BadZipFile: Corrupt extra field 7953 (size=29811)

So I tried it on the Windows (win11), it can be extracted without any problem. Then I zipped it again using the Windows app and this time this re-zipped file works fine by my python program.

just using a sample code:

with ZipFile(file_path, "r") as zip:
     zip.extractall()

Is there any way to get rid of that extra field problem? Thanks.

0

There are 0 answers