Yaniv Aknin <yaniv.ak...@gmail.com> added the comment: It seems to me that subprocess is protected against this flaw. Python 2.x has a pure-Python implementation of the child logic (which is susceptible to an unrelated issue). Python 3.x has a C implementation which falls back to pure-Python if the former is not available.
Both implementations test explicitly that they're not closing standard file descriptors after the dup2() call in the child. It is my understanding that test is sufficient, I couldn't reproduce the bug in Python, and thus I think this issue should be closed. All that said, there was no coverage in subprocess' test for this particular case (spawning a coprocess when the standard fds closed). I'm attaching a patch which adds a testcase to cover it. ---------- keywords: +patch nosy: +Yaniv.Aknin Added file: http://bugs.python.org/file16801/test_subprocess_with_standard_fds_closed.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6610> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com