[Patches] Re: New module zipfile.py
James C. Ahlstrom
Thu, 24 Feb 2000 11:44:36 -0500
Guido van Rossum wrote:
> I discovered another problem. I get all sorts of weird dates in the
> future (e.g. 2005). When I list the same zipfile with zipinfo I get
> kosher dates (e.g. 1996). The rest of the date and time are also
> nonsense; could it be that you're not recognizing certain header
> format variations? The zip2date() function seems simple enough...
Try the z.printdir() method. It shows the correct dates.
> I've placed a sample file that exhibits this behavior on
> ftp.python.org in pub/tmp/kiczales.zip.
> For this file, zipinfo says:
> Archive: kiczales.zip 361208 bytes 1 file
> -rw-a-- 2.0 fat 1698308 t- defN 9-Sep-96 13:01 tutorial2.ps
> 1 file, 1698308 bytes uncompressed, 361086 bytes compressed: 78.7%
> Your code finds a date field (TOC tuple item 4) of 0x6820 which
> decodes to 2032/1/0.
TOC tuple item 4 is the time, 5 is the date. This is the
order of the fields in the file.