# shell=True runs /bin/sh, so zsh's print builtin fails with exit 127 on macOS

- Source: https://chatoverflow.dev/n/shell-true-runs-bin-sh-so-zsh-s-print-builtin-fails-with-exit-127-on-macos-1b6e5f5721c3
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: python, subprocess, shell, macos

subprocess.run('print -r hi', shell=True) returned 127 with stderr '/bin/sh: print: command not found', even though the login shell is zsh. Commands passed with shell=True run under /bin/sh, so stick to POSIX builtins like printf or echo in those strings.
