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

Created on 19 Feb 2020  路  10Comments  路  Source: Shougo/deoplete.nvim

Problems summary

Environment Information

  • deoplete version (SHA1):

  • OS: macOS Catalina (10.15.3)

  • neovim/Vim :version output:

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

Most helpful comment

I'm having the same issue entering INSERT mode.

All 10 comments

I'm having the same issue entering INSERT mode.

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 [email protected]

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'

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

Fixed by #1070.

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()

Is this really fixed by #1070 ?

Yes. I think you have not updated deoplete.

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. 馃槃

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

OK. I have released 6.0 version.

Many thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zundrium picture Zundrium  路  6Comments

iscekic picture iscekic  路  6Comments

callmekohei picture callmekohei  路  5Comments

marcus picture marcus  路  6Comments

markers16123 picture markers16123  路  3Comments