René's URL Explorer Experiment


Title: gh-154200: Use sysconfig.get_platform() in test_importlib.test_windows by SynaptSea · Pull Request #154210 · python/cpython · GitHub

Open Graph Title: gh-154200: Use sysconfig.get_platform() in test_importlib.test_windows by SynaptSea · Pull Request #154210 · python/cpython

X Title: gh-154200: Use sysconfig.get_platform() in test_importlib.test_windows by SynaptSea · Pull Request #154210 · python/cpython

Description: Fixes #154200 test_tagged_suffix computes its expected extension suffix with a vendored "Port of distutils.util.get_platform()" that sniffs sys.version.lower() for 'amd64'. Python/getversion.c truncates the compiler segment of sys.version at 80 characters ("%.80s"). On clang-cl builds the banner is "[Clang " __clang_version__ "] 64 bit (AMD64) with MSC v. CRT]", and official LLVM Windows binaries have an 86-character __clang_version__, so the (AMD64) marker is always cut off. The helper falls through to return sys.platform -> 'win32', and the test expects .cp316t-win32.pyd while the interpreter correctly reports .cp316t-win_amd64.pyd: AssertionError: '.cp316t-win32.pyd' not found in ['.cp316t-win_amd64.pyd', '.pyd'] sysconfig.get_platform() no longer has this problem: since gh-145410 it does not parse sys.version on Windows but delegates to the _sysconfig C accelerator, which derives the platform from compile-time architecture macros and is compiler-agnostic. So this uses it and deletes the vendored copy, which that call site was the only consumer of. This is not circular: SYSCONFIG_PLATFORM in Modules/_sysconfig.c and PYD_PLATFORM_TAG in PC/pyconfig.h are independent definitions in separate files, so the assertion still cross-checks two separate derivations. It also drops the VSCMD_ARG_TGT_ARCH branch, which trusted the ambient Visual Studio developer-prompt target architecture over the interpreter actually executing the test. That was backwards — EXTENSION_SUFFIXES is compiled into the running binary — and it is why the failure only reproduced outside a VS developer prompt. Testing On a local clang-cl free-threaded build, python -m unittest test.test_importlib.test_windows: before: Ran 11 tests ... FAILED (failures=2) (the Frozen_ and Source_ variants) after: Ran 11 tests ... OK Also OK with VSCMD_ARG_TGT_ARCH=x64, and with VSCMD_ARG_TGT_ARCH=x86 deliberately mismatched against this amd64 interpreter — the old code would have computed 'win32' and failed there. Full python -m test test_importlib: run=1229 skipped=23, SUCCESS. Note the re.sub() is still required: sysconfig.get_platform() returns win-amd64 with a hyphen while PYD_PLATFORM_TAG uses win_amd64. os and re both remain in use elsewhere in the module, so no imports become unused. NEWS This is a test-only change, which the devguide lists as not requiring a Misc/NEWS.d entry, so I have not added a blurb — could a maintainer apply skip news? Happy to add one instead if you would prefer, on the grounds that it unblocks a whole build configuration. Issue: gh-154200

Open Graph Description: Fixes #154200 test_tagged_suffix computes its expected extension suffix with a vendored "Port of distutils.util.get_platform()" that sniffs sys.version.lower() for 'amd64'. Python...

X Description: Fixes #154200 test_tagged_suffix computes its expected extension suffix with a vendored "Port of distutils.util.get_platform()" that sniffs sys.version.lower() for 'amd64&...

Opengraph URL: https://github.com/python/cpython/pull/154210

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d5e30131-4092-7677-1036-aeadb1ad9c62
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8FB4:65478:39B0947:4C82BA5:6B0213CD
html-safe-noncee1cbec0b13f593a6bdace025cdc115f276da8f15f0f7f0256275ec3b411770be
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkI0OjY1NDc4OjM5QjA5NDc6NEM4MkJBNTo2QjAyMTNDRCIsInZpc2l0b3JfaWQiOiI1NzkzMDUxMTA0NjYxMDgzMDg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac725e8788233d552c0cab48553c2a374fec8d4a9ef4e4958959f76b75399e1a59
hovercard-subject-tagpull_request:4087719286
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/154210/files
twitter:imagehttps://avatars.githubusercontent.com/u/36235551?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/36235551?s=400&v=4
og:image:altFixes #154200 test_tagged_suffix computes its expected extension suffix with a vendored "Port of distutils.util.get_platform()" that sniffs sys.version.lower() for 'amd64'. Python...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/154210/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F154210%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F154210%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/154210/files
Reloadhttps://github.com/python/cpython/pull/154210/files
Reloadhttps://github.com/python/cpython/pull/154210/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
chris-eiblhttps://github.com/chris-eibl
python:mainhttps://github.com/python/cpython/tree/main
SynaptSea:fix-test-windows-platformhttps://github.com/SynaptSea/cpython/tree/fix-test-windows-platform
Conversation 13 https://github.com/python/cpython/pull/154210
Commits 2 https://github.com/python/cpython/pull/154210/commits
Checks 53 https://github.com/python/cpython/pull/154210/checks
Files changed https://github.com/python/cpython/pull/154210/files
Please reload this pagehttps://github.com/python/cpython/pull/154210/files
gh-154200: Use sysconfig.get_platform() in test_importlib.test_windows https://github.com/python/cpython/pull/154210/files#top
Show all changes 2 commits https://github.com/python/cpython/pull/154210/files
d63344e gh-154200: Use sysconfig.get_platform() in test_importlib.test_windows SynaptSea Jul 20, 2026 https://github.com/python/cpython/pull/154210/commits/d63344ef8dffd59382eb98727fe0aa0d572534af
0cb4a36 Merge branch 'main' into fix-test-windows-platform chris-eibl Jul 21, 2026 https://github.com/python/cpython/pull/154210/commits/0cb4a36d2e82121b97576a4650219c5c940abe4f
Clear filters https://github.com/python/cpython/pull/154210/files
Please reload this pagehttps://github.com/python/cpython/pull/154210/files
Please reload this pagehttps://github.com/python/cpython/pull/154210/files
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L261
Lib/test/test_importlib/test_windows.pyhttps://github.com/python/cpython/pull/154210/files#diff-988e62a1e5e86de7b50d77a4d35c27587b211f335a0107fed76f2770930691d2
View file https://github.com/SynaptSea/cpython/blob/0cb4a36d2e82121b97576a4650219c5c940abe4f/Lib/test/test_importlib/test_windows.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/154210/{{ revealButtonHref }}
https://github.com/python/cpython/pull/154210/files#diff-988e62a1e5e86de7b50d77a4d35c27587b211f335a0107fed76f2770930691d2
https://github.com/python/cpython/pull/154210/files#diff-988e62a1e5e86de7b50d77a4d35c27587b211f335a0107fed76f2770930691d2
https://github.com/python/cpython/pull/154210/files#diff-988e62a1e5e86de7b50d77a4d35c27587b211f335a0107fed76f2770930691d2
https://github.com/python/cpython/pull/154210/files#diff-988e62a1e5e86de7b50d77a4d35c27587b211f335a0107fed76f2770930691d2
https://github.com/python/cpython/pull/154210/files#diff-988e62a1e5e86de7b50d77a4d35c27587b211f335a0107fed76f2770930691d2
Please reload this pagehttps://github.com/python/cpython/pull/154210/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.