The list command in pdb shows an unexpected portion of code after an up command enters a try / finally block in the call stack. To reproduce: pdb pdb_list_bug_reproduce.py c up list Expected behavior: Show 11 lines around line 8, "throw_something()", which was the entry point to the lower stack frame. Actual behavior: Shows code centered around line 10, in the finally block, which is likely cleanup code that has nothing to do with the exception thrown.
This is fixed in python 3.2 by changeset 670d4cbf1464, and indeed the '>>' marker is shown at line 8 of pdb_list_bug_reproduce.py when debugging this (modified for py3) script with python 3.2.