Author terry.reedy
Recipients doko, kraai, r.david.murray, terry.reedy
Date 2010-09-07.15:24:09
SpamBayes Score 0.000258194
Marked as misclassified No
Message-id <>
It is possible that only a fixed-size buffer is needed. If so, use of an alternate read mechanism could be conditioned on the underlying file(like) object not having seek.

It is also possible to direct a stream to a temporary file, but I think having the user do so explicitly is better so there are no surprises and so that the user has file reference for any further work.

Or their could be a context manager class for creating temp files from streams (or urls specifically) and deleting when done. One could then write

with TempStreamFile(urlopen('xxx') as f:
  for line in Gzipfile(fileobj=f):
Date User Action Args
2010-09-07 15:24:12terry.reedysetrecipients: + terry.reedy, doko, kraai, r.david.murray
2010-09-07 15:24:12terry.reedysetmessageid: <>
2010-09-07 15:24:09terry.reedylinkissue9664 messages
2010-09-07 15:24:09terry.reedycreate