ultisnips icon indicating copy to clipboard operation
ultisnips copied to clipboard

Unrecognized UltiSnips issue with Python 3.10.5

Open reteehee opened this issue 2 years ago • 2 comments

Expected behavior:

I'm not sure if this is UltiSnips issue or my (maybe broken) vim/python installation, because it running well before I upgraded my python from 3.6 to 3.10.5. Actually, some of the other vim plugins I use also.

Actual behavior:

When I begin Insert mode it throwing this error:

Error detected while processing InsertCharPre Autocommands for "*"..function UltiSnips#TrackChange:
line    1:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing InsertCharPre Autocommands for "*"..function UltiSnips#TrackChange:
line    1:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue

again and again every time I hit any key.

Steps to reproduce

I don't know where to start debug here, but here is the things I do before (hope it help):

  1. I install the latest python 3.10 with this setup: ./configure --enable-optimizations --with-ensurepip --with-doc-strings.
  2. Rebuild my vim with this setup: ./configure --with-features=huge --enable-fail-if-missing --enable-multibyte --enable-terminal --enable-python3interp --with-python3-command=python3.10 --with-python-config-dir=/usr/local/lib/python3.10/config-3.10-x86_64-linux-gnu

  • Operating System: openSUSE leap 15.3
  • Vim Version: VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 8 2022 13:35:21) Included patches: 1-5066
  • UltiSnips Version: Latest, maybe. I update it with :PlugUpdate by plug.vim.
  • Python inside Vim: 3.10.5.
  • Docker repo/vimrc:

reteehee avatar Jun 08 '22 12:06 reteehee

Also hitting this, tried a bit to debug it, and checked that it was not the same at #469 (for me echo has('python') shows 0 while echo has('python3') shows 1), but really not getting very far, as far as i can tell UltiSnips_Manager is not declared in the functions that call for it, but can't understand why, it's usually imported/declared at the top in the modules using it, and i couldn't debug it from a python shell, as it can't be imported without access to the vim module.

tshirtman avatar Jul 29 '22 14:07 tshirtman

using :py3 from UltiSnips import UltiSnips_Manager allowed me to see the actual error, which was undefined symbol: PyTuple_Type

This lead me to see more people with similar issues, like https://github.com/vim/vim/issues/2925 Though that solution wasn't enough for me, but looking around more, i found https://allanchain.github.io/blog/post/compile-vim-python3/

indicating about the issue there as well https://github.com/vim/vim/issues/5509#issuecomment-650468467

so i rebuilt my vim against the pyenv python version using

make distclean
env LDFLAGS=-rdynamic ./configure --prefix ~/.local/ --with-python3-command="$HOME/.pyenv/versions/3.10.4/bin/python3.10" --enable-python3interp=yes --with-python3-config-dir=$HOME/.pyenv/versions/3.10.4/lib/python3.10/config-3.10-x86_64-linux-gnu/
make install

And now i can use ultisnips again \o/.

So to me, it's not really a ultisnips issue, but an issue with the vim build, that about any python plugin is likely to break upon.

tshirtman avatar Aug 05 '22 16:08 tshirtman