Message115776
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:12 | terry.reedy | set | recipients:
+ terry.reedy, doko, kraai, r.david.murray |
2010-09-07 15:24:12 | terry.reedy | set | messageid: <1283873052.44.0.217663291463.issue9664@psf.upfronthosting.co.za> |
2010-09-07 15:24:09 | terry.reedy | link | issue9664 messages |
2010-09-07 15:24:09 | terry.reedy | create | |
|