zipfile (Python 2.0) incompatible with InfoZip 2.3?

Chris Gonnerman chris.gonnerman at usa.net
Thu Apr 19 08:44:20 EDT 2001


The zipfile module is a minimally functional zip archiver, handling
only one of several compression schemes.  Generally, zipfile can extract
what zipfile archives, and others can extract what zipfile archives, but
zipfile can't necessarily extract what others archive.

----- Original Message -----
From: "Mike C. Fletcher" <mcfletch at home.com>
To: "Python List (E-mail)" <python-list at python.org>
Sent: Thursday, April 19, 2001 5:12 AM
Subject: zipfile (Python 2.0) incompatible with InfoZip 2.3?


> I'm using Info-Zip 2.3, as is a group whose files I'm trying to work with.
> However, I can't seem to get the zipfile module to interact with the files
> produced by Info-Zip.  (The python file is used for illustration only, I'm
> trying to extract text index files from the archives the other group is
> producing).
>
> P:\>zip test.zip uthread9.py
>   adding: uthread9.py (92 bytes security) (deflated 71%)
>
> P:\>unzip test.zip
> Archive:  test.zip
> replace uthread9.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
>   inflating: uthread9.py
>
> >>> import zipfile
> >>> z = zipfile.ZipFile( 'p:\\test.zip', 'r', zipfile.ZIP_DEFLATED )
> >>> s = z.read('uthread9.py' )
> Traceback (innermost last):
>   File "<interactive input>", line 1, in ?
>   File "d:\bin\lang\py2\lib\zipfile.py", line 242, in read
>     bytes = dc.decompress(bytes)
> error: Error -3 while decompressing: invalid stored block lengths
> >>> for key, value in z.filelist[0].__dict__.items():
> .... print key, repr(value)
> ....
> internal_attr 1
> create_system 11
> flag_bits 0
> file_size 47883
> compress_type 8
> compress_size 14084
> file_offset 58
> CRC 1697539815
> volume 0
> filename 'uthread9.py'
> header_offset 0
> extract_version 20
> external_attr -2118778848
> create_version 23
> comment ''
> reserved 0
> date_time (2000, 11, 30, 22, 31, 10)
> extra 'SD\004\000\\\000\000\000UT\005\000\007}\033\':'
>
> Is this a known limitation? I don't see any notes in the source or
> documentation about it if it is.  Have I managed to misuse the module in
> some way?  I have tried the python code with both ZIP_DEFLATED and
> ZIP_STORED, with no change in the error.
>
> Thoughts appreciated,
> Mike
>
> __________________________________
>  Mike C. Fletcher
>  Designer, VR Plumber
>  http://members.home.com/mcfletch
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>





More information about the Python-list mailing list