Terry J. Reedy <tjre...@udel.edu> added the comment:

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):

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9664>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to