Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when Neovim raises an error when opening a file #189

Open
joshbode opened this issue Jun 1, 2023 · 0 comments · May be fixed by #190
Open

Error when Neovim raises an error when opening a file #189

joshbode opened this issue Jun 1, 2023 · 0 comments · May be fixed by #190

Comments

@joshbode
Copy link

joshbode commented Jun 1, 2023

It appears that nvr assumes that the argument to the exception raised by pynvim is of type bytes, however (recently?) is is of type str.

$ nvr ~/.profile
Traceback (most recent call last):
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/site-packages/nvr/nvr.py", line 138, in execute
    self.fnameescaped_command(cmd, fname)
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/site-packages/nvr/nvr.py", line 100, in fnameescaped_command
    self.server.command(f'{cmd} {path}')
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/site-packages/pynvim/api/nvim.py", line 287, in command
    return self.request('nvim_command', string, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/site-packages/pynvim/api/nvim.py", line 182, in request
    res = self._session.request(name, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/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: XXX
stack traceback:
        [builtin#19]: at 0x7fa8258539a0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/josh/.local/share/pipx/bin/nvr", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/site-packages/nvr/nvr.py", line 444, in main
    proceed_after_attach(nvr, options, arguments)
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/site-packages/nvr/nvr.py", line 528, in proceed_after_attach
    nvr.execute(arguments, 'edit', silent=True)
  File "/home/josh/.local/share/pipx/venvs/neovim-remote/lib/python3.11/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'?

Versions:

$ python --version
Python 3.11.3

$ python -m pip list
Package       Version
------------- -------
greenlet      2.0.2
msgpack       1.0.5
neovim-remote 2.5.1
pip           23.1.2
psutil        5.9.5
pynvim        0.4.3
setuptools    67.8.0
wheel         0.40.0

Also affects Python 3.9 and 3.10

@joshbode joshbode linked a pull request Jun 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant