gh-145410: Fix sysconfig.get_platform() on Windows when sys.version is truncated#145635
gh-145410: Fix sysconfig.get_platform() on Windows when sys.version is truncated#14563504cb wants to merge 1 commit intopython:mainfrom
Conversation
The function was checking for 'amd64' in sys.version to detect 64-bit Windows, but sys.version is truncated at a fixed width and may not contain the architecture marker when the compiler version string is long. Use platform.machine() instead, which reliably returns the machine architecture on Windows regardless of the sys.version content. Fixes #145410
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Quoting @zooba from the issue #145410 (comment)
I also don't think this is the way to go. Furthermore, CI hints that there are problems to solve ... |
zooba
left a comment
There was a problem hiding this comment.
This is not the way - platform and sysconfig have different purposes, so they shouldn't mix.
Add a compile-time constant to _sysconfig for this.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Fixes #145410
The function was checking for 'amd64' in sys.version to detect 64-bit
Windows, but sys.version is truncated at a fixed width and may not
contain the architecture marker when the compiler version string is long.
Use platform.machine() instead, which reliably returns the machine
architecture on Windows regardless of the sys.version content.