PyCharm debugger uses old/cached file if I change one line of code


I am observing some strange behavior during debugging in PyCharm. I am debugging a file with recent changes and observed that when stepping through the file, the debugger doesn't follow the program flow but seems to execute everything right. 

As a consequence I tried "Invalidate Caches / Restart" but nothing changed. 

After some testing, I ended up with code like the following and some strange behavior:

# some code
a = 1 # introduced change
# some more code

With the code above, stepping through the file with the debugger works fine. The debugger follows the whole program flow correctly.

When I comment out the new line "a=1", like this:

# some code
# a = 1 # introduced change, commented out
# some more code

the debugger falls back to use the old version of the file and the debugger doesn't follow the program flow. It is the same, when I delete the introduced line "a = 1".

Any help appreciated. Is there any other option so delete cached files? 


PyCharm 2020.1.2 (Professional Edition)
Build #PY-201.7846.77, built on June 1, 2020

1 comment

Please report it to providing code and steps for reproducing the problem.
We'll investigate.


Please sign in to leave a comment.