[issue25789] py launcher stderr is not piped to subprocess.Popen.stderr
Eryk Sun
report at bugs.python.org
Fri Dec 4 10:30:22 EST 2015
Eryk Sun added the comment:
Patch 2 additionally modifies run_child to call exit() instead of ExitProcess. For example:
>>> import os, subprocess
>>> os.environ['PYLAUNCH_DEBUG'] = '1'
>>> p = subprocess.Popen(r'py -3 -c ""', stderr=subprocess.PIPE, stdout=subprocess.PIPE)
>>> p.stderr.read()
b''
Patched:
>>> p = subprocess.Popen(r'amd64\py_d -3 -c ""', stderr=subprocess.PIPE, stdout=subprocess.PIPE)
>>> p.stderr.readlines()[-1]
b'child process exit code: 0\r\n'
For good measure I also added a call to setvbuf to disable buffering stderr.
----------
Added file: http://bugs.python.org/file41239/issue25789_2.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25789>
_______________________________________
More information about the Python-bugs-list
mailing list