Zip File with PPMD Compression, Programmatically Unzip
I have a Linux Python script that needs to unzip some zip files. I was using the zipfile module. On开发者_开发技巧 a few of these files I'm getting:
BadZipfile: Unsupported compression method 98 for file
Searching around it seems these files are using Method 98 PPMD compression. I figured if python couldn't do it, I'd make a hack system call to unzip 6.0 and be done with it. This errors:
skipping: fileName `PPMd' method not supported
I've tried 7zip:
Extracting fileName Unsupported Method
I thought I hit pay-dirt with a command line utility ppmd, but:
Fast PPMII compressor for textual data, variant I, Nov 6 2009
Segmentation fault
Anything else I can try? WinZip in windows has no problem with these files, but I need to do this in Linux.
You can find https://pypi.org/project/zipfile39/ that support zip with PPMd
Have you taken a look at the p7zip (binary)?
It seems to support the PPMD compression format.
Some PPMd switches: -mmem=24b, -mmem=24k, -mmem=24m, -mo=2, and -mo=32
7-zip supports zip/ppmd from 9.11 beta (2010-03-15) according to https://www.7-zip.org/history.txt .
Oh, you are mentioning Python. Yes zipfile39 module should be helpful as @hiroshi miura says. You can also use https://pypi.org/project/zipfile-ppmd/.
精彩评论