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/listinfo/python-list