memory error with zipfile module

Hari Sekhon sekhon.hari at googlemail.com
Wed Jun 21 06:59:21 EDT 2006


On 20/05/06, Bruno Desthuilliers <bdesth.quelquechose at free.quelquepart.fr>
wrote:
>
> Roger Miller a écrit :
> > The basic problem is that the zipfile interface only reads and writes
> > whole files, so it may perform poorly or fail on huge files.   At one
> > time I implemented a patch to allow reading files in chunks. However I
> > believe that the current interface has too many problems to solve by
> > incremental patching,
>
> Yeps, that was the general tone of some thread on python-dev. And from
> what I saw of the source code, it may effectively not be the cleanest
> part of the stdlib. But what, it does what it was written for at first :
> provide working support for zipped packages.
>
> > and that a zipfile2 module is probably warranted.
> > (Is anyone working on this?)
>
> Seems like Bob Ippolito was on the rank, but I guess you'll get better
> answers on python-dev.
>
> > In the meantime I think the best solution is often to just run an
> > external zip/unzip utility to do the heavy lifting.
>
> Indeed !-)
>
> But while having zip/unzip installed OOTB on a unix-like system is close
> to warrented, it may not be the case on Windows.
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Shame, I would like to try to improve this but seeing as Roger Miller has
already submitted a patch I don't know how much I can do for this. In the
end I resorted to using an external zip utility via os.system().

I'll be interested to know if there is any work done on improving this as
I'm in favour of native python usage, rather than using os.system() and
relying on the operating system having a zip command, which I'm not
convinced is the case on all windows machines, and also, I'm sure gentoo
installs don't have zip by default, since I had to emerge it on a server for
this script to work.

Is it me or is having to use os.system() all the time symtomatic of a
deficiency/things which are missing from python as a language? Not that I'm
complaining, I'm just curious... I'm a fledgeling programmer so I don't mind
being gently corrected by any veterans around.

Hari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060621/205927a7/attachment.html>


More information about the Python-list mailing list