Message257351
| 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 |
<1451756896.24.0.122789607597.issue25994@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|