sergey-miryanov · GitHub

Bug report

Bug description:

Running the following command inside a virtual environment triggers this error on Windows:
Failed to find the PyRuntime section in process 29072 on Windows platform

python -m profiling.sampling run --subprocesses -m test test_gc

I suspect this happens because virtual environments use shims to launch the original interpreter. Since the shim itself isn't a Python process, that's why profiling.sampling fails.

We can work around this: if --subprocesses option specified then we should proceed with profiling as long as at least one child process is a Python process.

cc @pablogsal

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Read the original on github.com ↗