-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Closed as not planned
Copy link
Labels
invalidstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Testcase:
import time
import subprocess
with open('log', 'w') as log:
p = subprocess.Popen(['python', 'sp-child.py'],
stdout=log,
stderr=subprocess.STDOUT)
time.sleep(10)
p.communicate()
Additional file sp-child.py:
import sys
print('I am a child!')
print(f' ... in-terminal: stdout={sys.stdout.isatty()} stderr={sys.stderr.isatty()}')
The subprocess.Popen argument requests child's stderr to be redirected to stdout and this doesn't happen.
The child process prints:
I am a child!
... in-terminal: stdout=False stderr=False
CPython versions tested on:
3.11
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
invalidstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error