René's URL Explorer Experiment


Title: Cannot import ``Anchor`` from ``importlib.resources`` · Issue #113238 · python/cpython · GitHub

Open Graph Title: Cannot import ``Anchor`` from ``importlib.resources`` · Issue #113238 · python/cpython

X Title: Cannot import ``Anchor`` from ``importlib.resources`` · Issue #113238 · python/cpython

Description: Bug report Bug description: The Python 3.12 documentation of the standard library module importlib.resources describes the importlib.resources.Anchor class, which is used for the type annotation of the files() function. But in reality An...

Open Graph Description: Bug report Bug description: The Python 3.12 documentation of the standard library module importlib.resources describes the importlib.resources.Anchor class, which is used for the type annotation of...

X Description: Bug report Bug description: The Python 3.12 documentation of the standard library module importlib.resources describes the importlib.resources.Anchor class, which is used for the type annotation of...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot import ``Anchor`` from ``importlib.resources``","articleBody":"# Bug report\n\n### Bug description:\n\nThe Python 3.12 documentation of the standard library module `importlib.resources` describes the [importlib.resources.Anchor](https://docs.python.org/3.12/library/importlib.resources.html#importlib.resources.Anchor) class, which is used for the type annotation of the `files()` function.\nBut in reality `Anchor` is not available to import from `importlib.resources`, it can only by found in `importlib.resources._common` as an alias for `Package` (which is instead available from `importlib.resources`).\n\nTo reproduce:\n\n```python\n>>> from importlib.resources import Anchor\nTraceback (most recent call last):\n  File \"\u003cstdin>\", line 1, in \u003cmodule>\nImportError: cannot import name 'Anchor' from 'importlib.resources' (/usr/lib/python3.12/importlib/resources/__init__.py)\n```\n\nExpected result:\nNo `ImportError`\n\nUse case:\nTo add type annotation to a function that receives an anchor and passes it to `files()`.\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-113799\n* gh-113801\n* gh-130499\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/nsoranzo","@type":"Person","name":"nsoranzo"},"datePublished":"2023-12-17T19:12:16Z","url":"https://github.com/python/cpython/issues/113238"}

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:3e98780c-1721-3429-2154-414cba0c9395
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9EB0:15E5F9:2973A0D:38AFE12:6B00518A
html-safe-noncec992def26675503d4068bfb56f9b46a49abf30a50294a4a51de5a3691be443fe
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUIwOjE1RTVGOToyOTczQTBEOjM4QUZFMTI6NkIwMDUxOEEiLCJ2aXNpdG9yX2lkIjoiODAxMTAxNzUwMjQ1MDUzNjg0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac185790e94a1bf766bb5aa67dc476d462115785b6f32d568f661d637d6cc3be72
hovercard-subject-tagissue:2045340141
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/113238/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8ad605e3c6639fae55605e591af03396ea7b755ebf60ce8b7f5cee3399bbbd33/python/cpython/issues/113238
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8ad605e3c6639fae55605e591af03396ea7b755ebf60ce8b7f5cee3399bbbd33/python/cpython/issues/113238
og:image:altBug report Bug description: The Python 3.12 documentation of the standard library module importlib.resources describes the importlib.resources.Anchor class, which is used for the type annotation of...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamensoranzo
hostnamegithub.com
expected-hostnamegithub.com
Nonef420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb
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
release26e00df917aba0f128135dc073ea0c5e33a70d40
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/113238#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F113238
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%2F113238
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/113238
Reloadhttps://github.com/python/cpython/issues/113238
Reloadhttps://github.com/python/cpython/issues/113238
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/113238
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/113238
Cannot import Anchor from importlib.resourceshttps://github.com/python/cpython/issues/113238#top
topic-importlibhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-importlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/nsoranzo
nsoranzohttps://github.com/nsoranzo
on Dec 17, 2023https://github.com/python/cpython/issues/113238#issue-2045340141
importlib.resources.Anchorhttps://docs.python.org/3.12/library/importlib.resources.html#importlib.resources.Anchor
[3.12] gh-113238: add Anchor to importlib.resources #113799https://github.com/python/cpython/pull/113799
gh-113238: add Anchor to importlib.resources #113801https://github.com/python/cpython/pull/113801
[3.12] gh-113238: add Anchor to importlib.resources (GH-113801) #130499https://github.com/python/cpython/pull/130499
nsoranzohttps://github.com/nsoranzo
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Dec 17, 2023https://github.com/python/cpython/issues/113238#event-11269137799
nsoranzohttps://github.com/nsoranzo
on Dec 17, 2023https://github.com/python/cpython/issues/113238#event-11269147361
Workaround ``ImportError`` for ``importlib.resources.Anchor``https://github.com/tuncK/galaxy/commit/10bc5a951b70999a7bba5acc5495ed80087fc181
10bc5a9https://github.com/tuncK/galaxy/commit/10bc5a951b70999a7bba5acc5495ed80087fc181
ronaldoussorenhttps://github.com/ronaldoussoren
topic-importlibhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-importlib%22
on Dec 17, 2023https://github.com/python/cpython/issues/113238#event-11269160515
nsoranzohttps://github.com/nsoranzo
on Dec 17, 2023https://github.com/python/cpython/issues/113238#event-11269161595
Workaround ``ImportError`` for ``importlib.resources.Anchor``https://github.com/tuncK/galaxy/commit/c7a12fd446fc583c014a7976f7e10b017822772d
c7a12fdhttps://github.com/tuncK/galaxy/commit/c7a12fd446fc583c014a7976f7e10b017822772d
mikeziminiohttps://github.com/mikeziminio
on Jan 7, 2024https://github.com/python/cpython/issues/113238#event-11411985234
pythongh-113238: add Anchor to importlib.resourceshttps://github.com/mikeziminio/cpython/commit/e0bb99a7d073a412950ca02213e5cafecf164060
pythongh-113238https://github.com/python/cpython/issues/113238
e0bb99ahttps://github.com/mikeziminio/cpython/commit/e0bb99a7d073a412950ca02213e5cafecf164060
https://github.com/mikeziminio
mikeziminiohttps://github.com/mikeziminio
on Jan 7, 2024https://github.com/python/cpython/issues/113238#issuecomment-1880180804
@jaracohttps://github.com/jaraco
mikeziminiohttps://github.com/mikeziminio
on Jan 7, 2024https://github.com/python/cpython/issues/113238#event-11412206603
pythongh-113238: add Anchor to importlib.resourceshttps://github.com/mikeziminio/cpython/commit/6cd196e6b9b5ad39117569f56af50c4b814222e3
pythongh-113238https://github.com/python/cpython/issues/113238
6cd196ehttps://github.com/mikeziminio/cpython/commit/6cd196e6b9b5ad39117569f56af50c4b814222e3
https://github.com/jaraco
jaracohttps://github.com/jaraco
on Jan 7, 2024https://github.com/python/cpython/issues/113238#issuecomment-1880225232
https://github.com/nsoranzo
nsoranzohttps://github.com/nsoranzo
on Jan 8, 2024https://github.com/python/cpython/issues/113238#issuecomment-1880239078
https://github.com/python/importlib_resources/blob/main/importlib_resources/_common.py#L54https://github.com/python/importlib_resources/blob/main/importlib_resources/_common.py#L54
https://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/util/resources.pyhttps://github.com/galaxyproject/galaxy/blob/dev/lib/galaxy/util/resources.py
https://github.com/FFY00
FFY00https://github.com/FFY00
on Jan 16, 2024https://github.com/python/cpython/issues/113238#issuecomment-1893508875
FFY00https://github.com/FFY00
on Jan 16, 2024https://github.com/python/cpython/issues/113238#event-11497321900
gh-113238: add Anchor to importlib.resources (#113801)https://github.com/python/cpython/commit/c85c0026a64c2a902138feeb73a9c66af1af31e0
gh-113238https://github.com/python/cpython/issues/113238
#113801https://github.com/python/cpython/pull/113801
c85c002https://github.com/python/cpython/commit/c85c0026a64c2a902138feeb73a9c66af1af31e0
nsoranzohttps://github.com/nsoranzo
on Jan 21, 2024https://github.com/python/cpython/issues/113238#event-11548888223
Workaround ``ImportError`` for ``importlib.resources.Anchor``https://github.com/tuncK/galaxy/commit/30a6aab6c91a4946966406a678c67242772b6aa1
30a6aabhttps://github.com/tuncK/galaxy/commit/30a6aab6c91a4946966406a678c67242772b6aa1
kulikjakhttps://github.com/kulikjak
on Jan 22, 2024https://github.com/python/cpython/issues/113238#event-11555468606
pythongh-113238: add Anchor to importlib.resources (python#113801)https://github.com/kulikjak/cpython/commit/05118031c4896cd404c73051c1c18edceeea35a8
pythongh-113238https://github.com/python/cpython/issues/113238
python#113801https://github.com/python/cpython/pull/113801
0511803https://github.com/kulikjak/cpython/commit/05118031c4896cd404c73051c1c18edceeea35a8
aiskhttps://github.com/aisk
on Feb 11, 2024https://github.com/python/cpython/issues/113238#event-11766816758
pythongh-113238: add Anchor to importlib.resources (python#113801)https://github.com/aisk/cpython/commit/2263a00564e2d47e50f4e88a44b89b6d78ffc936
pythongh-113238https://github.com/python/cpython/issues/113238
python#113801https://github.com/python/cpython/pull/113801
2263a00https://github.com/aisk/cpython/commit/2263a00564e2d47e50f4e88a44b89b6d78ffc936
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Mar 12, 2024https://github.com/python/cpython/issues/113238#issuecomment-1992602928
https://github.com/jaraco
jaracohttps://github.com/jaraco
on Mar 13, 2024https://github.com/python/cpython/issues/113238#issuecomment-1994777313
jaracohttps://github.com/jaraco
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 13, 2024https://github.com/python/cpython/issues/113238#event-12105796308
Glyphackhttps://github.com/Glyphack
on Sep 2, 2024https://github.com/python/cpython/issues/113238#event-14106087824
pythongh-113238: add Anchor to importlib.resources (python#113801)https://github.com/Glyphack/cpython/commit/774be21960dcfe7d8b5461e10ba6bdcb6dae7da8
pythongh-113238https://github.com/python/cpython/issues/113238
python#113801https://github.com/python/cpython/pull/113801
774be21https://github.com/Glyphack/cpython/commit/774be21960dcfe7d8b5461e10ba6bdcb6dae7da8
hugovkhttps://github.com/hugovk
on Feb 24, 2025https://github.com/python/cpython/issues/113238#event-16428476590
[3.12] pythongh-113238: add Anchor to importlib.resources (pythonGH-1…https://github.com/hugovk/cpython/commit/af378646215a22e91055238f465a64cb93f29c48
pythongh-113238https://github.com/python/cpython/issues/113238
pythonGH-1…https://github.com/python/cpython/pull/113801
af37864https://github.com/hugovk/cpython/commit/af378646215a22e91055238f465a64cb93f29c48
jaracohttps://github.com/jaraco
on Mar 8, 2025https://github.com/python/cpython/issues/113238#event-16642619236
[3.12] gh-113238: add Anchor to importlib.resources (GH-113801) (#130499https://github.com/python/cpython/commit/d128edb0eca01e42219f0e216afce992917c29d3
gh-113238https://github.com/python/cpython/issues/113238
GH-113801https://github.com/python/cpython/pull/113801
#130499https://github.com/python/cpython/pull/130499
d128edbhttps://github.com/python/cpython/commit/d128edb0eca01e42219f0e216afce992917c29d3
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/113238
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/113238
topic-importlibhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-importlib%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.