question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 18260: illegal

See original GitHub issue

neoclide/coc.nvim#1828 Before i through is Coc.nvim problem but now look like it’s vim-snippets

Describe the bug

OS : window10 Neovim: 0.4.3 i check again the CocInfo it’t return different message

CocInfo


Output channel: Python

Starting Jedi Python language engine.

Output channel: snippets

[Info 17:39:57] Using ultisnips directories: UltiSnips E:\spacemacs\emacs26-3\AppData\Local\coc\ultisnips [Info 17:39:58] Using ultisnips python command: pyx Error on execute python script: request error nvim_command - Vim(return):Error invoking ‘python_execute_file’ on channel 4 (python3-script-host): error caught in request handler ‘python_execute_file [‘C:\Users\ADMINI~1\AppData\Local\Temp\coc.nvim-6652\coc-ultisnips-KLQQlwM_rh.py’, 1, 1]’: Traceback (most recent call last): File “E:\python\python3.8.1\lib\site-packages\pynvim\plugin\script_host.py”, line 106, in python_execute_file script = compile(f.read(), file_path, ‘exec’) UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa6 in position 18260: illegal multibyte sequence


init.vim


Plug 'neoclide/coc.nvim',{'branch':'release'}

inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? "\<TAB>" :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"



" Snippet
" Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'

Try

I thought it’s cmd default encoding problem so change to utf-8 but don’t work

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
Shougocommented, May 1, 2020

maybe we can show a better error. But supporting non-utf8 file for python_execute_file does not seem like something we should do.

If so, open(encoding='utf-8') should be used instead. And to add the documentation.

Note: I don’t know what pyfile supports encodings in Vim8.

0reactions
Shougocommented, Feb 25, 2021

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gbk' codec can't decode byte 0x80 in position 0 illegal ...
The wrong message became UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte . The message finally points ...
Read more >
chromium build failed on WIN10 - Google Groups
1>UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 574576: illegal multibyte sequence.
Read more >
Python中读取txt文本出现“ 'gbk' codec can't decode byte 0xbf in ...
在读取Walden.txt文本时,出现了“UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence”错误提示。
Read more >
Win10 build error: UnicodeDecodeError: 'gbk' codec can't ...
Followed the tutorial step by step, can't pass this one, tried several ... 'gbk' codec can't decode byte 0x91 in position 213854: illegal...
Read more >
'gbk' codec can't decode byte 0x80 in position 205 ... - 博客园
python读取文件时提示"UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence". 解决办法1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found