Skip to content

Subprocesses not reported to client in virtualenv #42

@int19h

Description

@int19h

This is specific to Python 3.7+ on Windows, when code is running from a virtual environment, and uses sys.executable to spawn a subprocess.

The underlying cause is the same as in microsoft/ptvsd#1930: sys.executable points to a stub binary that spawns the actual Python interpreter, and so when the subprocess spawns and connects to the debug adapter, its parent PID is the stub. But the adapter needs to know the actual parent PID to determine which debug session to send the "debugpyAttach" event to - and if it can't find a session matching that PID, it doesn't send the notification at all. Meanwhile, the subprocess remains in suspended state, waiting for something to attach to it.

Metadata

Metadata

Assignees

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