René's URL Explorer Experiment


Title: Fix SimpleReader traversal adapters by Zhuyuyangyy · Pull Request #339 · python/importlib_resources · GitHub

Open Graph Title: Fix SimpleReader traversal adapters by Zhuyuyangyy · Pull Request #339 · python/importlib_resources

X Title: Fix SimpleReader traversal adapters by Zhuyuyangyy · Pull Request #339 · python/importlib_resources

Description: Problem A provider implementing the documented SimpleReader interface through TraversableReader cannot use files(): ResourceContainer is still abstract because it does not implement Traversable.name. from io import BytesIO from importlib_resources.simple import TraversableReader class Reader(TraversableReader): package = "example.package" def children(self): return [] def resources(self): return ["data.txt"] def open_binary(self, resource): return BytesIO(b"hello") Reader().files() # TypeError: abstract method 'name' The same adapter path has further blockers once the container can be instantiated: ResourceHandle lacks concrete name and iterdir implementations, resource enumeration iterates over the resources method rather than its result, and the leaf's joinpath cannot accept the empty tail supplied by Traversable.joinpath. Changes Implement the concrete container and resource names; use the reader's existing package-derived name for containers. Call resources() when enumerating entries. Give resource handles an empty directory iterator, matching the neighboring compatibility adapter. Let a resource's empty joinpath() return itself while preserving the existing error for attempts to traverse further. Add end-to-end tests for empty and populated readers, nested resources, binary/text reads, and the inherited resource-reader methods. Include the now-tested simple.py in coverage and add a news fragment. The change is confined to the SimpleReader adapters; it does not alter the public Traversable base implementation. Validation The six new end-to-end tests fail on the original implementation and pass after the fix. tox -e py312: 312 passed, 1 skipped, 81 subtests passed, including Ruff and mypy checks (no issues in 30 source files). simple.py: 59/59 statements covered (100%); overall suite coverage 97%. ruff format --check importlib_resources/simple.py importlib_resources/tests/test_simple.py: passed. git diff --check: passed. Checked the existing open PRs and related history (#183, #249, #250, #267); I did not find an existing fix for this adapter failure. AI assistance disclosure This PR was prepared by an AI coding agent acting on behalf of @Zhuyuyangyy, including the code, regression tests, and automated validation. It has not received independent human code review.

Open Graph Description: Problem A provider implementing the documented SimpleReader interface through TraversableReader cannot use files(): ResourceContainer is still abstract because it does not implement Traversable.nam...

X Description: Problem A provider implementing the documented SimpleReader interface through TraversableReader cannot use files(): ResourceContainer is still abstract because it does not implement Traversable.nam...

Opengraph URL: https://github.com/python/importlib_resources/pull/339

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:d5e24046-4fb1-aaae-c1c3-43d2a13ec6c4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB8D0:4D1C6:2B6C39D:3B55FEE:6B005989
html-safe-nonce634df329ea329bad43b02a4158ceff0a571266a3ccc61f8b5c33bbf74d31e406
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEQwOjREMUM2OjJCNkMzOUQ6M0I1NUZFRTo2QjAwNTk4OSIsInZpc2l0b3JfaWQiOiIxNzk1NDI4NjU1MTcwNjA3NDk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb46ff30d48a93b106fe6d7f94859ba142c3a3cedcd46494bf968e3b3ba7ac6f7
hovercard-subject-tagpull_request:5090941107
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/importlib_resources/pull/339/files
twitter:imagehttps://avatars.githubusercontent.com/u/193758752?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/193758752?s=400&v=4
og:image:altProblem A provider implementing the documented SimpleReader interface through TraversableReader cannot use files(): ResourceContainer is still abstract because it does not implement Traversable.nam...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/importlib_resources git https://github.com/python/importlib_resources.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id306147182
octolytics-dimension-repository_nwopython/importlib_resources
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id306147182
octolytics-dimension-repository_network_root_nwopython/importlib_resources
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseeacd927ba6112e3b01ba99c762bd699a4a4f5df7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/importlib_resources/pull/339/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fimportlib_resources%2Fpull%2F339%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%2Fimportlib_resources%2Fpull%2F339%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%2Fimportlib_resources
Reloadhttps://github.com/python/importlib_resources/pull/339/files
Reloadhttps://github.com/python/importlib_resources/pull/339/files
Reloadhttps://github.com/python/importlib_resources/pull/339/files
pythonhttps://github.com/python
importlib_resourceshttps://github.com/python/importlib_resources
Codehttps://github.com/python/importlib_resources
Issues5 (5)https://github.com/python/importlib_resources/issues
Pull requests7 (7)https://github.com/python/importlib_resources/pulls
Actionshttps://github.com/python/importlib_resources/actions
Projectshttps://github.com/python/importlib_resources/projects
Security and qualityhttps://github.com/python/importlib_resources/security
Insightshttps://github.com/python/importlib_resources/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fimportlib_resources%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fimportlib_resources%2Fissues%2Fnew%2Fchoose
Zhuyuyangyyhttps://github.com/Zhuyuyangyy
python:mainhttps://github.com/python/importlib_resources/tree/main
Zhuyuyangyy:fix/simple-reader-traversalhttps://github.com/Zhuyuyangyy/importlib_resources/tree/fix/simple-reader-traversal
Conversation 0 https://github.com/python/importlib_resources/pull/339
Commits 1 https://github.com/python/importlib_resources/pull/339/commits
Checks 0 https://github.com/python/importlib_resources/pull/339/checks
Files changed https://github.com/python/importlib_resources/pull/339/files
Please reload this pagehttps://github.com/python/importlib_resources/pull/339/files
Fix SimpleReader traversal adapters https://github.com/python/importlib_resources/pull/339/files#top
Show all changes 1 commit https://github.com/python/importlib_resources/pull/339/files
e8c776d Fix SimpleReader traversal adapters Zhuyuyangyy Oct 30, 2026 https://github.com/python/importlib_resources/pull/339/commits/e8c776d586816cd81012a96362f860fee7f379b3
Clear filters https://github.com/python/importlib_resources/pull/339/files
Please reload this pagehttps://github.com/python/importlib_resources/pull/339/files
Please reload this pagehttps://github.com/python/importlib_resources/pull/339/files
.coveragerc https://github.com/python/importlib_resources/pull/339/files#diff-834e9b406d74791ffbafaeec9cc894082cea9739bc347b6ff9f72312c92ebc79
simple.py https://github.com/python/importlib_resources/pull/339/files#diff-8450e5a7408c175083d3bd549d279e9dfb23eb118e6515a51a483021520c450f
test_simple.py https://github.com/python/importlib_resources/pull/339/files#diff-eecfe37c7571dffefe5f584a174dee9b3dff3defb9e740f3a28a108f617a7035
+simple-reader-adapter.bugfix.rst https://github.com/python/importlib_resources/pull/339/files#diff-f16df115ff7574f011022e638537bda2010b316840c750b84e45026c0d8eab4d
.coveragerchttps://github.com/python/importlib_resources/pull/339/files#diff-834e9b406d74791ffbafaeec9cc894082cea9739bc347b6ff9f72312c92ebc79
View file https://github.com/python/importlib_resources/blob/e8c776d586816cd81012a96362f860fee7f379b3/.coveragerc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/importlib_resources/pull/339/{{ revealButtonHref }}
https://github.com/python/importlib_resources/pull/339/files#diff-834e9b406d74791ffbafaeec9cc894082cea9739bc347b6ff9f72312c92ebc79
https://github.com/python/importlib_resources/pull/339/files#diff-834e9b406d74791ffbafaeec9cc894082cea9739bc347b6ff9f72312c92ebc79
importlib_resources/simple.pyhttps://github.com/python/importlib_resources/pull/339/files#diff-8450e5a7408c175083d3bd549d279e9dfb23eb118e6515a51a483021520c450f
View file https://github.com/python/importlib_resources/blob/e8c776d586816cd81012a96362f860fee7f379b3/importlib_resources/simple.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/importlib_resources/pull/339/{{ revealButtonHref }}
https://github.com/python/importlib_resources/pull/339/files#diff-8450e5a7408c175083d3bd549d279e9dfb23eb118e6515a51a483021520c450f
https://github.com/python/importlib_resources/pull/339/files#diff-8450e5a7408c175083d3bd549d279e9dfb23eb118e6515a51a483021520c450f
https://github.com/python/importlib_resources/pull/339/files#diff-8450e5a7408c175083d3bd549d279e9dfb23eb118e6515a51a483021520c450f
https://github.com/python/importlib_resources/pull/339/files#diff-8450e5a7408c175083d3bd549d279e9dfb23eb118e6515a51a483021520c450f
importlib_resources/tests/test_simple.pyhttps://github.com/python/importlib_resources/pull/339/files#diff-eecfe37c7571dffefe5f584a174dee9b3dff3defb9e740f3a28a108f617a7035
View file https://github.com/python/importlib_resources/blob/e8c776d586816cd81012a96362f860fee7f379b3/importlib_resources/tests/test_simple.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/importlib_resources/pull/339/{{ revealButtonHref }}
newsfragments/+simple-reader-adapter.bugfix.rsthttps://github.com/python/importlib_resources/pull/339/files#diff-f16df115ff7574f011022e638537bda2010b316840c750b84e45026c0d8eab4d
View file https://github.com/python/importlib_resources/blob/e8c776d586816cd81012a96362f860fee7f379b3/newsfragments/%2Bsimple-reader-adapter.bugfix.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/importlib_resources/pull/339/{{ revealButtonHref }}
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.