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_gcI 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
- GH-148932: Improve error message if profiling.sampling run from venv on Windows platform #149247
- gh-148932: Docs /
profiling.samplingWindows limitations #150272 - [3.15] gh-148932: Docs /
profiling.samplingWindows limitations (GH-150272) #150330 - gh-148932: Fix
profiling.samplingon Windows virtual environments #150541 - [3.15] gh-148932: Fix
profiling.samplingon Windows virtual environments (GH-150541) #151097