New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSError: [Errno 24] Too many open files #302
Comments
I've encountered the same issue as well both on mac high sierra and ubuntu linux. My code was also wrapped in a loop, and it would run fine initially, but at some point in the loop, it would start outputting [Errno 24] Too many open files. Is it possible that calling session.close() might not be closing the browser instance properly sometimes? |
Hey, have you found a solution for this? I have the same problem right now... |
@alainmore Sadly I don't have a concrete fix, because I don't know the root cause of the problem. But, I can say that the issue disappeared for me when I wrapped the requests-html portion of the code in a "with" statement. I dockerized the entire script and deployed it on AWS and the problem went away. I don't know if it's a combination of all those or just one specific action that fixed the issue for me. |
My situation was time sensitive and after trying several obvious fixes I went back to BeautifulSoup. @pmdbt’s idea seems good, I can’t remember if I tried it. |
Can you please give the code of how you did that? It seems that each call to request-html leaves one file (pipe) open, even when you call session.close() each time, and after about 240 calls the OS quits with this error (MacOS High Sierra in my case). |
@varalgit not sure if you discovered this on your own, but your question was helpfully answered on SO. Hope that helps! |
Using macOS Mojave 10.14.4, requests-html 0.10.0, python 3.6. I'm running the following inside a loop over a number of files:
Traceback:
I found a similar issue associated with
requests
but haven't found a solution there yet.The text was updated successfully, but these errors were encountered: