Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins do not start when run on python 3.12 #376

Open
olivier-van-wijngaarden opened this issue Oct 11, 2024 · 1 comment
Open

Plugins do not start when run on python 3.12 #376

olivier-van-wijngaarden opened this issue Oct 11, 2024 · 1 comment

Comments

@olivier-van-wijngaarden

Recently I upgrade my laptop to Ubuntu 24.4 . The default python version I have now is 3.12. Since the upgrade AvNav failed to start.
The root cause seemed to be in pluginhandler.py. This uses the python imp module. This module was already deprecated a few versions ago, but since 3.12 it have been removed. From the imp module it uses only load_sources().
I replaced it as decribred below (inspired from https://devcodef1.com/news/1027645/replacing-imp-load-source-in-python-3-12), which worked for me:

< import imp

import importlib
657c657,659
< rt = imp.load_source(name, moduleFile)


  spec = importlib.util.spec_from_file_location(name, moduleFile)
  module = importlib.util.module_from_spec(spec)
  spec.loader.exec_module(module)

659c661
< return rt

  return module

@wellenvogel
Copy link
Owner

Thanks a lot for bringing this up.
We did not test on ubuntu 24.4 until now - but having a more future proof solution will be great.

wellenvogel pushed a commit that referenced this issue Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants