Stem : Too many open file error
If you launch many connection over Tor using stem and launch_tor_with_config function, you'll probably have an exception like : OSError: [Errno 24] Too many open files
The problem is comming from this line: torrc_path = tempfile.mkstemp(prefix = "torrc-", text = True)
This exception is raise because "tempfile.mkstemp" create a file descriptor which is never closed in process.py file.
To properly close tempile, you have to use this correction : fileDescriptor, torrc_path = tempfile.mkstemp(prefix = 'torrc-', text = True)
Before delete the temp file, you just have to close the file descriptor: os.close(fileDescriptor)