gh-145260: fix(importlib.resources.simple): Make ResourceContainer and ResourceH…#145263
Open
zetzschest wants to merge 4 commits intopython:mainfrom
Open
gh-145260: fix(importlib.resources.simple): Make ResourceContainer and ResourceH…#145263zetzschest wants to merge 4 commits intopython:mainfrom
zetzschest wants to merge 4 commits intopython:mainfrom
Conversation
… ResourceHandle ResourceContainer and ResourceHandle could not be instantiated because Traversable now requires name as an abstract property. Additionally, ResourceContainer.iterdir() accessed self.reader.resources without calling it, and ResourceHandle.joinpath had a signature mismatch. - Add name property to ResourceContainer - Fix self.reader.resources -> self.reader.resources() call - Add iterdir() method to ResourceHandle - Fix ResourceHandle.joinpath to accept *descendants
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ResourceContainerandResourceHandlecannot be instantiated becauseTraversablenow requiresnameas an abstract property. Also,iterdir()accessesself.reader.resourceswithout calling it, andResourceHandle.joinpathhas a signature mismatch.Reproducer
Fix
nameproperty toResourceContainerandResourceHandleiterdirtoResourceHandleself.reader.resources→self.reader.resources()inResourceContainer.iterdir()ResourceHandle.joinpathto accept*descendants