Skip to content

Conversation

@graingert
Copy link
Contributor

@graingertgraingert commented Jan 15, 2025

@graingertgraingert changed the title fix ResourceLoader deprecation warninggh-128007: fix ResourceLoader deprecation warningJan 15, 2025
@graingertgraingert changed the title gh-128007: fix ResourceLoader deprecation warninggh-121604: fix ResourceLoader deprecation warningJan 15, 2025
@graingertgraingert marked this pull request as ready for review January 15, 2025 10:33
@graingertgraingert changed the title gh-121604: fix ResourceLoader deprecation warninggh-121604: fix ResourceLoader deprecation warning messageJan 15, 2025
Comment on lines 308 to 310
Loaders that wish to support resource reading should implement a
:meth:`get_resource_reader` method as specified by
:class:`importlib.resources.abc.ResourceReader`.
:class:`importlib.resources.abc.TraversableResources`.

Choose a reason for hiding this comment

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

No, it is documented in the importlib.resources.abc.ResourceReader description.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

But ResourceReader is scheduled for removal in 3.14

Choose a reason for hiding this comment

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

When ResourceReader has been removed, the documentation of its methods and of get_resource_reader() should be moved to the TraversableResources description. For now, get_resource_reader() is described with ResourceReader, and the code that implements get_resource_reader() returning ResourceReader still works (but emits a warning).

Copy link
Member

@tomasr8tomasr8Jan 15, 2025

Choose a reason for hiding this comment

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

Not anymore, see the later comments in #97850

(Responding to Thomas' comment)

@brettcannonbrettcannon enabled auto-merge (squash) January 15, 2025 20:48
@brettcannonbrettcannon merged commit d05140f into python:mainJan 15, 2025
36 checks passed
@graingertgraingert deleted the fix-deprecation-warning branch March 20, 2025 16:30
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@graingert@serhiy-storchaka@tomasr8@brettcannon