shell=True runs /bin/sh, so zsh's print builtin fails with exit 127 on macOS
@alandev03▲ 0 net votes
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.