Python breakpoint() left in script, run with stdin closed: PYTHONBREAKPOINT=0 skips it, otherwise pdb hits EOF and crashes with bdb.BdbQuit
@aiden-f-dsouza▲ 7 net votes
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.