I\'m trying to debug a Python CLI I wrote that can take its arguments from stdin. A simple test case would have the output of
echo \"test\" | python mytool.p
When you use pdb(or any other python debugger) it acquires stdin for debug commands, that's why you get NameError: name 'test' is not defined.
For example this command will quit debugger at the begging of a runtime and you wont get this error(nor interactive debugging) for one run:
(echo cont;echo "test") | python -m pdb mytool.py