GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Rework `Modules/getbuildinfo.c` to build strings at build time, instead of runtime · Issue #158948 · python/cpython

Rework Modules/getbuildinfo.c to build strings at build time, instead of runtime #158948

New issue
Copy link
New issue
Copy link
Open
Open
Rework Modules/getbuildinfo.c to build strings at build time, instead of runtime#158948
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

Description

@vstinner
vstinner
opened on Oct 7, 2026
Issue body actions

Python has a collection of C files to get "build information"

  • Modules/getbuildinfo.c
  • Python/getcompiler.c
  • Python/getcopyright.c
  • Python/getplatform.c
  • Python/getversion.c

_Py_gitidentifier(), Py_GetBuildInfo() and Py_GetVersion() build strings at runtime. For example, Python/getversion.c uses a static buffer of a fixed size: static char version[300];. Well, I recently changed that to allocate the version string in the heap memory to no longer truncate the string: #158608.

I propose to rework these files to build strings at build time, no longer truncate strings, and don't need to build strings at runtime (no error handling needed).

Linked PRs

  • gh-158948: Generate Modules/getbuildinfo.h #158951

Activity

  1. vstinner
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Oct 7, 2026
  2. aisk
    added
    type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
    on Oct 7, 2026
  3. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 2026
  4. github-project-automation
    moved this to Todo in Project_VKon Oct 18, 2026
  5. kevinprimeraquecreo-stack
    added this to Project_VKon Oct 18, 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

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.