[pypy-issue] Issue #2409: OS X leaks FDs while failing to open dirs (pypy/pypy)

Maciej Fijalkowski issues-reply at bitbucket.org
Sun Oct 2 13:06:24 EDT 2016


New issue 2409: OS X leaks FDs while failing to open dirs
https://bitbucket.org/pypy/pypy/issues/2409/os-x-leaks-fds-while-failing-to-open-dirs

Maciej Fijalkowski:

Here is the code:


```
#!python

import os
for x in range(100):
    for item in os.listdir('mercurial'):
        try:
            f = open(os.path.join('mercurial', item))
        except (OSError, IOError):
            pass
        else:
            f.close()
```

run it on e.g. mercurial repo, crashes with "Too many open files"





More information about the pypy-issue mailing list