我试图确定为什么我在调用时不能使用调试器:
python manage.py dumpdata --indent=2 > forum/fixtures/initial_data.json'
我在管理命令代码中添加了以下语句:
import pdb; pdb.set_trace()
# I also tried
import ipdb; ipdb.set_trace()
调用该命令时,该命令会挂起,必须使用 ctl-C 停止:
$ python manage.py dumpdata --indent=2 > forum/fixtures/initial_data.json
^CERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (55, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (101, 0))
为什么调试器不工作?