getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.6k stars 444 forks source link

Support Python 3.12 #3719

Closed martin-ueding closed 7 months ago

martin-ueding commented 9 months ago

I think that Nikola hasn't yet been updated to Python 3.12. This is now the default Python interpreter on Fedora 39 and I'd be happy to use Nikola with the default interpreter.

Environment

Python Version: 3.12.0

Nikola Version: 8.2.4

Operating System: Fedora 39

Description:

When launching Nikola, there are import errors coming from a deprecation of some importlib/imp things.

❯ nikola
Traceback (most recent call last):
  File "/home/mu/.local/lib/python3.12/site-packages/yapsy/PluginManager.py", line 132, in <module>
    import importlib.abc.Loader as imp
ModuleNotFoundError: No module named 'importlib.abc.Loader'; 'importlib.abc' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mu/.local/bin/nikola", line 5, in <module>
    from nikola.__main__ import main
  File "/home/mu/.local/lib/python3.12/site-packages/nikola/__init__.py", line 39, in <module>
    from .nikola import Nikola  # NOQA
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mu/.local/lib/python3.12/site-packages/nikola/nikola.py", line 49, in <module>
    from yapsy.PluginManager import PluginManager
  File "/home/mu/.local/lib/python3.12/site-packages/yapsy/PluginManager.py", line 134, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
felixfontein commented 9 months ago

The problem here is yapsy, which Nikola uses as a plugin library. It had its last release in 2019. Here's a corresponding issue: https://github.com/tibonihoo/yapsy/issues/16