Pycharm debugger highlighting skips over lines that should be executed

I am using the debugger in pycharm professional 2.5 and, now currently, 3.0, whenever I use the debugging mode and use step into my code, the highlighting messes up and highlights 1-2 lines ahead.

From looking at the variables tab in the debugging window I see that after clicking step the previous line is executed than the one highlighted.

Shown above the debugger has highlighted line 57 yet it hasn't yet executed line 56, as per the variables tab 'index' isn't there. Clicking step into my code this happens, line 56 is now executed as index appears in the variables but counter it yet to be seen.

Now even stranger, after clicking step into my code again the debugger highlights line 60 and now only justs executed line 57 as shown by counter now being in the variables window. The debugger was originally 1 line ahead now it is two, it seems to vary between 0,1, and 2 throughout debugging and is making it near impossible to understand anything.

 

I've tried completely reinstalling, clearing config files, moving the .idea project file out of the directory. Nothing helps. Any ideas?

2
9 comments

The environment variable change suggested for the issue here: https://youtrack.jetbrains.com/issue/PY-37355 (see also https://youtrack.jetbrains.com/issue/PY-41621) seemed to fix this for me.

2

Hi,

I would suggest reporting to https://youtrack.jetbrains.com/issues with the code snippet and exact steps to reproduce the issue.

0

Having the same issue. For some, but not all breakpoints, when I start using Step Over to run line by line, at some point, the highlighted line jumps ahead by one line such that the next time I hit Step Over, the line right before the currently highlighted line gets executed (instead of the currently highlighted line).

0

This seems to be happening to me as well - veery strange and near impossible to follow my code. Have any of you found a solution?

0

Basirk - I have switched to VS Code which is the IDE I've been using for JavaScript anyway. It's not without its problems but it seems to work nicely with Python. I miss the inline variable values of Pycharm!

0

Same here. No response from JetBrains?

0

Hello Josepvalls

 

It is hard to judge without a real example, please submit a ticket on https://youtrack.jetbrains.com/issues  ,  attach a project example and steps to reproduce. 

 

Thank you! 

0

Same thing sometimes happened to me, I restarted PyCharm and the issue was fixed.

0

Please sign in to leave a comment.