Title: gh-145410: Fix sysconfig.get_platform() for truncated sys.version on Windows by Jah-yee · Pull Request #146146 · python/cpython · GitHub
Open Graph Title: gh-145410: Fix sysconfig.get_platform() for truncated sys.version on Windows by Jah-yee · Pull Request #146146 · python/cpython
X Title: gh-145410: Fix sysconfig.get_platform() for truncated sys.version on Windows by Jah-yee · Pull Request #146146 · python/cpython
Description: Bug Fix On Windows, sysconfig.get_platform() checks for the string 'amd64' in sys.version to detect 64-bit builds. However, sys.version can be truncated (e.g., ~100 characters on clang builds), causing 'amd64' to be missing and returning 'win32' incorrectly. This causes problems when installing native packages via pip because cp314-cp314-amd64 is not in the list of supported tags. The Fix This PR adds sys.maxsize > 2**32 as a fallback check, which is reliable even when sys.version is truncated. It also reorders the arm64 check before arm32 for proper precedence. Before: if os.name == 'nt': if 'amd64' in sys.version.lower(): return 'win-amd64' if '(arm)' in sys.version.lower(): return 'win-arm32' if '(arm64)' in sys.version.lower(): return 'win-arm64' return sys.platform After: if os.name == 'nt': if 'amd64' in sys.version.lower(): return 'win-amd64' if sys.maxsize > 2**32: # 64-bit Windows where sys.version may be truncated return 'win-amd64' if '(arm64)' in sys.version.lower(): return 'win-arm64' if '(arm)' in sys.version.lower(): return 'win-arm32' return sys.platform Fixes: #145410 Submitted by automated agent
Open Graph Description: Bug Fix On Windows, sysconfig.get_platform() checks for the string 'amd64' in sys.version to detect 64-bit builds. However, sys.version can be truncated (e.g., ~100 characters on clang buil...
X Description: Bug Fix On Windows, sysconfig.get_platform() checks for the string 'amd64' in sys.version to detect 64-bit builds. However, sys.version can be truncated (e.g., ~100 characters on cl...
Opengraph URL: https://github.com/python/cpython/pull/146146
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b3848b2e-326d-9187-2364-2b513fbac611 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C982:3A96BF:33A4494:4762609:6A54B077 |
| html-safe-nonce | 76a80fead32c941dda20405ed24427707a59ef31e88a09842e137a1fbd09d3b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTgyOjNBOTZCRjozM0E0NDk0OjQ3NjI2MDk6NkE1NEIwNzciLCJ2aXNpdG9yX2lkIjoiMTMzMzgwMDMxNzQ0MDI3NDU1MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d4d8bdd76b798416572753b0aaa1387ed10f16842bd353fd00334c3599a7ad35 |
| hovercard-subject-tag | pull_request:3417427389 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/146146/files |
| twitter:image | https://avatars.githubusercontent.com/u/166608075?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/166608075?s=400&v=4 |
| og:image:alt | Bug Fix On Windows, sysconfig.get_platform() checks for the string 'amd64' in sys.version to detect 64-bit builds. However, sys.version can be truncated (e.g., ~100 characters on clang buil... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width