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 <1283873052.44.0.217663291463.issue9664@psf.upfronthosting.co.za>
In-reply-to
Content
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):
History
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: <1283873052.44.0.217663291463.issue9664@psf.upfronthosting.co.za>
2010-09-07 15:24:09terry.reedylinkissue9664 messages
2010-09-07 15:24:09terry.reedycreate