Skip to content

gh-121604: fix ResourceLoader deprecation warning message - #128859

Merged
brettcannon merged 5 commits into
python:mainfrom
graingert:fix-deprecation-warning
Jan 15, 2025
Merged

gh-121604: fix ResourceLoader deprecation warning message#128859
brettcannon merged 5 commits into
python:mainfrom
graingert:fix-deprecation-warning

Conversation

@graingert

@graingertgraingert commented Jan 15, 2025

Copy link
Copy Markdown
Contributor

@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
@graingert
graingert 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 threadDoc/library/importlib.rst Outdated
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`.

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Copy link
Copy Markdown
Member

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).

@tomasr8tomasr8Jan 15, 2025

Copy link
Copy Markdown
Member

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)

@brettcannon
brettcannon enabled auto-merge (squash) January 15, 2025 20:48
@brettcannon
brettcannon merged commit d05140f into python:mainJan 15, 2025
@graingert
graingert 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