[Python-Dev] zipfile.py

Greg Stein gstein@lyra.org
Thu, 16 Dec 1999 12:02:46 -0800 (PST)


On Thu, 16 Dec 1999, James C. Ahlstrom wrote:
> Did anyone look at this yet?
> 
>    ftp://ftp.interet.com/pub/pylib.html
> 
>    ftp://ftp.interet.com/pub/zipfile.py

I went to look for it, but I think that was before you put zipfile up.

Looking at it now...  The writepy() as a method is questionable, I think.
I think it should open the file at instantiation time. I don't see a
reason to allow that to be deferred. Especially given that some of the
methods fail if open() hasn't been called. It would be good to have
symbolic names for the 0 and 8 compression constants, and to fail if 8 is
passed and zlib is not available (otherwise, it doesn't fail until
read/write time, and with a NameError). There should probably be a
__del__ that calls close(). Oh, and a "closed" attribute that can be
checked and an error raised if an operation is done after the file has
been closed. I think dir() should return the contents, rather than print
them. read() and write() ought to fail if the mode is incorrect. Oh, some
symbolic constants for things like "PK\005\006" would be nice.

Do you have a ZipImporter written?

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/