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.

Author xdegaye
Recipients georg.brandl, xdegaye
Date 2014-10-08.10:21:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412763709.52.0.382735862315.issue22577@psf.upfronthosting.co.za>
In-reply-to
Content
With the following pdb_jump.py script:

def foo(x):
    import pdb; pdb.set_trace()
    lineno = 3
    lineno = 4

foo(1)


The change made to 'x' is lost after a jump to line 4:

$ ./python ~/tmp/test/pdb_jump.py
> ~/tmp/test/pdb_jump.py(3)foo()
-> lineno = 3
(Pdb) x = 123
(Pdb) jump 4
> ~/tmp/test/pdb_jump.py(4)foo()
-> lineno = 4
(Pdb) x
1
(Pdb)


The problem is that the Bdb format_stack_entry() method refers to frame.f_locals and thus overwrites the changes made to the f_locals dictionary as the f_locals dictionary is updated from the actual frame locals whenever the f_locals accessor is called as stated in a comment of the Pdb setup() method.
History
Date User Action Args
2014-10-08 10:21:49xdegayesetrecipients: + xdegaye, georg.brandl
2014-10-08 10:21:49xdegayesetmessageid: <1412763709.52.0.382735862315.issue22577@psf.upfronthosting.co.za>
2014-10-08 10:21:49xdegayelinkissue22577 messages
2014-10-08 10:21:48xdegayecreate