Repository navigation
importlib.abc.SourceLoader issues DeprecationWarning because it inherits from ResourceLoader #137426
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Aug 5, 2025 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Aug 5, 2025 - added3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes
on Aug 8, 2025 - Is this to be considered a bug? Or is
SourceLoadersupposed to be deprecated too?
It's a bug in so much as
SourceLoaderisn't deprecated.- If the former, how can it be fixed?
One option is for
SourceLoaderto stop inheriting fromResourceLoaderand copy over the abstract method from it (as well as update the docstring and documentation).What I'm wondering about, though, is why didn't the tests catch this?
- Is this to be considered a bug? Or is
@hugovk not sure if this should be a release blocker, made it one just in case since the fix might be annoying in a point release if we change the inheritance structure.
I found my mistake: I merged 27494dd probably thinking the warning suppression was for tests of
ResourceLoaderinstead ofSourceLoader.Another option is to drop the warning on
ResourceLoadersince it has no removal date and it isn't hurting anything having it there.#137567 reverts the deprecation of
ResourceLoaderif that's the direction we choose to go.Reacted by Petr Viktorin- added a commit that references this issue
on Aug 11, 2025 This is now merged into
mainand awaiting Hugo to cherrypick into 3.14.Reacted by Terence TsangThanks for the fix!
- added a commit that references this issue
on Aug 12, 2025 Makes sense for this to be done for 3.14.0 and not 3.14.1, thanks all!
- moved this from Todo to Done in Release and Deferred blockers 🚫
on Aug 12, 2025 @TTsangSC and thanks for testing the RC and reporting the bug!
Reacted by Terence Tsang and Hugo van Kemenade- added a commit that references this issue
on Aug 12, 2025
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
Problem
importlib.abc.SourceLoaderitself does not seem to be deprecated as far as the docs go, either in 3.14 or 3.15.importlib.abc.ResourceLoader, aDeprecationWarningis issued at instantiation time since 3.14.Example
Questions
SourceLoadersupposed to be deprecated too?Possibly related issues
#89710, #121604
CPython versions tested on:
3.14
Operating systems tested on:
macOS
Linked PRs
importlib.abc.ResourceLoader#137567importlib.abc.ResourceLoader(GH-137567) #137654