[issue25994] File descriptor leaks in os.scandir()

Martin Panter report at bugs.python.org
Thu Jan 14 17:49:22 EST 2016


Martin Panter added the comment:

Contextlib.closing() cannot be used in general, because it doesn’t inherit the iterator protocol from the wrapped generator. So I think you really need a class that implements __exit__(), __iter__(), etc at the same time.

----------

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


More information about the Python-bugs-list mailing list