BdbQuit raised when debugging Python with pdb

前端 未结 5 1914
南笙
南笙 2020-12-14 00:22

Recently when adding the pdb debugger to my Python 2.7.10 code, I get this message:

Traceback (most recent call last):
  File "/Users/isaach         


        
5条回答
  •  时光取名叫无心
    2020-12-14 00:47

    I ran into this when I left import pdb and a pdb.set_trace() in my production code. When the pdb.set_trace() line was executed, python was waiting for my input to tell it to continue or step into, etc... Because the python code was being called by a web server I wasn't there to press c to continue. After so long (not sure how long) it finally raised the BdbQuit exception.

    I didn't have anything setup to catch that exception so it raised a 500 in my web server.

    It took me a while to understand that my debug code running in an a daemon/background was causing the issue. I felt silly.

提交回复
热议问题