Skip to content

Python3.12 Unable to attach to PID (Jupyter python process) #1476

Closed
@fleming79

Description

@fleming79

With VScode I normally debug IpyWidgets by attaching to a Jupyter Kenrnel using PID. With python 3.11 this works with an external Jupyter kernel or one managed by VScode.

Switching to using Python 3.12 it no longer connects to the PID. The only indication is a message in the console Python:....

Attaching to PID: 19800 (elapsed: 1.00s).
Attaching to PID: 19800 (elapsed: 2.00s).

Stops counting at 2.00s.

With Python 3.11 it counts up to about 8s then connects.

Environment data

  • debugpy version: 1.8.0
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.12 WinPython distribution
  • Using VS Code:
    Version: 1.84.2
    Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
    Date: 2023-11-09T10:51:52.184Z
    Electron: 25.9.2
    ElectronBuildId: 24603566
    Chromium: 114.0.5735.289
    Node.js: 18.15.0
    V8: 11.4.183.29-electron.0
    OS: Windows_NT x64 10.0.19045

Actual behavior

  • Debugger doesn't attach (Timeout error).

Expected behavior

  • Debugger attaches to PID after about 8s.

Steps to reproduce:

  1. Start VScode.
  2. Start Jupyter and obtain PID for a Python 3.12 kernel.
  3. Attach to PID using Python debugger.

Launch settings

    {
        "name": "Python: Attach using Process Id",
        "type": "python",
        "request": "attach",
        "processId": "${command:pickProcess}",
        "subProcess": false
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions