Handle str in pynvim NvimError#194
Open
munyari wants to merge 1 commit into
Open
Conversation
I received the following error message running neovim-remote:
```
Traceback (most recent call last):
File "/nix/store/0ww738gzzxz5gnfla3bdmpfsp85y4s51-neovim-remote-2.5.1/lib/python3.10/site-packages/nvr/nvr.py", line 138, in execute
self.fnameescaped_command(cmd, fname)
File "/nix/store/0ww738gzzxz5gnfla3bdmpfsp85y4s51-neovim-remote-2.5.1/lib/python3.10/site-packages/nvr/nvr.py", line 100, in fnameescaped_command
self.server.command(f'{cmd} {path}')
File "/nix/store/flbgc27pg2zy7dy405pfg59lncd7lna0-python3.10-pynvim-0.4.3/lib/python3.10/site-packages/pynvim/api/nvim.py", line 287, in command
return self.request('nvim_command', string, **kwargs)
File "/nix/store/flbgc27pg2zy7dy405pfg59lncd7lna0-python3.10-pynvim-0.4.3/lib/python3.10/site-packages/pynvim/api/nvim.py", line 182, in request
res = self._session.request(name, *args, **kwargs)
File "/nix/store/flbgc27pg2zy7dy405pfg59lncd7lna0-python3.10-pynvim-0.4.3/lib/python3.10/site-packages/pynvim/msgpack_rpc/session.py", line 102, in request
raise self.error_wrapper(err)
pynvim.api.common.NvimError: BufReadPost Autocommands for "*": Vim(append):Error executing lua callback: ...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:21: Error executing lua: ...6-n>
for language php
stack traceback:
[C]: in function '_ts_parse_query'
...ed-0.9.1/share/nvim/runtime/lua/vim/treesitter/query.lua:259: in function 'get'
...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:110: in function 'new'
...nwrapped-0.9.1/share/nvim/runtime/lua/vim/treesitter.lua:61: in function '_create_parser'
...nwrapped-0.9.1/share/nvim/runtime/lua/vim/treesitter.lua:131: in function 'get_parser'
...nwrapped-0.9.1/share/nvim/runtime/lua/vim/treesitter.lua:459: in function 'start'
.../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:20: in function 'attach'
...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:509: in function 'attach_module'
...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:532: in function 'reattach_module'
...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:133: in function <...es/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:132>
[C]: in function 'nvim_cmd'
...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:22: in function <...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:21>
[C]: in function 'nvim_buf_call'
...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:21: in function <...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function 'nvim_cmd'
...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:22: in function <...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:21>
[C]: in function 'nvim_buf_call'
...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:21: in function <...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:10>
stack traceback:
[C]: in function 'nvim_buf_call'
...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:21: in function <...6-neovim-unwrapped-0.9.1/share/nvim/runtime/filetype.lua:10>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/nix/store/0ww738gzzxz5gnfla3bdmpfsp85y4s51-neovim-remote-2.5.1/bin/.nvr-wrapped", line 9, in <module>
sys.exit(main())
File "/nix/store/0ww738gzzxz5gnfla3bdmpfsp85y4s51-neovim-remote-2.5.1/lib/python3.10/site-packages/nvr/nvr.py", line 444, in main
proceed_after_attach(nvr, options, arguments)
File "/nix/store/0ww738gzzxz5gnfla3bdmpfsp85y4s51-neovim-remote-2.5.1/lib/python3.10/site-packages/nvr/nvr.py", line 463, in proceed_after_attach
nvr.execute(options.remote_wait + arguments, 'edit', wait=True)
File "/nix/store/0ww738gzzxz5gnfla3bdmpfsp85y4s51-neovim-remote-2.5.1/lib/python3.10/site-packages/nvr/nvr.py", line 140, in execute
if not re.search('E37', e.args[0].decode()):
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
```
Looks like this can be a str, so this change handles that case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I received the following error message running neovim-remote:
Looks like this can be a str, so this change handles that case.