[issue11284] slow close file descriptors in subprocess, popen2, os.pepen*

Charles-Francois Natali report at bugs.python.org
Tue Feb 22 10:49:12 CET 2011


Charles-Francois Natali <neologix at free.fr> added the comment:

dup(2) returns the lowest numbered available file descriptor: if there's a discontinuity in the FDs allocation, this code is going to close only the FDs up to the first available FD.
Imagine for example the following:
open("/tmp/foo") = 3
open("/tmp/bar") = 4
close(3)

Then dup(0) will return 3, and not the max FD.

----------
nosy: +neologix

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11284>
_______________________________________


More information about the Python-bugs-list mailing list