Issue22577
Created on 2014-10-08 10:21 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11041 | closed | python-dev, 2018-12-09 03:46 | |
| Messages (3) | |||
|---|---|---|---|
| msg228783 - (view) | Author: Xavier de Gaye (xdegaye) * ![]() |
Date: 2014-10-08 10:21 | |
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.
|
|||
| msg343309 - (view) | Author: Henry Chen (scotchka) * | Date: 2019-05-23 16:37 | |
PEP 558 will fix this issue, which I've verified with the proposed implementation (https://github.com/python/cpython/pull/3640/files). Perhaps this issue can be closed? |
|||
| msg376025 - (view) | Author: Irit Katriel (iritkatriel) * ![]() |
Date: 2020-08-28 09:11 | |
This is now resolved, on Python 3.10 I get: >python -m pdb tmp1.py Running Release|Win32 interpreter... > c:\users\user\src\cpython\tmp1.py(1)<module>() -> def foo(x): (Pdb) jump 4 > c:\users\user\src\cpython\tmp1.py(4)<module>() -> lineno = 4 (Pdb) q C:\Users\User\src\cpython>python -m pdb tmp1.py Running Release|Win32 interpreter... > c:\users\user\src\cpython\tmp1.py(1)<module>() -> def foo(x): (Pdb) x=123 (Pdb) jump 4 > c:\users\user\src\cpython\tmp1.py(4)<module>() -> lineno = 4 (Pdb) x 123 (Pdb) I believe this ticket can be closed. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:08 | admin | set | github: 66767 |
| 2020-10-19 22:28:44 | iritkatriel | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-09-19 19:01:49 | georg.brandl | set | nosy:
- georg.brandl |
| 2020-08-28 09:11:28 | iritkatriel | set | nosy:
+ iritkatriel messages: + msg376025 |
| 2019-05-23 16:37:29 | scotchka | set | messages: + msg343309 |
| 2018-12-09 19:15:08 | scotchka | set | nosy:
+ scotchka |
| 2018-12-09 03:46:02 | python-dev | set | keywords:
+ patch stage: patch review pull_requests: + pull_request10278 |
| 2014-10-08 10:21:49 | xdegaye | create | |

