After about 15 minutes of execution, my Python program gets an error message that Too Many Files Are Open. The program executes a loop of code every second.
Every file open statement is done using a with open and every spi.open has a corresponding spi.close.
I imported psutil and added the code below in the program loop:
for f in psutil.Process().open_files()
print(f)
I get no output from the print(f) statement.
I would appreciate any help in resolving the Too Many Files Open issue.
My guess is that one of the processes that psutils.Process() returns has a very large number of files open and your process ulimit does not allow you open that many file descriptors.
By default the limit is 1024 on my Fedora systems.