get_file() no longer leaks a FILE structure.  If given a file descriptor, it calls dup() to get a new handle.  Then both the FILE object and the fd can be closed.
This is important, because otherwise, the leaked FILE object will be closed on process exit, causing assertions on Windows, e.g. in the test_multiprocessing.py regression test.
1 file changed