[issue15005] trace corrupts return result on chained execution

Amaury Forgeot d'Arc report at bugs.python.org
Tue Jun 5 18:09:09 CEST 2012


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

It's not possible to delay output collection: output starts being collected just after the call os.dup2(cp2write, 1) and before exec(), we need to os.close it.  The trace module will already have emitted some lines.

Process output by definition goes to the C stdout, but you could redirect sys.stdout (the Python one, used by print) to something else, like a StringIO so that trace.py does not pollute the subprocess output.

In 3.2, suprocess.py states that the pure Python implementation (the one use in 2.7) is not thread safe.  We could add that it's not reentrant or trace-friendly as well... this is not surprising IMO.

----------

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


More information about the Python-bugs-list mailing list