unzipping a zipx file

Serhiy Storchaka storchaka at gmail.com
Sat Apr 20 11:45:10 EDT 2013


19.04.13 20:59, b_erickson1 написав(ла):
> I have python 2.6.2 and I trying to get it to unzip a file made with winzip pro.  The file extension is zipx.  This is on a windows machine where I have to send them all that files necessary to run.  I am packaging this with py2exe.  I can open the file with
> zFile = zipfile.ZipFile(fullPathName,'r')
> and I can look through all the file in the archive
> for filename in zFile.namelist():
> but when I write the file out with this code:
>              ozFile = open(filename,'w')
>              ozFile.write(zFile.read(filename))
>              ozFile.close()
> that file still looks encrypted.

AFAIK some archivers use zipx extension for zip files which contains 
files compressed with advanced compression methods (bzip2, lzma, etc). 
Python supports bzip2 and lzma compression in zip files since 3.3.

> No errors are thrown.

Python 2.7 and 3.2 should raise an exception (this bug was fixed several 
months ago). 2.6 is too old and this fix was not backported to it.

 > What am I missing?

Use Python 3.3 or at least 2.7.




More information about the Python-list mailing list