You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Breakpoints can be set on blank/comment-only lines but never resolve or warn #2013
Environment\n- OS: Linux\n- Python: 3.13 (debug session shows /usr/lib/python3.13/...)\n- Debug adapter: debugpy (via VS Code Python extension), e.g. ms-python.debugpy-2025.18.0-linux-x64\n- Frontend: VS Code Run & Debug\n\nSteps to Reproduce\n1. In a Python file, create a breakpoint on a line that is not an executable statement (blank line or comment-only line).\n2. Start debugging normally and run through code that would execute the surrounding executable lines.\n\nActual Result\n- The breakpoint can be set/accepted in the UI, but it never triggers.\n- There is no clear indication that the breakpoint line has no executable code and therefore cannot be hit.\n\nExpected Result\n- The debugger should either\n - prevent breakpoints on non-executable lines, or\n - clearly mark them as unverified / not resolved, and/or\n - resolve them automatically to the nearest executable line.\n\nNotes / Example\nIn this codebase, a breakpoint placed on a blank line between executable statements never resolves or triggers, even though the immediately adjacent executable lines do execute.\n\nWorkaround\nPlace breakpoints on actual executable statement lines instead.
It does search for lines that are close, it all depends upon how far off the blank line or the commented line is.
For example with this code:
defmy_func():
# Some lines with comments# more comments# more comments# more comments# more commentsprint("Hello, World!")
# comments after the print statement# more comments# more comments# more comments# more comments# more comments# more comments# more comments# more comments# more comments# more comments# more commentsif__name__=="__main__":
my_func()
No matter where I put a breakpoint in my_func, it will bind the breakpoint somewhere.
Activity
rchiodo commentedon Mar 20, 2026
It does search for lines that are close, it all depends upon how far off the blank line or the commented line is.
For example with this code:
No matter where I put a breakpoint in
my_func, it will bind the breakpoint somewhere.