Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.95k stars 295 forks source link

Error, When open lua file. TypeError: __init__() got an unexpected keyword argument 'encoding' #1071

Closed EternalSunLhx closed 4 years ago

EternalSunLhx commented 4 years ago

Problems summary

Environment Information

WX20200219-134135@2x

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

set pyxversion=3
let g:python3_host_prog = "/usr/local/bin/python3"

call plug#begin('~/.vim/myplug')
Plug 'vim-scripts/genutils'
Plug 'junegunn/fzf', { 'dir': '~/.vim/github/fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'rking/ag.vim', { 'do': 'brew install the_silver_searcher' }
Plug 'junegunn/vim-easy-align'
Plug 'vim-airline/vim-airline'
Plug 'jiangmiao/auto-pairs'
if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc', {'do': 'pip3 install --user pynvim'}
endif
call plug#end()

call deoplete#custom#option('smart_case', v:false)
call deoplete#custom#option('prev_completion_mode', 'mirror')
call deoplete#custom#source('buffer', '_max_lines', 99999)
call deoplete#custom#source('buffer', '_limit', 9999999)
call deoplete#custom#var('buffer', 'require_same_filetype', v:false)
call deoplete#custom#var('around', {
        \   'range_above': 99999,
        \   'range_below': 99999,
        \   'mark_above': '[↑]',
        \   'mark_below': '[↓]',
        \   'mark_changes': '[*]',
        \})
call deoplete#custom#option('sources', {
        \ '_': ['buffer', 'member', 'around'],
        \ 'cpp': ['buffer', 'tag'],
        \})

let g:deoplete#enable_at_startup = 1

How to reproduce the problem from neovim/Vim startup (Required!)

  1. vim test.lua
  2. type o
  3. then Throw Error

Screenshot (if possible)

WX20200219-132007@2x WX20200219-133726@2x
benbooth493 commented 4 years ago

I'm having the same issue entering INSERT mode.

arponero commented 4 years ago

Yep, same problem here, just after entering insert mode too.

OS: MacOS High Sierra 10.13.6

nvim --version

NVIM v0.3.8
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/clang -pipe -Os -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto
-DINCLUDE_GENERATED_DECLARATIONS -DNVIM_UNIBI_HAS_VAR_FROM -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/config -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/
neovim/work/neovim-0.3.8/src -I/opt/local/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/src/nvim/auto -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/ne
ovim/work/build/include
Compiled by macports@highsierra.internal.macports.net

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/local/share/nvim"

This is the error:

error caught in async handler 'deoplete_on_event [{'rpc': 'deoplete_on_event', 'event': 'InsertEnter', 'sources': []}]'
Traceback (most recent call last):
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/__init__.py", line 51, in on_event
    self._deoplete.on_event(context)
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 132, in on_event
    self.init_context()
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 68, in init_context
    self.on_event(context)
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 143, in on_event
    self._check_recache(context)
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 281, in _check_recache
    self._load_sources(context)
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 255, in _load_sources
    self._add_parent(deoplete.parent.AsyncParent)
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/deoplete.py", line 216, in _add_parent
    parent = parent_cls(self._vim)
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/parent.py", line 32, in __init__
    self._start_process()
  File "/Users/jgr/.config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/parent.py", line 123, in _start_process
    unicode_errors='surrogateescape')
  File "msgpack/_packer.pyx", line 118, in msgpack._cmsgpack.Packer.__init__
TypeError: __init__() got an unexpected keyword argument 'encoding'
Shougo commented 4 years ago

It is already known issue. Please use https://github.com/Shougo/deoplete.nvim/pull/1070 instead.

Shougo commented 4 years ago

Fixed by #1070.

lewisdiamond commented 4 years ago

Is this really fixed by #1070 ? I think the cause of the error (here at least) is that msgpack was upgraded to 1.0.0 before deoplete.

If anyone else comes here, just run :call dein#update()

Shougo commented 4 years ago

Is this really fixed by #1070 ?

Yes. I think you have not updated deoplete.

MWers commented 4 years ago

Echoing @Shougo's question, I received the TypeError: __init__() got an unexpected keyword argument 'encoding' error when running an old version of deoplete (sha https://github.com/Shougo/deoplete.nvim/commit/bb2b163) with msgpack 1.0.0. If anyone finds this thread by searching for the error message above and initially thinks "but I'm running the correct version of msgpack", make sure your deoplete is recent. 😄

OJFord commented 4 years ago

@Shougo The latest tag (5.2) is before this fix, have you intended to stop tagging releases, or just not done yet? Cheers.

Shougo commented 4 years ago

OK. I have released 6.0 version.

OJFord commented 4 years ago

Many thanks!

edebrouwer commented 2 years ago

I'm still having the same error (when intering insert mode) after trying all of the above.

NVIM version : v0.5.0 msgpack = 1.0.2

:checkhealth gives all OK on deoplete.vim

Any idea what could be the issue ?

Shougo commented 2 years ago

Really? I don't know why. It should work.

But deoplete is deprecated now. I don't want to support it anymore. Please use ddc.vim instead.

https://github.com/Shougo/ddc.vim