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

a year 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)

a year ago

Log in to comment on this ticket.

Metadata