Re: Unzip: Memory Error

2007-08-30 Thread David Bolen
I wrote: > Here's a small example of a ZipFile subclass (tested a bit this time) > that implements two generator methods: Argh, not quite tested enough - one fix needed, change: if bytes[-1] not in ('\n', '\r'): partial = lines.pop() to: if bytes[-1] not

Re: Unzip: Memory Error

2007-08-30 Thread David Bolen
David Bolen <[EMAIL PROTECTED]> writes: > If you are going to read the file data incrementally from the zip file > (which is what my other post provided) you'll prevent the huge memory > allocations and risk of running out of resource, but would have to > implement your own line ending support if

Re: Unzip: Memory Error

2007-08-30 Thread David Bolen
mcl <[EMAIL PROTECTED]> writes: > pseudo code > > zfhdl = zopen(zip,filename) # Open File in Zip Archive for > Reading > > while True: > ln = zfhdl.readline()# Get nextline of file > if not ln: # if EOF file > break > dealwithline(ln)

Re: Unzip: Memory Error

2007-08-30 Thread mcl
On 29 Aug, 21:18, David Bolen <[EMAIL PROTECTED]> wrote: > mcl <[EMAIL PROTECTED]> writes: > > I am trying to unzip an 18mb zip containing just a single 200mb file > > and I get a Memory Error. When I run the code on a smaller file 1mb > > zip, 11mb file, it works fine. > (...) > > def unzip_file_

Re: Unzip: Memory Error

2007-08-29 Thread David Bolen
mcl <[EMAIL PROTECTED]> writes: > I am trying to unzip an 18mb zip containing just a single 200mb file > and I get a Memory Error. When I run the code on a smaller file 1mb > zip, 11mb file, it works fine. (...) > def unzip_file_into_dir(file, dir): > #os.mkdir(dir, 0777) > zfobj = zi