This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients benhoyt, serhiy.storchaka, vstinner
Date 2016-01-02.17:48:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
os.scandir() opens a file descriptor and closes it only in its destructor. This can causes file descriptor leaks in Python implementations without reference counting and if the scandir iterator becomes a part of reference loop or long living object. Since the number of open file descriptors is limited, this can leads to problems.

We need to add the close() method to the scandir iterator (as in files and generators). It would be useful also to make it a context manager.

In 3.5 we have to add a warning about this behavior.
Date User Action Args
2016-01-02 17:48:16serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, benhoyt
2016-01-02 17:48:16serhiy.storchakasetmessageid: <>
2016-01-02 17:48:16serhiy.storchakalinkissue25994 messages
2016-01-02 17:48:15serhiy.storchakacreate