Skip to content

Debugger not available for Python 3.13 #665

@JohanMabille

Description

@JohanMabille

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.

cc @SylvainCorlay

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions