vscode-jupyter: Breakpoint ignored when debugging a cell

Testing #141223, followed the steps in https://github.com/microsoft/vscode/issues/131469 to set up Jupyter debugging

Environment: macOS 11.6.2, Python 3.10.1, ipykernel==6.7.0 Jupyter extension version 2022.1.1001744497, VS Code 1.64.0-insider commit f93c696

Tried setting a breakpoint in a cell, and the cell would just get executed normally, the breakpoint was ignored.

The cell:

d = "no"
print(f"What is the value of d? {d}")
d = "yes"
print(f"What is the value of d now? {d}")

Content of the Jupyter output channel after I click on the Debug Cell button:

Info 11:52:11: Executing (status idle) silently Code = import ipykernel\nprint(ipykernel.__version__)
Info 11:52:11: Executing silently Code (completed) = import ipykernel\nprint(ipykernel.__version__)
Info 11:52:12: Executing (status idle) silently Code = import debugpy\ndebugpy.debug_this_thread()
Info 11:52:12: Executing silently Code (completed) = import debugpy\ndebugpy.debug_this_thread()
Info 11:52:12: Execute Cells request 3
Info 11:52:12: Execute Cell 3 ~/Documents/Sandbox/notebooks/notebook.ipynb
Info 11:52:12: Cell 3 executed with state Success
Warn 11:52:12: StdErr from Kernel Process [IPKernelApp] ERROR | Exception in control handler:

Warn 11:52:12: StdErr from Kernel Process Traceback (most recent call last):

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 281, in process_control

Warn 11:52:12: StdErr from Kernel Process     else:

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 856, in debug_request

Warn 11:52:12: StdErr from Kernel Process     async def debug_request(self, stream, ident, parent):

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/ipkernel.py", line 426, in do_debug_request

Warn 11:52:12: StdErr from Kernel Process     return await self.debugger.process_request(msg)

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/debugger.py", line 606, in process_request

Warn 11:52:12: StdErr from Kernel Process     elif self.is_started:

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/debugger.py", line 348, in stop

Warn 11:52:12: StdErr from Kernel Process     cleanup_transforms = get_ipython().input_transformer_manager.cleanup_transforms

Warn 11:52:12: StdErr from Kernel Process   File "/Users/kimiguel/Documents/Sandbox/notebooks/.othervenv/lib/python3.10/site-packages/ipykernel/debugger.py", line 232, in disconnect_tcp_socket

Warn 11:52:12: StdErr from Kernel Process     def disconnect_tcp_socket(self):

Warn 11:52:12: StdErr from Kernel Process   File "zmq/backend/cython/socket.pyx", line 640, in zmq.backend.cython.socket.Socket.disconnect

Warn 11:52:12: StdErr from Kernel Process zmq.error.ZMQError: No such file or directory

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 21 (11 by maintainers)

Most upvoted comments

I have an environment with IPython 8 and debugging (hitting bps) is working just fine. Turns out that if I set a bp on the first line, then subsequent breakpoints seem to be hit. For example if I have this:

image

Breakpoints post the first one will be hit: image

This would explain why run-by-line continues to work.

Thanks @fabioz