Author doko
Recipients doko
Date 2010-08-23.08:06:46
SpamBayes Score 9.01016e-07
Marked as misclassified No
Message-id <>
[ forwarded from ]

"I'm writing a program that uses the popularity contest results.  Since
downloading the compressed results takes about a quarter of the time
it takes to download the uncompressed results, I'd like to use the
following construct to iterate over the results:

 for line in gzip.GzipFile(fileobj=urllib.request.urlopen('')):

Unfortunately, this fails with the following exception:

 Traceback (most recent call last):
   File "/home/kraai/bin/rc-bugs", line 76, in <module>
   File "/home/kraai/bin/rc-bugs", line 56, in main
     for line in gzip.GzipFile(fileobj=urllib.request.urlopen('')): 
   File "/usr/lib/python3.1/", line 469, in __next__
     line = self.readline()
   File "/usr/lib/python3.1/", line 424, in readline
     c =
   File "/usr/lib/python3.1/", line 249, in read
   File "/usr/lib/python3.1/", line 277, in _read
     pos = self.fileobj.tell()   # Save current position
 io.UnsupportedOperation: seek

I wish that the gzip module didn't require the underlying file object
to support seek so that this construct would work."
Date User Action Args
2010-08-23 08:06:50dokosetrecipients: + doko
2010-08-23 08:06:50dokosetmessageid: <>
2010-08-23 08:06:48dokolinkissue9664 messages
2010-08-23 08:06:46dokocreate