#9437 ImportWarning: IpaMetaImporter.find_spec() not found; falling back to find_module()
Closed: fixed by frenaud. Opened by cheimes.

Issue

Meta importers without find_spec are deprecated and will no longer work in future versions of Python. The IpaMetaImporter does not implement the new API, only the deprecated API from Python 3.4. This leads to a warning:

ImportWarning: IpaMetaImporter.find_spec() not found; falling back to find_module()

A trivial find_specmethod implementation loads the module and return its spec:

    def find_spec(self, fullname, path=None, target=None):
        """Meta importer hook"""
        if fullname in self.modules:
            module = self.load_module(fullname)
            return module.__spec__
        return None

Metadata Update from @cheimes:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/6984

master:

  • 7ddf7711f32e176c75582f39ed73e9bcd9991d5b Use find_spec() in meta importer

ipa-4-11:

  • bc9385d15cf7a975063754572eb65556a1df9c8a Use find_spec() in meta importer

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata