I want to patch python popen2 which tries to close all open filehandres by having a loop on [3, SC_OPEN_MAX]
.
This means that if someone increases the upper limit using ulimit
to a huge value like 1,000,000 it will make any python aplication that uses popen to effectevly block.
The who point of the question is: how can you get the list of opened file handler of your process. The solution should work on linux and Windows, at least.
Note: that's for re-fixing http://bugs.python.org/issue1663329