[issue1675951] [gzip] Performance for small reads and fix seek problem

Karl D'Adamo report at bugs.python.org
Tue Dec 22 22:21:15 CET 2009

Karl D'Adamo <karld-python at ofb.net> added the comment:

This patch is awesome.  It makes it possible to do this with http
response objects that return gzipped streams:

>>> conn = httplib.HTTPConnection('blah')
>>> req = conn.request('GET', 'a.gz')
>>> resp = conn.getresponse()
>>> unzipper = gzip.GzipFile(fileobj=resp)
# read just the first 100 lines
>>> for i in range(100):
    print unzipper.readline()

nosy: +karld

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list