Message257351
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:16 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, vstinner, benhoyt |
2016-01-02 17:48:16 | serhiy.storchaka | set | messageid: <1451756896.24.0.122789607597.issue25994@psf.upfronthosting.co.za> |
2016-01-02 17:48:16 | serhiy.storchaka | link | issue25994 messages |
2016-01-02 17:48:15 | serhiy.storchaka | create | |
|