This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author enrico
Recipients enrico
Date 2011-03-19.16:18:48
SpamBayes Score 0.00161202
Marked as misclassified No
Message-id <1300551530.42.0.377999323642.issue11608@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,

this snippet does not work, because GzipFile wants a file-like object that can do tell() and seek():

#!/usr/bin/python

import gzip
from urllib import urlopen

zfd = urlopen("http://ftp.debian.org/debian/dists/sid/Contents-udeb.gz")
fd = gzip.GzipFile(fileobj=zfd, mode="r")
for line in fd:
    foobar(line)

It must be possible to build a decompressing file-like object wrapper that can do without seeking, since it is obviously not a limitation of gzip decompression libraries. It would be extremely useful to have such a thing, as shown in the example snippet above.

Some more details (including a very annoying misrepresentation of the issue found in Dive Into Python) can be found at http://www.enricozini.org/2011/cazzeggio/python-gzip/ (I apologise about the ranting tone of the post).
History
Date User Action Args
2011-03-19 16:18:50enricosetrecipients: + enrico
2011-03-19 16:18:50enricosetmessageid: <1300551530.42.0.377999323642.issue11608@psf.upfronthosting.co.za>
2011-03-19 16:18:48enricolinkissue11608 messages
2011-03-19 16:18:48enricocreate