Debugging with PDB and App Engine

Follow me for more content or contact for work opportunities:
Twitter / LinkedIn

Python debugger (pdb) doesn't work on App Engine SDK as usual. After adding to my project:

import pdb; pdb.set_trace()

I got:

Blocking access to skipped file "/.pdbrc"

File "/usr/lib/python2.6/bdb.py", line 46, in trace_dispatch return self.dispatch_line(frame) File "/usr/lib/python2.6/bdb.py", line 65, in dispatch_line if self.quitting: raise BdbQuit

But, as posted in morethanseven, it's easy to make it work using:

import pdb import sys for attr in ('stdin', 'stdout', 'stderr'): setattr(sys, attr, getattr(sys, '%s' % attr)) pdb.set_trace()

Follow me for more content or contact for work opportunities:
Twitter / LinkedIn