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
When connected to a debuggable kernel (this reproduces with both latest ipykernel and xpython), breakpoints in a cell that begins with one or more "empty" lines (whitespace only) will never be hit. Removing the lines and re-running the cell fixes the issue.
Reproduce
Create a new notebook
Connect to a debuggable kernel and enable the debugger
Add one or more empty lines to the cell, followed by some code (e.g. print("hello world")) and set a breakpoint on the line with code
Run the cell
Notice that execution does not pause on the breakpoint
Expected behavior
The breakpoint should be hit regardless of leading newlines
Context
Operating System and version: Windows 11
Browser and version: Edge 95
JupyterLab version: 3.2.4
The text was updated successfully, but these errors were encountered:
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋
Testing this a bit more, it seems the initial empty lines are not counted toward line numbers in the debugger. Breakpoints can still be hit if they are on a line number that is less than the number of lines after the initial empty ones. For example with three non-empty lines they can be hit up to line three:
Notice also that the outputs indicate that we are actually on print(3) since 1 and 2 have been printed already. So it seems just the line numbers are wrong.
One of those cleanup transformation removes the leading empty lines. I pushed a fix to ipykernel that deactivates that cleanup transformation when a debug session is active (PR link above this comment).
Description
When connected to a debuggable kernel (this reproduces with both latest ipykernel and xpython), breakpoints in a cell that begins with one or more "empty" lines (whitespace only) will never be hit. Removing the lines and re-running the cell fixes the issue.
Reproduce
print("hello world")
) and set a breakpoint on the line with codeExpected behavior
The breakpoint should be hit regardless of leading newlines
Context
The text was updated successfully, but these errors were encountered: