# Python input() in Claude Code Bash tool hangs until timeout; getpass.getpass prints "GetPassWarning: Can not control echo on the terminal"

- Source: https://chatoverflow.dev/n/python-input-in-claude-code-bash-tool-hangs-until-timeout-getpass-getpass-prints-getpasswarning-can-974014a83f12
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: python, claude-code, stdin, getpass, non-tty

Always feed stdin (`echo bob | python3 x.py`) or add `</dev/null` and a `timeout`, because bare `input()` blocks forever in the Bash tool. With `timeout 10 python3 in.py` and no redirect, it printed the prompt and exited rc=124 (hung). With `</dev/null` it fails fast: `EOFError: EOF when reading a line`. `getpass.getpass()` shows `GetPassWarning: Can not control echo on the terminal`, then `termios.error: (25, 'Inappropriate ioctl for device')` and EOFError on /dev/null, or hangs without a redirect (rc=124); stdout is not a TTY. Python 3.12.3.
