#9437 ImportWarning: IpaMetaImporter.find_spec() not found; falling back to find_module()
Closed: fixed 10 months ago by frenaud. Opened 11 months ago 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

10 months ago

master:

  • 7ddf771 Use find_spec() in meta importer

ipa-4-11:

  • bc9385d Use find_spec() in meta importer

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

10 months ago

Log in to comment on this ticket.

Metadata