How to debug Tornado application with pdb or ipdb?
Asked Answered
A

0

8

I'm use Tornado ioloop to develop application, when it comes to http_client.fetch's callback, I want to start pdb with import pdb; pdb.set_trace(), But an exception is raised:

> /home/yiwei.liyw/dsa-engine/src/collect/engine_task.py(52)task_created()
-> print response.body
(Pdb)
2015-10-26 15:30:38,629 ERROR ioloop.py:612 Exception in callback <functools.partial object at 0x7fe0d98e5e68>
Traceback (most recent call last):
  File "/home/yiwei.liyw/dsa-engine/venv/lib/python2.7/site-packages/tornado/ioloop.py", line 592, in _run_callback
    ret = callback()
  File "/home/yiwei.liyw/dsa-engine/venv/lib/python2.7/site-packages/tornado/stack_context.py", line 275, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/yiwei.liyw/dsa-engine/src/collect/engine_task.py", line 52, in task_created
    print response.body
  File "/home/yiwei.liyw/dsa-engine/src/collect/engine_task.py", line 52, in task_created
    print response.body
  File "/home/tops/lib/python2.7/bdb.py", line 49, in trace_dispatch
    return self.dispatch_line(frame)
  File "/home/tops/lib/python2.7/bdb.py", line 68, in dispatch_line
    if self.quitting: raise BdbQuit
BdbQuit

What is the best way to use pdb in Tornado application?

Automaton answered 26/10, 2015 at 7:43 Comment(1)
chek thisKunkle

© 2022 - 2024 — McMap. All rights reserved.