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.
This is specific to Python 3.7+ on Windows, when code is running from a virtual environment, and uses
sys.executableto spawn a subprocess.The underlying cause is the same as in microsoft/ptvsd#1930:
sys.executablepoints 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.