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 — gh-161870: Skip test_platform when a 32-bit build sees a different machine name by sainimal1ba-hue · Pull Request #161879 · python/cpython

Conversation

@sainimal1ba-hue

@sainimal1ba-hue sainimal1ba-hue commented Nov 12, 2026

Copy link
Copy Markdown

Issue: gh-161870
build-details.json records sysconfig.get_platform() from the build machine, and test_platform compared that value with the one computed at test time. On Linux, os.uname() reports the kernel's machine name, so for a 32-bit build the two can differ when the build machine and the test machine see the same architecture under different names: linux-i686 != linux-x86_64 for Debian i386 packages on an x86_64 kernel, linux-armv7l != linux-armv8l for Ubuntu armhf, and so on.

The recorded value describes the build and is not wrong, so this only relaxes the test: when the two platforms differ and the running interpreter is a 32-bit Linux build, the test now skips instead of failing. In every other case the comparison stays strict, including for a mismatch seen by a 64-bit build.

Testing (Linux x86_64, debug build):

./python -m test test_build_details test_sysconfig passes with the unmodified file, so the strict comparison still holds when the values match.
With the recorded platform changed to linux-i686, the old test fails with AssertionError: linux-i686 != linux-x86_64, the same pair reported in the issue. With this change the test skips for a 32-bit interpreter (simulated with sys.maxsize = 2**31 - 1, the same approach test_sysconfig uses) and still fails for a 64-bit one, where a mismatch is not expected.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sainimal1ba-hue
pythongh-161870: Skip test_platform when a 32-bit build sees a differ…
231c98c
…ent machine name

The platform recorded in build-details.json describes the build machine,
while sysconfig.get_platform() at test time reports the kernel's machine
name, which can differ for a 32-bit process on a 64-bit kernel.
@sainimal1ba-hue
sainimal1ba-hue requested a review from FFY00 as a code owner November 12, 2026 16:01
@python-cla-bot

python-cla-bot Bot commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request Nov 12, 2026
test_build_details.test_platform fails for 32-bit builds on a 64-bit kernel #161870
Open
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Nov 12, 2026
@bedevere-app

bedevere-app Bot commented Nov 12, 2026

Copy link
Copy Markdown

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 skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added the awaiting review label Nov 12, 2026
@blurb-it
📜🤖 Added by blurb_it.
d4844c2
vstinner
vstinner reviewed Nov 12, 2026
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FFY00: Is test_build_details.test_platform() test really useful? It fails if the runtime platform is different than the build platform.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@vstinner vstinner vstinner left review comments
@FFY00 FFY00 Awaiting requested review from FFY00 FFY00 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sainimal1ba-hue @vstinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — 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.