Pycharm 2019.2.5: debug console not updating variables / state for declared variables
When stopped at a breakpoint, executing commands in the console doesn't update the state in expected ways, or update the state inconsistently.
Example script:
def f():
a = 1
b = 2
f()
when debugging this script and stopping at a breakpoint at "b = ..." line (before it's execution):
1. If I execute `b=2` in the console (interactively) and immediately after that I execute `print(b)` I get "NameError: name 'b' is not defined". Even though I've just assigned it.
2, If I execute `c=3` in the console and after that `print(c)` I get the expected "3".
3. If I execute `a=10` in the console, and after that `print(a)` I get "1", despite updating the variable interactively.
It seems that for some reason, variables that are declared in the scope of the breakpoint cannot be created / updated interactively in the console.
What may be the reason for this strange behavior? I'm running Pycharm 2019.2.5 (with python 3.6).
Please sign in to leave a comment.
Hi,
The issue is known and will be fixed in 2019.3.1 version https://youtrack.jetbrains.com/issue/PY-38378
For now, you could temporarily downgrade to 2019.2.2, it doesn't have such a problem.
Thanks, had to downgrade to 2019.1 (that's the version available in snap for Ubuntu), but it works as expected.
I'm facing the same issue with pycharm 2020.1
@1989hemantrajput
Is it reproducible for you using the steps from the ticket? https://youtrack.jetbrains.com/issue/PY-38378
actually I faced the same case while running something else. I was running some of my tests and then every now and then breakpoint just doesn't load variables. For simple cases like this it works but my tests are little complex than this, however, I was able to reproduce it consistently
Any chance you can track it down to a minimal code snippet that reproduces the bug and share it with us?