Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missed stream argument #111775

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add missed stream argument #111775

wants to merge 2 commits into from

Conversation

shadchin
Copy link
Contributor

@shadchin shadchin commented Nov 6, 2023

No description provided.

@gaogaotiantian
Copy link
Contributor

This issue has been there since day 1 and no one finds it in 2 years. It's not documented and it's not used internally. Is this just dead code @jaraco ?

@jaraco
Copy link
Member

jaraco commented Nov 7, 2023

Thanks @gaogaotiantian for tracking down the origin of the issue. Although that's day 1 for this class, the code is derived from resources.py in that commit.

In the upstream implementation (which probably has better fidelity of the history of this change), that file is skipped for coverage checks. That module was provided as an illustration of the lowest level interfaces required to supply TraversableResources. It's entirely conceivable that no one has made use of them. This code was made in response to python/importlib_resources#90.

If we accept this change (and we probably should), we'll want to make sure it gets ported upstream.

@jaraco
Copy link
Member

jaraco commented Nov 7, 2023

I've cherry-picked this change into python/importlib_resources and released it as 6.1.1. This change will make it into CPython in due time. If you want to author a news fragment, I'll merge this change.

@jaraco jaraco added skip issue needs backport to 3.11 bug and security fixes needs backport to 3.12 bug and security fixes labels Nov 7, 2023
jaraco
jaraco previously requested changes Nov 7, 2023
Copy link
Member

@jaraco jaraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a news fragment, but otherwise looks good.

@bedevere-app
Copy link

bedevere-app bot commented Nov 7, 2023

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@gaogaotiantian
Copy link
Contributor

My question is, if no one has used this piece of code for 2 years and it's not documented at all, do we still need it in CPython repo?

@jaraco
Copy link
Member

jaraco commented Nov 7, 2023

My question is, if no one has used this piece of code for 2 years and it's not documented at all, do we still need it in CPython repo?

Probably not, but to remove it will require a deprecation and we'll want to present that deprecation first in importlib_resources. Feel free to propose that there. In the meantime, it makes sense to merge the bugfix.

@gaogaotiantian
Copy link
Contributor

Oh, I thought removing code that we never documented does not require anything. But yeah, the fix itself definitely makes sense.

@shadchin
Copy link
Contributor Author

shadchin commented Nov 7, 2023

I have made the requested changes; please review again

@shadchin
Copy link
Contributor Author

Is something required of me here?

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Dec 14, 2023
…29224

https://build.opensuse.org/request/show/1129224
by user dirkmueller + anag+factory
- update to 6.1.1:
  * Added missed stream argument in simple.ResourceHandle. Ref
    python/cpython#111775.
  * MultiplexedPath now expects Traversable paths. String
    arguments to MultiplexedPath are now deprecated.
  * Enabled support for resources in namespace packages in zip
    files. (#287)

- Update to v5.10.1
  * #259: files no longer requires the anchor to be specified and can infer the anchor from the caller's scope (defaults to the caller's module).
  * bpo-41490: contents is now also more aggressive about consuming
  * #110 and bpo-41490: path method is more aggressive about
    releasing handles to zipfile objects early, enabling use-cases
    like certifi to leave the context open but delete the
  * Package no longer exposes importlib_resources.__version__.
    Users that w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants