pynvim icon indicating copy to clipboard operation
pynvim copied to clipboard

imp module is deprecated

Open Shougo opened this issue 3 years ago • 3 comments

../../.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.

Shougo avatar Jan 31 '21 10:01 Shougo

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

kkirsche avatar Jun 23 '21 19:06 kkirsche

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

Shougo avatar Jun 24 '21 02:06 Shougo

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

Shougo avatar Jun 24 '21 02:06 Shougo

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 avatar Jul 14 '23 16:07 michel-slm

@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

michel-slm avatar Jul 14 '23 16:07 michel-slm

@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 :)

justinmk avatar Jul 14 '23 17:07 justinmk

@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 avatar Jul 14 '23 21:07 michel-slm

@justinmk let's continue this in #528

michel-slm avatar Jul 14 '23 21:07 michel-slm