-
Notifications
You must be signed in to change notification settings - Fork 78
Description
The debugger has been removed from xeus-python with Python 3.13 because of bug (most likely in pydevd) that makes the kernel stall.
Reproducer:
Write the following code in a notebook cell:
b = 89
def sq(x):
return x * x
sq(b)
Then start the debugger, set a breakpoint to the line containing return x * x
, and another one to the line containing sq(b). Execute the cell, the execution will stop on the last breakpoint, click on Continue, the execution will stop on the first breakpoint and the kernel will stall (clicking on Continue will have no effect).
Root cause
When the code stops on a breakpont, the frontend will ask the debugger for the different variables. When handling this request, xeus-python will call python code via pybind11. Inside the Python code, at the first return statement (either explicit, or after reaching the end of a function returning void), pydevd will emit a Suspend event (this can be seen by enabling deubgpy logs), and the kernel will stall.
This is likely an issue with Pydev: Python 3.13 has changed the way Frames and Scopes are handled internally, affecting debuggers. Notice that this bug does not occur when debugging with ipykernel instead of xeus-python.