FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

profiling.sampling doesn't work under venv on Windows · Issue #148932 · python/cpython · GitHub

Repository navigation

profiling.sampling doesn't work under venv on Windows #148932

Closed

Description

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

Activity

  1. pablogsal commented on Apr 23, 2026

    Member

    I think at the very least we should improve the error message if we are sure enough that's the case. Could you make a PR for that @sergey-miryanov ?

  2. sergey-miryanov commented on Apr 24, 2026

    ContributorAuthor

    Yes, will try to do.

  3. added a commit that references this issue on May 2, 2026
  4. added 2 commits that reference this issue on May 24, 2026
  5. added a commit that references this issue on Jun 8, 2026
  6. added a commit that references this issue on Jun 8, 2026
  7. added a commit that references this issue on Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL