how to close a gzip.GzipFile?

2005-04-01 Thread Justin Guerin
Hello list, gzip documentation states that calling the .close() method on a GzipFile doesn't really close it. If I'm really through with it, what's the best way to close it? I'm using Python2.2 (but the gzip module doesn't seem to be any different from 2.4). Here's my code snippet, if it's r

Re: how to close a gzip.GzipFile?

2005-04-01 Thread Justin Guerin
On Friday 01 April 2005 11:54, Justin Guerin wrote: > Hello list, > > gzip documentation states that calling the .close() method on a GzipFile > doesn't really close it. If I'm really through with it, what's the best > way to close it? I'm using Python2.2 (but the gzip module doesn't seem > to be

Re: how to close a gzip.GzipFile?

2005-04-01 Thread Sidharth
GzipFile has a parameter 'fileobj' which you could use. GzipFile( [filename[, mode[, compresslevel[, fileobj) For iteratng over the file how about : line = oldfileobj.readline() while line !="": oldmd5.update(line) line = oldfileobj.readline() -- http://mail.python.org/mailman/listinf