[issue44482] Possible resource leeak in glob in non-refcount implementations

Guido van Rossum report at bugs.python.org
Tue Jun 22 15:10:18 EDT 2021


Guido van Rossum <guido at python.org> added the comment:

So this is a problem because the generator owns a resource that it will only release once its .close() method is called, right? And we have no control over when that happens -- we can't make it the responsibility of list() to close the iterator passed into it. It is indeed a painful thing. I wonder if we should put a warning somewhere in the docs and tutorials for generators?

The PR looks good.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44482>
_______________________________________


More information about the Python-bugs-list mailing list