logilab-astng #62295 Getting "OSError: Too many open files" when running pylint repeatedly on huge number of python scripts [validation pending]

The issue is that running pylint repeatedly on about 500 files, I get OSError: Too many open files.

I use pylint like such:

import os
import sys
from pylint import lint
args = sys.argv[1:]
for root, dirs, files in os.walk(args[0]):
for file in files:
if not file.endswith('.py'): continue
try:
lint.Run(args)
except OSError, e:
raise
except SystemExit, e:
returncode = e.code

I installed pylint-0.23.0.tar.gz and ran it using python 2.6.4. I found the workaround by increasing the max file descriptors with ulimit to more than 4000.

priorityimportant
typebug
done in0.23.1
load0.100
load left0.000
closed by#df946b92d8fe closes #62295: avoid "OSError: Too many open files"