Closed roxma closed 5 years ago
I think .encode()
is not need.
When trying to access .name
, PyUnicode_Decode()
is called in if_python3 and if it succeeds we can actually access .name
, or if fails we catch UnicodeDecodeError
(thrown from if_python3).
Therefore if we can access .name
then .encode()
will succeed.
It's not needed for python3. But python2 needs this to raise an exception.
Python2 does not raise an error since .name
is str type; treated as simply byte sequence.
Python2 does not raise an error since .name is str type; treated as simply byte sequence.
Yeah. This plugin running as a server, and it allows to use python2. Howver, if the invalid utf8 byte sequence is sent to python3 client, a wired exception would be raised on the client side.
I indeed have this issue in deoplete in vim8. Cfr. my misplaced bug report at https://github.com/neovim/pynvim/issues/371, I believe your pull relieves this issue.
https://github.com/roxma/nvim-yarp/issues/18#issuecomment-442735631
@ichizok Please test this pr