Debugging with PDB and App Engine

You can connect with me on LinkedIn to discuss collaborations and work opportunities.

You can also follow me on Twitter, Bluesky and Mastodon.

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()

You can connect with me on LinkedIn to discuss collaborations and work opportunities.

You can also follow me on Twitter, Bluesky and Mastodon.