Message228783
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. |
|
Date |
User |
Action |
Args |
2014-10-08 10:21:49 | xdegaye | set | recipients:
+ xdegaye, georg.brandl |
2014-10-08 10:21:49 | xdegaye | set | messageid: <1412763709.52.0.382735862315.issue22577@psf.upfronthosting.co.za> |
2014-10-08 10:21:49 | xdegaye | link | issue22577 messages |
2014-10-08 10:21:48 | xdegaye | create | |
|