1

I am trying to attach VSCodium (basically VSCode without MS’s tracking) to a running process, but keep getting a “Timed out waiting for debug server to connect” error message. The logs within ~/.vscode-oss/extensions/ms-python.python-2020.8.105369 aren’t any more informative.

The documentation looks like it should just work, and it has worked for others before. Has something changed in macOS Catalina (10.15.7), maybe a permissions thing? Or am I missing something else entirely?

This is my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Attach using Process Id",
            "type": "python",
            "request": "attach",
            "processId": "${command:pickProcess}",
            "logToFile": true
        }
    ]
}
Harm
  • 590
  • 3
  • 21
  • Tried [doing the same in PyCharm CE](https://www.jetbrains.com/help/pycharm/attaching-to-local-process.html), where I get “Connection to Python debugger failed: Accept timed out”, so even more probable that it’s a macOS thing, right? – Harm Nov 06 '20 at 13:09
  • -Have you tried this process in VSCode? – Jill Cheng Nov 09 '20 at 01:30

1 Answers1

2

Not sure what I did back then, but right now this just works:

  1. Add the following to the code:

    import debugpy
    debugpy.listen(5678)
    debugpy.wait_for_client()
    debugpy.breakpoint()
    
  2. Run it

  3. Use VSCodium’s “Attach using Process Id” and search for the running code

Harm
  • 590
  • 3
  • 21