diff --git a/Lib/test/test_build_details.py b/Lib/test/test_build_details.py index 12b7664d83aae16..17b51497421b7af 100644 --- a/Lib/test/test_build_details.py +++ b/Lib/test/test_build_details.py @@ -78,7 +78,17 @@ def test_base_interpreter(self): self.key('base_interpreter') def test_platform(self): - self.assertEqual(self.key('platform'), sysconfig.get_platform()) + build_platform = self.key('platform') + run_platform = sysconfig.get_platform() + if (build_platform != run_platform + and sys.platform == 'linux' and sys.maxsize < 2**32): + # The platform entry describes the machine the build was made + # on. A 32-bit process on a 64-bit kernel sees the kernel's + # machine name instead ('x86_64' for an i686 build, 'armv8l' or + # 'aarch64' for an armv7l build), so the two can legitimately + # differ (gh-161870). + self.skipTest('the build machine may differ for 32-bit builds') + self.assertEqual(build_platform, run_platform) def test_language_version(self): allowed_characters = string.digits + string.ascii_letters + '.' diff --git a/Misc/NEWS.d/next/Tests/2026-11-12-16-21-53.gh-issue-161870.gRmljQ.rst b/Misc/NEWS.d/next/Tests/2026-11-12-16-21-53.gh-issue-161870.gRmljQ.rst new file mode 100644 index 000000000000000..936bc4c654210fc --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-11-12-16-21-53.gh-issue-161870.gRmljQ.rst @@ -0,0 +1 @@ +Skip test_build_details.test_platform when a 32-bit build runs on a machine whose kernel reports a different machine name.