Ultisnips: unicode is not defined error in python3

Created on 20 Jan 2017  路  11Comments  路  Source: SirVer/ultisnips

Since commit 69574e77607d4dcecf0d705449b31540c41c0221, the plugin does not work anymore in vim with python3. When typing, the following error is shown (paths truncated for privacy).

`An error occured. This is either a bug in UltiSnips or a bug in a
snippet definition. If you think this is a bug, please report it to
https://github.com/SirVer/ultisnips/issues/new.

Following is the full stack trace:
Traceback (most recent call last):
File "/UltiSnips/err_to_scratch_buffer.py", line 16, in wrapper
return func(self, args, *kwds)
File "UltiSnips/snippet_manager.py", line 839, in _track_change
if not isinstance(inserted_char, unicode):
NameError: name 'unicode' is not defined `

I guess it is related to this: http://stackoverflow.com/questions/19877306/nameerror-global-name-unicode-is-not-defined-in-python-3#19877309

Most helpful comment

Good. Sorry for trouble.

All 11 comments

A screenshot for some of the errors shown

screen shot 2017-01-20 at 10 11 20

@bartlibert, @ahmedelgabri: sorry about that. Can you try latest master?

I have this in neovim today as well

Following is the full stack trace:
Traceback (most recent call last):
  File "/home/rob/.config/nvim/plugged/ultisnips/pythonx/UltiSnips/err_to_scratch_buffer.py", line 16, in wrapper
    return func(self, *args, **kwds)
  File "/home/rob/.config/nvim/plugged/ultisnips/pythonx/UltiSnips/snippet_manager.py", line 839, in _track_change
    if not isinstance(inserted_char, unicode):
NameError: name 'unicode' is not defined

Neovim, latest master, the same error.

I have both py and py3 configured, and I suppose plugin uses py2 by default, so your fix with if sys.version_info doesn't fix this.

UPD it works now, thanks.

@bordeltabernacle: did you tried 7f7058d?

I use vim-plug, this error wasn't fixed with :PlugUpdate but was with git fetch origin master && git merge origin master within .vim/plugged/ultisnips

yep, that's the latest commit I'm on now @seletskiy

@bordeltabernacle: So there is no issue now?

@seletskiy nope, thanks! Not sure why vim-plug didn't update to the latest master.

Fixed for me too. Thanks @seletskiy

Good. Sorry for trouble.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carlitux picture carlitux  路  3Comments

PratikBhusal picture PratikBhusal  路  3Comments

ahmedelgabri picture ahmedelgabri  路  5Comments

Industrial picture Industrial  路  8Comments

kirillbobyrev picture kirillbobyrev  路  4Comments