From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 24 May 2026 12:02:45 +0000 (+0200) Subject: [3.15] gh-148932: Docs / `profiling.sampling` Windows limitations (GH-150272) (#150330) X-Git-Tag: v3.15.0b2~83 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=c3d21e5a11769ae318cb5c4c96a381a22629654e;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-148932: Docs / `profiling.sampling` Windows limitations (GH-150272) (#150330) gh-148932: Docs / `profiling.sampling` Windows limitations (GH-150272) (cherry picked from commit 0f32750fe26428de5e439803cf57f51847c81ce8) Co-authored-by: Eduardo Villalpando Mello --- diff --git a/Doc/library/profiling.sampling.rst b/Doc/library/profiling.sampling.rst index aeb1a429b585..39b6ea4e31cd 100644 --- a/Doc/library/profiling.sampling.rst +++ b/Doc/library/profiling.sampling.rst @@ -387,6 +387,11 @@ This requires one of: On Windows, the profiler requires administrative privileges or the ``SeDebugPrivilege`` privilege to read another process's memory. +*Note*: On Windows, ``python -m profiling.sampling`` fails inside a virtual +environment because the venv's ``python.exe`` is just a launcher shim that +re-executes the base interpreter as a child process. The shim itself isn't +a Python process and has no ``PyRuntime`` section to attach to. Instead, +run it from the global Python installation. Version compatibility ---------------------