classification
Title: pdb list shows unexpected code when stack frame includes a try / finally block
Type: behavior Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: AbramClark, serhiy.storchaka, xdegaye
Priority: normal Keywords:

Created on 2013-02-12 10:47 by AbramClark, last changed 2020-05-31 12:51 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
pdb_list_bug_reproduce.py AbramClark, 2013-02-12 10:47 program to reproduce unexpected pdb behavior
Messages (3)
msg181951 - (view) Author: Abram Clark (AbramClark) Date: 2013-02-12 10:47
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.
msg182270 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2013-02-17 14:03
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.
msg370431 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-31 12:51
Python 2.7 is no longer supported.
History
Date User Action Args
2020-05-31 12:51:09serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg370431

resolution: out of date
stage: resolved
2013-02-17 14:03:00xdegayesetnosy: + xdegaye
messages: + msg182270
2013-02-12 10:47:37AbramClarkcreate