Skip to content
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

UnicodeEncodeError: ascii codec can't encode character u'\u2019' #2066

Closed
dragonxlwang opened this issue Mar 21, 2016 · 25 comments · Fixed by ycm-core/ycmd#455
Closed

UnicodeEncodeError: ascii codec can't encode character u'\u2019' #2066

dragonxlwang opened this issue Mar 21, 2016 · 25 comments · Fixed by ycm-core/ycmd#455

Comments

@dragonxlwang
Copy link

untitled

vim version:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar 20 2016 02:39:43)
MacOS X (unix) version
Included patches: 1-1553
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     +tcl
+balloon_eval    +folding         +mouse_xterm     +terminfo
+browse          -footer          +multi_byte      +termresponse
++builtin_terms  +fork()          +multi_lang      +textobjects
+byte_offset     +fullscreen      -mzscheme        +title
+channel         -gettext         +netbeans_intg   +toolbar
+cindent         -hangul_input    +odbeditor       +transparency
+clientserver    +iconv           +packages        +user_commands
+clipboard       +insert_expand   +path_extra      +vertsplit
+cmdline_compl   +job             +perl            +virtualedit
+cmdline_hist    +jumplist        +persistent_undo +visual
+cmdline_info    +keymap          +postscript      +visualextra
+comments        +langmap         +printer         +viminfo
+conceal         +libcall         +profile         +vreplace
+cryptv          +linebreak       +python          +wildignore
+cscope          +lispindent      -python3         +wildmenu
+cursorbind      +listcmds        +quickfix        +windows
+cursorshape     +localmap        +reltime         +writebackup
+dialog_con_gui  +lua             +rightleft       -X11
+diff            +menu            +ruby            -xfontset
+digraphs        +mksession       +scrollbind      +xim
+dnd             +modify_fname    +signs           -xsmp
-ebcdic          +mouse           +smartindent     -xterm_clipboard
+emacs_tags      +mouseshape      +startuptime     -xterm_save
+eval            +mouse_dec       +statusline      -xpm
+ex_extra        -mouse_gpm       -sun_workshop    
+extra_search    -mouse_jsbterm   +syntax          
+farsi           +mouse_netterm   +tag_binary      
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX  -F/usr/local/Cellar/python/2.7.11/Frameworks -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: clang   -L. -L/usr/local/lib -L. -L/usr/local/lib -F/usr/local/Cellar/python/2.7.11/Frameworks -L/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -framework CoreFoundation -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework Cocoa  -L/usr/local/lib -llua -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -F/usr/local/Cellar/python/2.7.11/Frameworks -framework Python  -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby    

and I am having the following error log:

2016-03-21 01:44:58,362 - INFO - Received event notification
2016-03-21 01:44:58,363 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:44:58,364 - INFO - Received event notification
2016-03-21 01:44:58,364 - INFO - Adding buffer identifiers for file: /Users/xiaolong/Desktop/test.sh
2016-03-21 01:44:58,365 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:44:59,036 - INFO - Received health request
2016-03-21 01:44:59,040 - INFO - Received filetype completion available request
2016-03-21 01:44:59,040 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:01,690 - INFO - Received completion request
2016-03-21 01:45:01,691 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:01,810 - INFO - Received completion request
2016-03-21 01:45:01,810 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:01,934 - INFO - Received completion request
2016-03-21 01:45:01,934 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:02,047 - INFO - Received completion request
2016-03-21 01:45:02,047 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:02,228 - INFO - Received event notification
2016-03-21 01:45:02,228 - INFO - Adding ONE buffer identifier for file: /Users/xiaolong/Desktop/test.sh
2016-03-21 01:45:02,229 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:02,231 - INFO - Received completion request
2016-03-21 01:45:02,231 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:02,591 - INFO - Received completion request
2016-03-21 01:45:02,591 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:03,287 - INFO - Received completion request
2016-03-21 01:45:03,287 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:03,623 - INFO - Received completion request
2016-03-21 01:45:03,623 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:03,928 - INFO - Received completion request
2016-03-21 01:45:03,928 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 861, in _handle
    return route.call(**args)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1734, in wrapper
    rv = callback(*a, **ka)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/watchdog_plugin.py", line 106, in wrapper
    return callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/hmac_plugin.py", line 72, in wrapper
    body = callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 129, in GetCompletions
    .ComputeCandidates( request_data ) )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/general/general_completer_store.py", line 89, in ComputeCandidates
    candidates += completer.ComputeCandidates( request_data )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 172, in ComputeCandidates
    request_data[ 'query' ] )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 245, in FilterAndSortCandidates
    return self.FilterAndSortCandidatesInner( candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 250, in FilterAndSortCandidatesInner
    candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer_utils.py", line 160, in FilterAndSortCandidatesWrap
    ToCppStringCompatible( query ) )
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 19: ordinal not in range(128)
2016-03-21 01:45:04,239 - INFO - Received completion request
2016-03-21 01:45:04,239 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 861, in _handle
    return route.call(**args)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1734, in wrapper
    rv = callback(*a, **ka)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/watchdog_plugin.py", line 106, in wrapper
    return callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/hmac_plugin.py", line 72, in wrapper
    body = callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 129, in GetCompletions
    .ComputeCandidates( request_data ) )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/general/general_completer_store.py", line 89, in ComputeCandidates
    candidates += completer.ComputeCandidates( request_data )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 172, in ComputeCandidates
    request_data[ 'query' ] )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 245, in FilterAndSortCandidates
    return self.FilterAndSortCandidatesInner( candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 250, in FilterAndSortCandidatesInner
    candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer_utils.py", line 160, in FilterAndSortCandidatesWrap
    ToCppStringCompatible( query ) )
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 19: ordinal not in range(128)
2016-03-21 01:45:07,607 - INFO - Received completion request
2016-03-21 01:45:07,607 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 861, in _handle
    return route.call(**args)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1734, in wrapper
    rv = callback(*a, **ka)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/watchdog_plugin.py", line 106, in wrapper
    return callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/hmac_plugin.py", line 72, in wrapper
    body = callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 129, in GetCompletions
    .ComputeCandidates( request_data ) )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/general/general_completer_store.py", line 89, in ComputeCandidates
    candidates += completer.ComputeCandidates( request_data )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 172, in ComputeCandidates
    request_data[ 'query' ] )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 245, in FilterAndSortCandidates
    return self.FilterAndSortCandidatesInner( candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 250, in FilterAndSortCandidatesInner
    candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer_utils.py", line 160, in FilterAndSortCandidatesWrap
    ToCppStringCompatible( query ) )
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 19: ordinal not in range(128)
2016-03-21 01:45:08,671 - INFO - Received completion request
2016-03-21 01:45:08,671 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 861, in _handle
    return route.call(**args)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/third_party/bottle/bottle.py", line 1734, in wrapper
    rv = callback(*a, **ka)
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/watchdog_plugin.py", line 106, in wrapper
    return callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/hmac_plugin.py", line 72, in wrapper
    body = callback( *args, **kwargs )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/handlers.py", line 129, in GetCompletions
    .ComputeCandidates( request_data ) )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/general/general_completer_store.py", line 89, in ComputeCandidates
    candidates += completer.ComputeCandidates( request_data )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 172, in ComputeCandidates
    request_data[ 'query' ] )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 245, in FilterAndSortCandidates
    return self.FilterAndSortCandidatesInner( candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer.py", line 250, in FilterAndSortCandidatesInner
    candidates, sort_property, query )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/completers/completer_utils.py", line 160, in FilterAndSortCandidatesWrap
    ToCppStringCompatible( query ) )
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 19: ordinal not in range(128)
2016-03-21 01:45:10,396 - INFO - Received event notification
2016-03-21 01:45:10,397 - INFO - Adding ONE buffer identifier for file: /Users/xiaolong/Desktop/test.sh
2016-03-21 01:45:10,397 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:10,400 - INFO - Received completion request
2016-03-21 01:45:10,400 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:11,596 - INFO - Received event notification
2016-03-21 01:45:11,596 - INFO - Adding buffer identifiers for file: /Users/xiaolong/Desktop/test.sh
2016-03-21 01:45:11,596 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:11,597 - INFO - Received event notification
2016-03-21 01:45:11,598 - ERROR - No semantic completer exists for filetypes: [u'sh']
Traceback (most recent call last):
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 94, in FiletypeCompletionAvailable
    self.GetFiletypeCompleter( filetypes )
  File "/Users/xiaolong/misc/dotfiles/mac/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/server_state.py", line 89, in GetFiletypeCompleter
    current_filetypes ) )
ValueError: No semantic completer exists for filetypes: [u'sh']
2016-03-21 01:45:13,684 - INFO - Received debug info request

Mac OS X10.11.3

And YCM: commit f44435b

@dragonxlwang
Copy link
Author

the reason that I am issuing a ticket here is because I don't have any non ascii code there. And it seems other's previous reported problem is related to international locale charaters...

@fplust
Copy link

fplust commented Mar 21, 2016

what is your system locale setting, I have a similar issue on my archlinux, but when I change my locale setting from zh_CN to en_US, the issue disappear.

@dragonxlwang
Copy link
Author

in mac, I can only think of setting language when initializing the machine and it was english...

On Mar 21, 2016, at 4:49 AM, FPlust notifications@github.com wrote:

what is your system locale setting, I have a similar issue on my archlinux, but when I change my locale setting from zh_CN to en_US, the issue disappear.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub #2066 (comment)

@dragonxlwang
Copy link
Author

here's what locale says:

image

I don't think this is relevant to my bug though

@fplust
Copy link

fplust commented Mar 21, 2016

I am not a mac user, so I can not help you. In linux, you can just type "locale" in the terminal to check your locale setting.

@juliedavila
Copy link

Ah just filed a ticket for the same #2069

@dragonxlwang
Copy link
Author

for my case I am writing in bash scripts. And I can also replicate in c/c++ files as well

@juliedavila
Copy link

Seems to be OSX + any syntax highlighted file + ~/$somechar as the issue

@dragonxlwang
Copy link
Author

this problem seems not always occurring. I just tried it now and it disappears... five min ago it was still there.

@dragonxlwang
Copy link
Author

it seems so far the problem is not appearing anymore...

I think something might be helpful:

export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

and reinstall ycm again.

@juliedavila
Copy link

I'll give that try, if it solves mine i'll update here and close my issue too

@dragonxlwang
Copy link
Author

also, you might want to check your vimrc. I am now removing all my own stuff and only leave plugin stuff there right now.

If this problem will be going away for a while, I will add my vimrc back to see if there is any problems.

On Mar 21, 2016, at 2:47 PM, Jonathan Davila notifications@github.com wrote:

I'll give that try, if it solves mine i'll update here and close my issue too


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub #2066 (comment)

@juliedavila
Copy link

yeah your first suggestion didn't do the trick unfortunately

@dragonxlwang
Copy link
Author

does this help? YcmRestartServer

I am also having the problem back, but it seems that using YcmRestartServer will help?

@dragonxlwang dragonxlwang reopened this Mar 21, 2016
@dragonxlwang
Copy link
Author

also try kill all ycm processes:
ps aux | grep ycm

@juliedavila
Copy link

No luck. I got work to do, I'll disable it for now. Hopefully this can be resolved soon.

@puremourning
Copy link
Member

@dragonxlwang It would be really useful if you could checkout my YouCompleteMe and ycmd branches which I hope resolve this (and a number of other) unicode issues:

Feedback on whether or not it resolves your particular issue will speed up getting it PR'd :)

Thanks!

@dragonxlwang
Copy link
Author

@puremourning It seems after last few update ago, I could no longer reproduce the problem any more...

If i noticed any problem there, I would say that after clicking the first character, the path completion disappears. However, it doesn't throw any errors....

@puremourning
Copy link
Member

The error is still there usually when you enable :set noshowmode or look at ycmd log.

With my change, you should still get completions, but just the ones containing unicode chars are not listed (after typing a query). Unfortunately supporting queries on non-ASCII strings is not possible with ycmd's search infrastructure. What I have fixed is that it would crash trying to.

@dragonxlwang
Copy link
Author

Hi @puremourning , after checking out your version, I still get error after enabling noshowmode

I have to run git submodule update --init --recursive in order to get thirdparty stuff.

Please let me know if I missed anything...

image

@puremourning
Copy link
Member

by running git submodule update you are actually overriding the ycmd checkout.
This should work:

  • check out my YCM in ~/.vim/bundle/YouCompleteMe
  • git submodule update --init --recursive
  • cd third_party/ycmd
  • check out my ycmd branch

I could update the submodules int he YCM branch i suppose...

@dragonxlwang
Copy link
Author

following your way seems still missing some submodules... I will wait for further update.

@puremourning
Copy link
Member

That's very strange :/

Anyway i have updated the submodules in my YouCompleteMe branch so the new instructions are:

  • Checkout my YCM
  • git submodule update --init --recursive

The CI build is running so i'm confident that all the modules are correctly set up.

@dragonxlwang
Copy link
Author

Again, when hitting ``~/'' I am getting the same error.

All I did was

  • remove old ycm
  • check out your ycm: git submodule update --init --recursive
  • git submodule update --init --recursive
  • run install.py: ./install.py --clang-completer

@dragonxlwang
Copy link
Author

I have recently updated to the newer version ycm and this problem occurs again (wasn't been for quite a while)... @puremourning , is there any follow up? thanks!

This problem is OS X specific and might be more general than it seems: on a fresh installed mac, the problem occurs if in the directory candidates there is a filename with space in between, like Google Drive. It seems related to how Os X is showing them (you can check by run ls ~) for those dirs, os X will enclose them with unicode quotes \u2018, 2019.

homu added a commit to ycm-core/ycmd that referenced this issue Apr 24, 2016
[READY] Fix issues with multi-byte characters

## Summary

This change introduces more general support for non-ASCII characters in buffers handled by YCMD.

In ycmd's public API, all offsets are byte offsets into the UTF-8 encoded buffers. We also assume (because, we have no other choice) that files stored on disk are also UTF-8 encoded. Internally, almost all of ycmd's functionality operates on unicode strings (python 2 `unicode()` and python 3 `str()` objects, transparently via `future`). Many of the downstream completion engines expect unicode code points as the offsets in their APIs. One special case is the `ycm_core` library (identifier completer and clang completer), which requires instances of the _native_ `str` type. All strings used within the c++ using `boost::python` require passing through `ToCppStringCompatible`

Previously, we were largely just assuming that `code point == byte offset` - i.e. all buffers contained only ASCII characters. This worked up to a point, but more by luck than judgement in a number of places.

## References

In combination with a YCM change and PR #453, I hope this:

- fixes #109
- fixes ycm-core/YouCompleteMe#2096
- fixes ycm-core/YouCompleteMe#2088
- fixes ycm-core/YouCompleteMe#2069
- fixes ycm-core/YouCompleteMe#2066
- fixes ycm-core/YouCompleteMe#1378

## Overview of changes

The changes fall into the following areas:

- Providing access to and conversion to/from code points and byte offsets (`request_wrap.py`)
- Changing certain algorithms/features to work entirely in codepoint space when they are trying to operate on logical 'characters' within the buffer (see known issues for why this isn't perfect, but probably most of the way there)
- Changing the completers to convert between the external (on both sides) and internal representations by using the shortcuts provided in `request_wrap.py`
- Adding tests for each of the completers for both completions and subcommands

## Completer-specific notes

Pretty much all of the completers I tested required some changes:
- clang uses utf-8 and byte offsets, but had some bugs with the `GetDoc` parsing stuff
- OmniSharp speaks codepoint offsets
- Tern speaks codepoint offsets
- JediHTTP speaks codepoint offsets
- tsserver speaks codepoint offsets
- gocode speaks byte offsets
- racer i did not test

## Further work / Known issues

- we act blissfully ignorant of the case where a unicode character consumes multiple code points (such as where there is a modifier after the code point)
- when typing a unicode character, we still get an exception from `bitset` (see #453 for that fix)
- the filtering and sorting system is 100% designed for ASCII only, and it is not in the scope of this PR to change that. Currently after any filtering operation, words containing non-ASCII characters are excluded.
- I did not get round to testing rust using racer
- there are further changes required to YouCompleteMe client (a further PR is coming for that)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/455)
<!-- Reviewable:end -->
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants