# Bug report ### Bug description: Problem --- - `importlib.abc.SourceLoader` itself does not seem to be deprecated as far as the docs go, either in 3.14 or 3.15. - However, since it inherits from the deprecated `importlib.abc.ResourceLoader`, a `DeprecationWarning` is issued at instantiation time since 3.14. Example --- ```python import os import sys import warnings from collections.abc import Iterable from importlib.abc import SourceLoader from importlib.machinery import ModuleSpec from typing import Protocol class FinderLike(Protocol): def find_spec(self, fullname: str) -> ModuleSpec | None: ... class MyLoader(SourceLoader): """Bare-bone `SourceLoader` subclass, only providing implementations for the abstract methods.""" @staticmethod def get_data(path: os.PathLike | str) -> bytes: with open(path, mode='rb') as fobj: return fobj.read() @staticmethod def get_filename(fullname: str, finders: Iterable[FinderLike] | None = None) -> str: if finders is None: finders = ( f for f in sys.meta_path if callable(getattr(f, 'find_spec', None)) if not isinstance(f, MyLoader) # Avoid circular dependence ) for finder in finders: try: spec = finder.find_spec(fullname) if spec is None: raise TypeError except (TypeError, ImportError): continue if spec.origin is not None and os.path.isfile(spec.origin): return str(spec.origin) raise ImportError(f'cannot find filename for `{fullname}`') with warnings.catch_warnings(): warnings.filterwarnings('error', category=DeprecationWarning) loader = MyLoader() # DeprecationWarning: importlib.abc.ResourceLoader is deprecated in favour of supporting resource loading through importlib.resources.abc.TraversableResources. ``` Questions --- - Is this to be considered a bug? Or is `SourceLoader` supposed to be deprecated too? - If the former, how can it be fixed? If the latter, should the docs be updated? Possibly related issues --- #89710, #121604 ### CPython versions tested on: 3.14 ### Operating systems tested on: macOS <!-- gh-linked-prs --> ### Linked PRs * gh-137567 <!-- /gh-linked-prs -->