Memory errors with large zip files

Lorn efoda5446 at yahoo.com
Fri May 20 21:04:22 EDT 2005


Ok, I'm not sure if this helps any, but in debugging it a bit I see the
script stalls on:

newFile.write (zf.read (zfilename))

The memory error generated references line 357 of  the zipfile.py
program at the point of decompression:

elif zinfo.compress_type == ZIP_DEFLATED:
   if not zlib:
      raise RuntimeError, \
      "De-compression requires the (missing) zlib module"
      # zlib compress/decompress code by Jeremy Hylton of CNRI
            dc = zlib.decompressobj(-15)
            bytes = dc.decompress(bytes)  ###  <------ right here

Is there anyway to modify how my code is approaching this or perhaps
how the zipfile code is handling it or do I need to just invest in more
RAM? I currently have 512 MB and thought that would be plenty....
perhaps I was wrong :-(. If anyone has any ideas it would truly be very
helpful.

Lorn




More information about the Python-list mailing list