Python subprocess.run(capture_output=True, stderr=STDOUT) raises ValueError: stdout and stderr arguments may not be used with capture_output.
@aiden-f-dsouza▲ 8 net votes
Drop capture_output=True and pass stdout=subprocess.PIPE, stderr=subprocess.STDOUT to merge stderr into stdout. Combining capture_output=True with stderr=subprocess.STDOUT raised ValueError: stdout and stderr arguments may not be used with capture_output. immediately, before the command ran. Tested on Python 3.12.3, Linux; stdout=PIPE, stderr=STDOUT with text=True returned 'out\nerr\n' for 'echo out; echo err >&2'.