Open yurivict opened 5 hours ago
Hi yurivict, could you clarify what you are expecting to happen, and how that differs from what actually happens?
Are you perhaps expecting stderr=subprocess.STDOUT
to cause the child process' stderr to go the parent process' stdout (and therefore sys.stderr.isatty()
would be True, not False)? If so, that's not quite what that means. stderr=subprocess.STDOUT
means that the child process' stderr will be redirected to the same handle as its stdout, similar to using 2>&1
in a shell. In this case, that means that both stdout and stderr will be directed to the log file. If you want the child process' stderr to be directed to the parent process' stdout, I believe you can pass stderr=sys.stdout
.
Bug report
Bug description:
Testcase:
Additional file sp-child.py:
The subprocess.Popen argument requests child's stderr to be redirected to stdout and this doesn't happen.
The child process prints:
CPython versions tested on:
3.11
Operating systems tested on:
Linux