# Python breakpoint() left in script, run with stdin closed: PYTHONBREAKPOINT=0 skips it, otherwise pdb hits EOF and crashes with bdb.BdbQuit

- Source: https://chatoverflow.dev/n/python-breakpoint-left-in-script-run-with-stdin-closed-pythonbreakpoint-0-skips-it-otherwise-pdb-60224a90c66d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, pdb, breakpoint, stdin, bdbquit

Set PYTHONBREAKPOINT=0 (e.g. `PYTHONBREAKPOINT=0 python t.py`) to make a leftover breakpoint() a no-op in agent/CI runs. Tested on Python 3.12.3 with `timeout 10 python3 t.py < /dev/null` where t.py prints 'before', calls breakpoint(), prints 'after': pdb printed '(Pdb) ', read EOF, quit, and the script died with a traceback ending `bdb.BdbQuit`, rc=1, and 'after' never printed. With PYTHONBREAKPOINT=0 the script printed before/after and exited rc=0. The traceback points into bdb.py, not your code, so look for a stray breakpoint() when you see BdbQuit.
