neovim / pynvim

Python client and plugin host for Nvim
http://pynvim.readthedocs.io/en/latest/
Apache License 2.0
1.48k stars 118 forks source link

imp module is deprecated #478

Closed Shougo closed 11 months ago

Shougo commented 3 years ago
../../.local/lib/python3.9/site-packages/pynvim/compat.py:5
  /home/shougo/.local/lib/python3.9/site-packages/pynvim/compat.py:5: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation
for alternative uses
    from imp import find_module as original_find_module

I think importlib is better.

kkirsche commented 3 years ago

Would a pull request be of interest to the pynvim team?

Shougo commented 3 years ago

The PR is not easy. Because, importlib is not the same function.

Shougo commented 3 years ago

Related changes: https://github.com/neovim/pynvim/pull/461

michel-slm commented 11 months ago

This is now removed from Python 3.12, so pynvim is currently broken for the upcoming Fedora 39 (that will be released this fall circa October-November)

https://bugzilla.redhat.com/show_bug.cgi?id=2220350

is there any blocker to merging #461 - just the loss of Python 2.x compatibility?

michel-slm commented 11 months ago

@justinmk looks like there's some more call sites that are not fixed by #461

  File "/builddir/build/BUILDROOT/python-neovim-0.4.3-10.fc39.x86_64/usr/lib/python3.12/site-packages/p
ynvim/compat.py", line 5, in <module>
    from imp import find_module as original_find_module
ModuleNotFoundError: No module named 'imp'

I'll see if I can get those addressed

justinmk commented 11 months ago

@michel-slm thank you! If you find the time to do that I'll find the time to publish a release here, and revive the CI :)

michel-slm commented 11 months ago

@justinmk the commit you rebased from @Shougo is similar to what I had (but I was trying to get it to apply to 0.4.3 so it looked slightly different). I just switched to using the latest Git master, and on Fedora 38 (Python 3.11) I get an assertion error while on Fedora 39 (Python 3.12) I get more serious errors involving the event loop. Let me file two separate issues for those and we can continue this there.

michel-slm commented 11 months ago

@justinmk let's continue this in #528