memory error with zipfile module

Sion Arrowsmith siona at chiark.greenend.org.uk
Fri May 19 10:33:14 EDT 2006


Hari Sekhon  <sekhon.hari at googlemail.com> wrote:
>import zipfile
>zip=zipfile.ZipFile('d:\somepath\cdimage.zip')
>zip.namelist()
>['someimage.iso']
 [ ... ]
>B)   content=zip.read('someimage.iso')
>
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "D:\u\Python24\lib\zipfile.py", line 357, in read
>    bytes = dc.decompress(bytes)
>MemoryError
>
>I thought python was supposed to handle memory for you?

Yes, but it can't handle more memory than the operating system
is prepared to give it. How big is cdimage.zip? How big is the
uncompressed someimage.iso? How much memory do you have?

>The python zipfile module is obviously broken...

This isn't at all obvious to me.

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list