[issue23700] tempfile.NamedTemporaryFile can close too early if used as iterator

STINNER Victor report at bugs.python.org
Fri Mar 20 17:02:55 CET 2015


STINNER Victor added the comment:

> Isn't there some discussion somewhere that if iter(x) returns x you probably have buggy code?

I agree that the issue comes from TextIOWrapper.__iter__(),
BufferedReader.__iter__() and FileIO.__iter__() returns simply return
self *and* have a close method. The issue is not "yield from".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23700>
_______________________________________


More information about the Python-bugs-list mailing list