René's URL Explorer Experiment


Title: Inconsistent platform support for taking the loaded `libpython` path into account in `getpath` · Issue #127970 · python/cpython · GitHub

Open Graph Title: Inconsistent platform support for taking the loaded `libpython` path into account in `getpath` · Issue #127970 · python/cpython

X Title: Inconsistent platform support for taking the loaded `libpython` path into account in `getpath` · Issue #127970 · python/cpython

Description: Bug report Bug description: The current getpath.py code tries determining base_prefix/base_exec_prefix by searching the location of the libpython library loaded in the current process, falling back to the location of the Python interpret...

Open Graph Description: Bug report Bug description: The current getpath.py code tries determining base_prefix/base_exec_prefix by searching the location of the libpython library loaded in the current process, falling back...

X Description: Bug report Bug description: The current getpath.py code tries determining base_prefix/base_exec_prefix by searching the location of the libpython library loaded in the current process, falling back...

Opengraph URL: https://github.com/python/cpython/issues/127970

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent platform support for taking the loaded `libpython` path into account in `getpath`","articleBody":"# Bug report\n\n### Bug description:\n\nThe current `getpath.py` code tries determining `base_prefix`/`base_exec_prefix` by searching the location of the `libpython` library loaded in the current process, falling back to the location of the Python interpreter executable.\n\nhttps://github.com/python/cpython/blob/7900a85019457c14e8c6abac532846bc9f26760d/Modules/getpath.py#L559-L594\n\nLooking at the location of the `libpython` library in use first makes sense, as that is more reliable than looking at interpreter location — it works when embedding, where there isn't any interpreter executable, it works when the executable is not on `base_prefix`, etc. However, this is only currently supported on Windows and macOS framework builds.\n\nhttps://github.com/python/cpython/blob/7b8bd3b2b81f4aca63c5b603b56998f6b3ee2611/Modules/getpath.c#L802-L837\n\nThe spotty platform support stroke me as odd, especially on macOS, as I see no apparent reason for only supporting framework builds, so I looked traced back the origin of this code.\n\nThe macOS logic goes back to Python 2.0, having been introduced in 54ecc3d24f52ae45ca54a24167e434915c88b60f. At this time, we were determining `base_prefix`/`base_exec_prefix` based on the Python interpreter location, which was problematic on [OS X Frameworks](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html), as the Python interpreter is provided via a launcher. The comment traces back to 55070f5d966f09256c603c3a82fab9b034430c6f and is unrelated to the change made by that commit, it just highlights the special case for macOS framework builds.\n\nIn GH-29041, which introduced `getpath.py`, rewriting the old path initialization C code in Python, the logic changed to purposefully search the `libpython` location before the executable location, also adding Windows support. I imagine the existing macOS code was kept as-is as a mistake, leaving it behind the `WITH_NEXT_FRAMEWORK` flag, maybe under the assumption it was needed for some reason.\n\nConsidering the clear intent in the code, I am treating this a bug.\n\ncc @zooba\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-127972\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/FFY00","@type":"Person","name":"FFY00"},"datePublished":"2024-12-15T18:19:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/127970/cpython/issues/127970"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:629c8358-64ed-5687-70af-a264c304186c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEC32:3C7A3:255A0AF:33EB4E5:6A4F5008
html-safe-nonceeff3d67a1382e359de0a6a357f4800b02916638cd843417e29168cb9ad2bf2f4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzMyOjNDN0EzOjI1NUEwQUY6MzNFQjRFNTo2QTRGNTAwOCIsInZpc2l0b3JfaWQiOiI0MDkwMzg0ODg0MzUwMDEzNDQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac2d6c5e5b484cc6b0bd657f0242f3ac5bf4c917112e28c23b8768e67529baacbd
hovercard-subject-tagissue:2740806219
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/127970/issue_layout
twitter:imagehttps://opengraph.githubassets.com/55812ce171ca83106d17c13d2cf102ed8e751d64258db3f067560718fb969f57/python/cpython/issues/127970
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/55812ce171ca83106d17c13d2cf102ed8e751d64258db3f067560718fb969f57/python/cpython/issues/127970
og:image:altBug report Bug description: The current getpath.py code tries determining base_prefix/base_exec_prefix by searching the location of the libpython library loaded in the current process, falling back...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameFFY00
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
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-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4b249b445842943ed31549e027f57a8ade9881ed
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/127970#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F127970
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F127970
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/127970
Reloadhttps://github.com/python/cpython/issues/127970
Reloadhttps://github.com/python/cpython/issues/127970
Please reload this pagehttps://github.com/python/cpython/issues/127970
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/127970
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 34.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.6k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Inconsistent platform support for taking the loaded libpython path into account in getpathhttps://github.com/python/cpython/issues/127970#top
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/FFY00
FFY00https://github.com/FFY00
on Dec 15, 2024https://github.com/python/cpython/issues/127970#issue-2740806219
cpython/Modules/getpath.pyhttps://github.com/python/cpython/blob/7900a85019457c14e8c6abac532846bc9f26760d/Modules/getpath.py#L559-L594
7900a85https://github.com/python/cpython/commit/7900a85019457c14e8c6abac532846bc9f26760d
cpython/Modules/getpath.chttps://github.com/python/cpython/blob/7b8bd3b2b81f4aca63c5b603b56998f6b3ee2611/Modules/getpath.c#L802-L837
7b8bd3bhttps://github.com/python/cpython/commit/7b8bd3b2b81f4aca63c5b603b56998f6b3ee2611
54ecc3dhttps://github.com/python/cpython/commit/54ecc3d24f52ae45ca54a24167e434915c88b60f
OS X Frameworkshttps://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html
55070f5https://github.com/python/cpython/commit/55070f5d966f09256c603c3a82fab9b034430c6f
GH-29041https://github.com/python/cpython/pull/29041
@zoobahttps://github.com/zooba
GH-127970: find the runtime library when dladdr is available #127972https://github.com/python/cpython/pull/127972
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
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.