René's URL Explorer Experiment


Title: _ios_support fails to import on iOS 13, where find_library() cannot query the dyld shared cache · Issue #156112 · python/cpython · GitHub

Open Graph Title: _ios_support fails to import on iOS 13, where find_library() cannot query the dyld shared cache · Issue #156112 · python/cpython

X Title: _ios_support fails to import on iOS 13, where find_library() cannot query the dyld shared cache · Issue #156112 · python/cpython

Description: Bug report Bug description: Lib/_ios_support.py raises ImportError at module import if ctypes.util.find_library("objc") returns None: lib = util.find_library("objc") if lib is None: # Failed to load the objc library raise ImportError("Ob...

Open Graph Description: Bug report Bug description: Lib/_ios_support.py raises ImportError at module import if ctypes.util.find_library("objc") returns None: lib = util.find_library("objc") if lib is None: # Failed to loa...

X Description: Bug report Bug description: Lib/_ios_support.py raises ImportError at module import if ctypes.util.find_library("objc") returns None: lib = util.find_library("objc") if lib is N...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"_ios_support fails to import on iOS 13, where find_library() cannot query the dyld shared cache","articleBody":"# Bug report\n\n### Bug description:\n\n`Lib/_ios_support.py` raises `ImportError` at module import if `ctypes.util.find_library(\"objc\")` returns `None`:\n\n```python\nlib = util.find_library(\"objc\")\nif lib is None:\n    # Failed to load the objc library\n    raise ImportError(\"ObjC runtime library couldn't be loaded\")\n```\n\nOn Apple platforms the ObjC runtime exists only in the dyld shared cache, not as a file on disk, so `find_library()` cannot resolve it by a filesystem check. `ctypes.macholib.dyld.dyld_find()` handles that by falling back to `_dyld_shared_cache_contains_path()`:\n\n```python\nif os.path.isfile(path):\n    return path\ntry:\n    if _dyld_shared_cache_contains_path(path):\n        return path\nexcept NotImplementedError:\n    pass\n```\n\nThat symbol is availability-guarded at *runtime* in `Modules/_ctypes/callproc.c`:\n\n```c\n#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH_RUNTIME \\\n    __builtin_available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)\n```\n\nso on iOS 13 the probe raises `NotImplementedError`, `dyld_find()` gives up, `find_library(\"objc\")` returns `None`, and importing `_ios_support` fails outright. `IPHONEOS_DEPLOYMENT_TARGET` defaults to `13.0` in `configure.ac`, so this is inside the range iOS support targets, and it takes `platform.platform()`, `platform.ios_ver()` and anything else built on `_ios_support` down with it.\n\ndyld resolves a bare library name against the shared cache by itself, so the runtime is loadable even when `find_library()` cannot name a path for it. On macOS, where the same cache mechanism applies:\n\n```\n>>> from ctypes import cdll, util; import os\n>>> util.find_library(\"objc\")\n'/usr/lib/libobjc.dylib'\n>>> os.path.isfile(\"/usr/lib/libobjc.dylib\")\nFalse\n>>> cdll.LoadLibrary(\"libobjc.dylib\")\n\u003cCDLL 'libobjc.dylib', handle ... at ...>\n```\n\nThe suggested fix is to fall back to the bare name when `find_library()` comes up empty, and to keep reporting a genuine load failure as `ImportError`. With `find_library` patched to return `None`, the module then loads the runtime and `objc_getClass(b\"NSProcessInfo\")` works.\n\nA caveat on the evidence: I do not have an iOS 13 device or simulator runtime, so I have not reproduced the import failure on-device — the chain above is read from the source. The fallback itself is verified, as shown.\n\n### CPython versions tested on:\n\nCPython main\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156113\n* gh-156215\n* gh-156216\n* gh-156217\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/clementperon","@type":"Person","name":"clementperon"},"datePublished":"2026-08-20T13:50:35Z","url":"https://github.com/python/cpython/issues/156112"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7510ae64-c88e-33d4-412a-4406386b4ef8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE8C8:2C4BED:39B5B76:494D1F7:6B01F9AC
html-safe-nonce7e66fdba725fd49587a44e54d15cfb7a0b7480b8828e8f40de21450eba732c7e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEM4OjJDNEJFRDozOUI1Qjc2OjQ5NEQxRjc6NkIwMUY5QUMiLCJ2aXNpdG9yX2lkIjoiNTk1ODk3MzI4MDUxMjc2ODQyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4f4694b592a47279b5d7ea4f550a6ea16ff4381933050adddc3f497f400468c7
hovercard-subject-tagissue:5204132756
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/156112/issue_layout
twitter:imagehttps://opengraph.githubassets.com/00c9c5cd6e064af763e8661d579233473dde4109c7e6da980ebbbaacf9ba43f3/python/cpython/issues/156112
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/00c9c5cd6e064af763e8661d579233473dde4109c7e6da980ebbbaacf9ba43f3/python/cpython/issues/156112
og:image:altBug report Bug description: Lib/_ios_support.py raises ImportError at module import if ctypes.util.find_library("objc") returns None: lib = util.find_library("objc") if lib is None: # Failed to loa...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameclementperon
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/156112#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F156112
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%2Fissues%2F156112
Sign uphttps://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/156112
Reloadhttps://github.com/python/cpython/issues/156112
Reloadhttps://github.com/python/cpython/issues/156112
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
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/156112
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/156112
_ios_support fails to import on iOS 13, where find_library() cannot query the dyld shared cachehttps://github.com/python/cpython/issues/156112#top
OS-ioshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-ios%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/clementperon
clementperonhttps://github.com/clementperon
on Aug 20, 2026https://github.com/python/cpython/issues/156112#issue-5204132756
gh-156112: Load the ObjC runtime by name when find_library() cannot resolve it #156113https://github.com/python/cpython/pull/156113
[3.15] gh-156112: Load the ObjC runtime by name when find_library() cannot resolve it (GH-156113) #156215https://github.com/python/cpython/pull/156215
[3.14] gh-156112: Load the ObjC runtime by name when find_library() cannot resolve it (GH-156113) #156216https://github.com/python/cpython/pull/156216
[3.13] gh-156112: Load the ObjC runtime by name when find_library() cannot resolve it (GH-156113) #156217https://github.com/python/cpython/pull/156217
aiskhttps://github.com/aisk
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
OS-ioshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-ios%22
on Aug 20, 2026https://github.com/python/cpython/issues/156112#event-29753218625
https://github.com/freakboy3742
freakboy3742https://github.com/freakboy3742
on Aug 21, 2026https://github.com/python/cpython/issues/156112#issuecomment-5364457887
freakboy3742https://github.com/freakboy3742
on Aug 22, 2026https://github.com/python/cpython/issues/156112#event-29837535053
gh-156112: Load the ObjC runtime by name when find_library() cannot r…https://github.com/python/cpython/commit/918fb3aec907baf8d9b6181570ff308529be16a3
gh-156112https://github.com/python/cpython/issues/156112
918fb3ahttps://github.com/python/cpython/commit/918fb3aec907baf8d9b6181570ff308529be16a3
[3.13] gh-156112: Load the ObjC runtime by name when find_library() c…https://github.com/python/cpython/commit/fe4c50b2de0fd79d2d10acca0303421799305fac
gh-156112https://github.com/python/cpython/issues/156112
fe4c50bhttps://github.com/python/cpython/commit/fe4c50b2de0fd79d2d10acca0303421799305fac
[3.14] gh-156112: Load the ObjC runtime by name when find_library() c…https://github.com/python/cpython/commit/f89e637fdf4641d5a1e8eb3da56b164bcb9bb3df
gh-156112https://github.com/python/cpython/issues/156112
f89e637https://github.com/python/cpython/commit/f89e637fdf4641d5a1e8eb3da56b164bcb9bb3df
hugovkhttps://github.com/hugovk
on Aug 29, 2026https://github.com/python/cpython/issues/156112#event-30206882377
[3.15] gh-156112: Load the ObjC runtime by name when find_library() c…https://github.com/python/cpython/commit/ae14ab60d41b923bca405506d1056259d3dd876f
gh-156112https://github.com/python/cpython/issues/156112
ae14ab6https://github.com/python/cpython/commit/ae14ab60d41b923bca405506d1056259d3dd876f
hugovkhttps://github.com/hugovk
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 29, 2026https://github.com/python/cpython/issues/156112#event-30206889760
freakboy3742https://github.com/freakboy3742
on Oct 2, 2026https://github.com/python/cpython/issues/156112#event-32298466184
[3.13] pythongh-156112: Load the ObjC runtime by name when find_libra…https://github.com/freakboy3742/cpython/commit/bb6bc0bd0fe61f491d033e035ed26818c45c1623
pythongh-156112https://github.com/python/cpython/issues/156112
bb6bc0bhttps://github.com/freakboy3742/cpython/commit/bb6bc0bd0fe61f491d033e035ed26818c45c1623
[3.12] pythongh-156112: Load the ObjC runtime by name when find_libra…https://github.com/freakboy3742/cpython/commit/2a2dc2da6d76ab06f60f7ba7750bcfefa47e6bf3
pythongh-156112https://github.com/python/cpython/issues/156112
2a2dc2dhttps://github.com/freakboy3742/cpython/commit/2a2dc2da6d76ab06f60f7ba7750bcfefa47e6bf3
[3.11] pythongh-156112: Load the ObjC runtime by name when find_libra…https://github.com/freakboy3742/cpython/commit/42bd802d43dc41c7207a2db0050c004e218c29d2
pythongh-156112https://github.com/python/cpython/issues/156112
42bd802https://github.com/freakboy3742/cpython/commit/42bd802d43dc41c7207a2db0050c004e218c29d2
[3.14] pythongh-156112: Load the ObjC runtime by name when find_libra…https://github.com/freakboy3742/cpython/commit/f471f53242a7310bd8570849d5171b1d14a10582
pythongh-156112https://github.com/python/cpython/issues/156112
f471f53https://github.com/freakboy3742/cpython/commit/f471f53242a7310bd8570849d5171b1d14a10582
freakboy3742https://github.com/freakboy3742
on Oct 12, 2026https://github.com/python/cpython/issues/156112#event-33015284301
[3.12] pythongh-156112: Load the ObjC runtime by name when find_libra…https://github.com/freakboy3742/cpython/commit/cc89a781f1de2f64c2fee0635df1742cb8c2ba1d
pythongh-156112https://github.com/python/cpython/issues/156112
cc89a78https://github.com/freakboy3742/cpython/commit/cc89a781f1de2f64c2fee0635df1742cb8c2ba1d
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/156112
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/156112
OS-ioshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22OS-ios%22
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%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.