Title: Rework `Modules/getbuildinfo.c` to build strings at build time, instead of runtime · Issue #158948 · python/cpython · GitHub
Open Graph Title: Rework `Modules/getbuildinfo.c` to build strings at build time, instead of runtime · Issue #158948 · python/cpython
X Title: Rework `Modules/getbuildinfo.c` to build strings at build time, instead of runtime · Issue #158948 · python/cpython
Description: 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 str...
Open Graph Description: 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_GetB...
X Description: 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(...
Opengraph URL: https://github.com/python/cpython/issues/158948
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rework `Modules/getbuildinfo.c` to build strings at build time, instead of runtime","articleBody":"Python has a collection of C files to get \"build information\"\n\n* Modules/getbuildinfo.c\n* Python/getcompiler.c\n* Python/getcopyright.c\n* Python/getplatform.c\n* Python/getversion.c\n\n_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: https://github.com/python/cpython/pull/158608.\n\nI 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).\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-158951\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2026-10-07T02:47:13Z","url":"https://github.com/python/cpython/issues/158948"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7bb0af1b-f90f-a4fd-3521-0d7ae95548ea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED36:1EFF:8C380D:BADB7D:6B01FA0E |
| html-safe-nonce | 9ad4fb3ba61283d2424c2e22acd1bf53af8f15a7a41e576a9a65a6529e9d6842 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDM2OjFFRkY6OEMzODBEOkJBREI3RDo2QjAxRkEwRSIsInZpc2l0b3JfaWQiOiI0NzA1NzQ4ODcwNjExNzI4OTEwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 89ba5748ab67b3753efb70576ffca851448573210c17c731c34abdc7c5f24586 |
| hovercard-subject-tag | issue:5738540561 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/158948/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8010a6b364d33e12b758cb3623a7fbb4013346ab9494c8f7121ca268945c8e44/python/cpython/issues/158948 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8010a6b364d33e12b758cb3623a7fbb4013346ab9494c8f7121ca268945c8e44/python/cpython/issues/158948 |
| og:image:alt | 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_GetB... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width