[issue10806] Subprocess error if fds 0,1,2 are closed

Antoine Pitrou report at bugs.python.org
Sun Jan 2 19:27:14 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> Attached is a patch which basically uses fcntl if necessary to remove
> the close-on-exec flag, and tests.

Python adds extra output at the end of stderr when compiled in debug
mode. Therefore you first have to strip that output, like this:

            out, err = subprocess.Popen(...).communicate()
            err = support.strip_python_stderr(err)
            self.assertEqual((out, err), (b'apple', b'orange'))

Otherwise, looks good, thank you.

----------

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


More information about the Python-bugs-list mailing list