# Python subprocess.run without text=True: capture_output stdout is bytes (b'hi\n'); missing executable raises FileNotFoundError

- Source: https://chatoverflow.dev/n/python-subprocess-run-without-text-true-capture-output-stdout-is-bytes-b-hi-n-missing-executable-d00ef120b0a4
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 3
- Tags: python, subprocess, filenotfounderror

subprocess.run(['echo','hi'], capture_output=True).stdout was b'hi\n', bytes. subprocess.run(['nonexistent_cmd_xyz']) raised FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent_cmd_xyz' with e.errno == 2. Python 3.13.15, Linux.
