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
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte #2127
Comments
We're working on this (please see other related issues and PRs) Closing as duplicate. |
Actually, re-opening. This is happening in a place where I wasn't expecting. Could you please post your .vimrc settings related to YCM ? |
if !empty(glob("~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"))
380 let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py"
381 endif
382 " new version
383 if !empty(glob("~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"))
384 let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_c
385 endif
|
I met the same problem on Ubuntu16.04. |
I have a similar problem here:
|
I have the same problem. Here is error info:
I try to debug it, and found:
vimrc: https://github.com/wgwang/.vim/blob/master/vimrc compile ycm command is: |
We have a PR which fixes this. Please feel free to try it out and provide feedback. |
@wgwang Is the command: :py3 vim.eval( 'g:' ) raise the same error? Could you paste the output of |
the attachment is the the output of Use the follow command to get the text:
|
After hours of debugging, I found out the reason of this problem finally. This This is not a bug of YouComplementMe, It actually cause by other plugins. |
Hi. I get the same error ('utf-8' codec can't decode byte 0x80 in position 0) with latest YCM. py3 vim.eval('g:') raise the same error. |
seems like it was variable from Plugin 'kana/vim-textobj-entire' |
@gyermolenko Yes,after diable |
OK, then we can clearly see this is not a YCM issue. |
[READY] Avoid evaluating Vim globals in Python ### Problem See the commit message and issue #2127. ### How to reproduce Make Vim to use Python 3 for YCM by either using Vim with only Python 3 support or by editing the `s:UsingPython2` function in `autoload/youcompleteme.vim` to always return 0. Create the following `vimrc`: ``` set nocompatible set runtimepath+=~/.vim/bundle/YouCompleteMe set encoding=utf8 filetype plugin indent on let g:dummy_variable = '€'[0] ``` and start Vim with it. The following error will occur: ``` YouCompleteMe unavailable: 'utf-8' codec can't decode byte 0xe2 in position 0: unexpected end of data ``` with the traceback in `:messages`: ```python Traceback (most recent call last): File "<string>", line 24, in <module> File "C:\\Users\\micbou\\.vim\\bundle\\YouCompleteMe\\autoload\..\python\ycm\setup.py", line 49, in SetUpYCM base.LoadJsonDefaultsIntoVim() File "C:\\Users\\micbou\\.vim\\bundle\\YouCompleteMe\\autoload\..\python\ycm\base.py", line 60, in LoadJsonDefaultsIntoVim vimsupport.LoadDictIntoVimGlobals( vim_defaults, overwrite = False ) File "C:\\Users\\micbou\\.vim\\bundle\\YouCompleteMe\\autoload\..\python\ycm\vimsupport.py", line 305, in LoadDictIntoVimGlobals extend_option ) ) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 0: unexpected end of data ``` ### Solution Do not evaluate the Vim globals when loading the YCM default options into Vim and when building the options for the ycmd server. Depending on the number of global variables and custom YCM options, this may be slower or faster than the current code but by a negligible margin (~1ms). Fixes #2127 and #2150. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2151) <!-- Reviewable:end -->
Hi, I also get the same error on my Win7 x64 Ultimate, I compiled ycm based on the msys2 and the mingw32-make successfully
_Here is compilation log_
|
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your issue:
[Frequently Asked Questions][faq] section.
about to report and couldn't find an answer to my problem. ([Example Google
search.][search])
vim --version
.:YcmDebugInfo
.:YcmToggleLogs stderr
.version) I am using.
my issue.
that any help I receive is a selfless, heartfelt gift of their free time. I
know I am not entitled to anything and will be polite and courteous.
actually perform all of these steps.
Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
Issue Details
Traceback (most recent call last):
File "", line 24, in
File "/home/linghutf/k-vim/bundle/YouCompleteMe/autoload/../python/ycm/setup.py", line 49, in SetUpYCM
base.LoadJsonDefaultsIntoVim()
File "/home/linghutf/k-vim/bundle/YouCompleteMe/autoload/../python/ycm/base.py", line 60, in LoadJsonDefaultsIntoVim
vimsupport.LoadDictIntoVimGlobals( vim_defaults, overwrite = False )
File "/home/linghutf/k-vim/bundle/YouCompleteMe/autoload/../python/ycm/vimsupport.py", line 305, in LoadDictIntoVimGlobals
extend_option ) )
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
YouCompleteMe unavailable: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte
The text was updated successfully, but these errors were encountered: