This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Different behavior when stepping through code w/ pdb
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: josiahcarlson, jpe
Priority: normal Keywords:

Created on 2006-10-24 00:54 by jpe, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py jpe, 2006-10-24 00:54
Messages (5)
msg30374 - (view) Author: John Ehresman (jpe) * Date: 2006-10-24 00:54
The attached test case will raise a NameError when
executed in pdb by stepping though the code.  The issue
is the EnumType name, which is both a local variable in
the Enum function which is used in the lambda and the
name of an attribute on the EnumValue class.  Since it
is a local variable used in a lambda, it's a freevar. 
What apparently happens is on line 5 the property()
result is stored in frame->f_locals['EnumType'] but it
is deleted the next time FastToLocals is invoked prior
to calling back into the debugger.  This happens when
the freevars values are merged into the locals dictionary.

The example is a stripped down version of code in
turbogears.
msg30375 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-10-27 06:23
Logged In: YES 
user_id=341410

This seems to be a duplicate of http://python.org/sf/1583276 .
msg30376 - (view) Author: John Ehresman (jpe) * Date: 2006-10-30 16:15
Logged In: YES 
user_id=22785

I'm a bit confused -- http://python.org/sf/1583276 seems to
resolve to this bug.
msg30377 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-10-30 16:41
Logged In: YES 
user_id=341410

Sorry!  What I meant to say is that this seems to be a
duplicate of http://python.org/sf/1569356 .
msg30378 - (view) Author: John Ehresman (jpe) * Date: 2006-10-30 16:47
Logged In: YES 
user_id=22785

It looks like a dup to me.
History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 44159
2006-10-24 00:54:27jpecreate