diff --git a/README.md b/README.md index d7cce53e6..b14efd9f5 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,10 @@ not fixed anymore Denite requires Neovim 0.3.0+ or Vim 8.0+ with `if_python3`. If `:echo has("python3")` returns `1`, then you're done. -Note: You need to install Python3.6.1+. +Note: Please install/upgrade msgpack package (1.0.0+). +https://github.com/msgpack/msgpack-python + +Note: You need to install Python 3.6.1+. For neovim: diff --git a/autoload/denite/init.vim b/autoload/denite/init.vim index c1ef9eb72..2f31e029f 100644 --- a/autoload/denite/init.vim +++ b/autoload/denite/init.vim @@ -55,6 +55,10 @@ function! denite#init#_initialize() abort call denite#util#print_error(v:exception) call denite#util#print_error(v:throwpoint) + if !denite#init#_msgpack_version_check() + call denite#util#print_error('denite requires msgpack 1.0.0+.') + endif + if denite#util#has_yarp() if !has('nvim') && !exists('*neovim_rpc#serveraddr') call denite#util#print_error( @@ -160,3 +164,12 @@ vim.vars['denite#_python_version_check'] = ( EOF return g:denite#_python_version_check endfunction + +function! denite#init#_msgpack_version_check() abort + python3 << EOF +import vim +import msgpack +vim.vars['denite#_msgpack_version_check'] = msgpack.version < (1, 0, 0) +EOF + return get(g:, 'denite#_msgpack_version_check', 0) +endfunction diff --git a/autoload/health/denite.vim b/autoload/health/denite.vim index 0f79aada7..1f36eb3c0 100644 --- a/autoload/health/denite.vim +++ b/autoload/health/denite.vim @@ -12,11 +12,21 @@ function! s:check_required_python() abort endif if !denite#init#_python_version_check() - call health#report_ok('Python3.6.1+ was successful') + call health#report_ok('Python 3.6.1+ was successful') else call health#report_error( - \ 'Python3.6.1+ was not successful', - \ 'Please use Python3.6.1+.') + \ 'Python 3.6.1+ was not successful', + \ 'Please use Python 3.6.1+.') + endif +endfunction + +function! s:check_required_msgpack() abort + if !denite#init#_msgpack_version_check() + call health#report_ok('Require msgpack 1.0.0+ was successful') + else + call health#report_error( + \ 'Require msgpack 1.0.0+ was not successful', + \ 'Please install/upgrade msgpack 1.0.0+.') endif endfunction @@ -24,4 +34,5 @@ function! health#denite#check() abort call health#report_start('denite.nvim') call s:check_required_python() + call s:check_required_msgpack() endfunction diff --git a/doc/denite.txt b/doc/denite.txt index e9827d107..4669d32c9 100644 --- a/doc/denite.txt +++ b/doc/denite.txt @@ -1,6 +1,6 @@ *denite.txt* Dark powered asynchronous unite all interfaces for NeoVim/Vim. -Version: 3.1 +Version: 3.2 Author: Shougo License: MIT license @@ -86,7 +86,10 @@ INSTALL *denite-install* Note: denite requires Neovim 0.3.0+ or Vim 8.0+ with |:python3| enabled. -Note: You need to install Python3.6.1+. +Note: Please install/upgrade msgpack package (1.0.0+). +https://github.com/msgpack/msgpack-python + +Note: You need to install Python 3.6.1+. For neovim: @@ -2059,6 +2062,10 @@ A: ============================================================================== COMPATIBILITY *denite-compatibility* +2020.02.19 +* msgpack 1.0.0+ is required +https://github.com/msgpack/msgpack-python#major-breaking-changes-in-msgpack-10 + 2020.02.17 * Rename "-previewheight" option to "-preview-height". diff --git a/rplugin/python3/denite/child.py b/rplugin/python3/denite/child.py index 971f54e1b..eee6d65e6 100644 --- a/rplugin/python3/denite/child.py +++ b/rplugin/python3/denite/child.py @@ -34,11 +34,9 @@ def __init__(self, vim: Nvim) -> None: self._runtimepath = '' self._current_sources: typing.List[typing.Any] = [] self._unpacker = msgpack.Unpacker( - encoding='utf-8', unicode_errors='surrogateescape') self._packer = msgpack.Packer( use_bin_type=True, - encoding='utf-8', unicode_errors='surrogateescape') def main_loop(self, stdout: typing.Any) -> None: diff --git a/rplugin/python3/denite/parent.py b/rplugin/python3/denite/parent.py index e462e0396..7eaf05b28 100644 --- a/rplugin/python3/denite/parent.py +++ b/rplugin/python3/denite/parent.py @@ -92,10 +92,8 @@ def _start_process(self) -> None: self._queue_out: Queue[str] = Queue() self._packer = msgpack.Packer( use_bin_type=True, - encoding='utf-8', unicode_errors='surrogateescape') self._unpacker = msgpack.Unpacker( - encoding='utf-8', unicode_errors='surrogateescape') info = None