{"action":"created","issue":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/2024","repository_url":"https://api.github.com/repos/Valloric/YouCompleteMe","labels_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/2024/labels{/name}","comments_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/2024/comments","events_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/2024/events","html_url":"https://github.com/Valloric/YouCompleteMe/issues/2024","id":138246503,"number":2024,"title":"Latest versions use ycmd that tries (and fails) to use python3-isms with a python2 interpreter.","user":{"login":"comand","id":429986,"avatar_url":"https://avatars.githubusercontent.com/u/429986?v=3","gravatar_id":"","url":"https://api.github.com/users/comand","html_url":"https://github.com/comand","followers_url":"https://api.github.com/users/comand/followers","following_url":"https://api.github.com/users/comand/following{/other_user}","gists_url":"https://api.github.com/users/comand/gists{/gist_id}","starred_url":"https://api.github.com/users/comand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comand/subscriptions","organizations_url":"https://api.github.com/users/comand/orgs","repos_url":"https://api.github.com/users/comand/repos","events_url":"https://api.github.com/users/comand/events{/privacy}","received_events_url":"https://api.github.com/users/comand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-03T17:36:51Z","updated_at":"2016-03-03T18:05:45Z","closed_at":null,"body":"# Issue Prelude\r\n\r\n**Please complete these steps and check these boxes (by putting an `x` inside\r\nthe brackets) _before_ filing your issue:**\r\n\r\n- [x] I have read and understood YCM's [CONTRIBUTING][cont] document.\r\n- [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.\r\n- [x] I have read and understood YCM's [README][readme], **especially the\r\n  [Frequently Asked Questions][faq] section.**\r\n- [x] I have searched YCM's issue tracker to find issues similar to the one I'm\r\n  about to report and couldn't find an answer to my problem. ([Example Google\r\n  search.][search])\r\n- [x] If filing a bug report, I have included the output of `vim --version`.\r\n- [x] If filing a bug report, I have included the output of `:YcmDebugInfo`.\r\n- [x] If filing a bug report, I have included the output of\r\n  `:YcmToggleLogs stderr`.\r\n- [x] If filing a bug report, I have included which OS (including specific OS\r\n  version) I am using.\r\n- [x] If filing a bug report, I have included a minimal test case that reproduces\r\n  my issue.\r\n- [x] **I understand this is an open-source project staffed by volunteers and\r\n  that any help I receive is a selfless, heartfelt _gift_ of their free time. I\r\n  know I am not entitled to anything and will be polite and courteous.**\r\n- [x] **I understand my issue may be closed if it becomes obvious I didn't\r\n  actually perform all of these steps.**\r\n\r\nThank you for adhering to this process! It ensures your issue is resolved\r\nquickly and that neither your nor our time is needlessly wasted.\r\n\r\n# Issue Details\r\n\r\nI updated to the latest YCM the other day, after successfully using previous versions for over a year now with the same setup. It appears that recent changes to ycmd for UTF support have brought along some Python3 syntax that doesn't work in Python2.\r\n\r\nAs an aside, I also noted that the latest version of the ycm_core support lib use clang-c/Documentation.h, which is not present in llvm 3.4. The readme indicates that YCM should work fine with an older version, but that's no longer the case.\r\n\r\n## Steps to reproduce\r\n\r\n1) Install YCM (I used NeoBundle)\r\n2) Build ycm_core for clang completion.\r\n3) Open Vim/GVim on an empty .cpp file.\r\n\r\n## System Configuration\r\n\r\n% cat /etc/issue\r\nRed Hat Enterprise Linux Workstation release 6.6 (Santiago)\r\n\r\nNote that I'm using RHEL 6.6, which is fairly ancient, but I have a more recent set of tools, including gcc 4.8.2, Python 2.7.5, llvm 3.7.1, etc, that I compile vim and ycm_core against.\r\n\r\n% vim --version\r\nVIM - Vi IMproved 7.4 (2013 Aug 10, compiled Mar  2 2016 11:42:48)\r\nIncluded patches: 1-1468\r\nHuge version without GUI.  Features included (+) or not (-):\r\n+acl             +farsi           +mouse_netterm   +tag_binary\r\n+arabic          +file_in_path    +mouse_sgr       +tag_old_static\r\n+autocmd         +find_in_path    -mouse_sysmouse  -tag_any_white\r\n-balloon_eval    +float           +mouse_urxvt     -tcl\r\n-browse          +folding         +mouse_xterm     +terminfo\r\n++builtin_terms  -footer          +multi_byte      +termresponse\r\n+byte_offset     +fork()          +multi_lang      +textobjects\r\n+channel         +gettext         -mzscheme        +title\r\n+cindent         -hangul_input    +netbeans_intg   -toolbar\r\n-clientserver    +iconv           +packages        +user_commands\r\n-clipboard       +insert_expand   +path_extra      +vertsplit\r\n+cmdline_compl   +job             +perl            +virtualedit\r\n+cmdline_hist    +jumplist        +persistent_undo +visual\r\n+cmdline_info    +keymap          +postscript      +visualextra\r\n+comments        +langmap         +printer         +viminfo\r\n+conceal         +libcall         +profile         +vreplace\r\n+cryptv          +linebreak       +python/dyn      +wildignore\r\n+cscope          +lispindent      -python3         +wildmenu\r\n+cursorbind      +listcmds        +quickfix        +windows\r\n+cursorshape     +localmap        +reltime         +writebackup\r\n+dialog_con      +lua/dyn         +rightleft       -X11\r\n+diff            +menu            +ruby/dyn        -xfontset\r\n+digraphs        +mksession       +scrollbind      -xim\r\n-dnd             +modify_fname    +signs           -xsmp\r\n-ebcdic          +mouse           +smartindent     -xterm_clipboard\r\n+emacs_tags      -mouseshape      +startuptime     -xterm_save\r\n+eval            +mouse_dec       +statusline      -xpm\r\n+ex_extra        +mouse_gpm       -sun_workshop    \r\n+extra_search    -mouse_jsbterm   +syntax          \r\n   system vimrc file: \"/etc/vimrc\"\r\n     user vimrc file: \"$HOME/.vimrc\"\r\n 2nd user vimrc file: \"~/.vim/vimrc\"\r\n      user exrc file: \"$HOME/.exrc\"\r\n  fall-back for $VIM: \"/etc\"\r\n f-b for $VIMRUNTIME: \"/usr/share/vim/vim74\"\r\nCompilation: /opt/tools/bin/gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      \r\nLinking: /opt/tools/bin/gcc   -L.  -rdynamic -Wl,-export-dynamic -Wl,-E   -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lelf -lnsl  -lselinux  -ltinfo -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-R/opt/tools/lib -fstack-protector -L/usr/local/lib  -L/opt/tools/lib/perl5/5.12.1/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc        \r\n\r\n## YcmDebugInfo/YcmDebugToggleLogs\r\n\r\nInitially, YCM doesn't even load, so these commands are unavailable. The vim messages console contains this:\r\n\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 19, in <module>\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/autoload/../python/ycm/setup.py\", line 38, in SetUpYCM\r\n    base.LoadJsonDefaultsIntoVim()\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/autoload/../python/ycm/base.py\", line 46, in LoadJsonDefaultsIntoVim\r\n    defaults = user_options_store.DefaultOptions()\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/ycmd/user_options_store.py\", line 55, in DefaultOptions\r\n    options = json.loads( ReadFile( settings_path ) )\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/ycmd/utils.py\", line 54, in ReadFile\r\n    with open( filepath, encoding = 'utf8' ) as f:\r\nTypeError: 'encoding' is an invalid keyword argument for this function\r\n\r\nIf I go into ycmd/utils.py and change the offending open call to use io.open instead, I get a bit further. When loading the same empty .cpp file, YCM crashes upon entering insert mode, with the following details:\r\n\r\n:messages\r\nMessages maintainer: Bram Moolenaar <Bram@vim.org>\r\n\"testme.cpp\" 0L, 0C\r\nunsupported operand type(s) for ^: 'str' and 'str'\r\n\r\n:YcmDebugInfo\r\nPrinting YouCompleteMe debug information...\r\nError detected while processing function <SNR>119_DebugInfo:\r\nline    2:\r\nTraceback (most recent call last):\r\n  File \"<string>\", line 1, in <module>\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/autoload/../python/ycm/youcompleteme.py\", line 535, in DebugInfo\r\n    'debug_info' )\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py\", line 70, in PostDataToHandler\r\n    timeout ) )\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py\", line 163, in JsonFromFuture\r\n    _ValidateResponseObject( response )\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/autoload/../python/ycm/client/base_request.py\", line 193, in _ValidateResponseObject\r\n    if not SecureBytesEqual( our_hmac, their_hmac ):\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/ycmd/hmac_utils.py\", line 83, in SecureBytesEqual\r\n    result |= x ^ y\r\nTypeError: unsupported operand type(s) for ^: 'str' and 'str'\r\nE858: Eval did not return a valid python object\r\n\r\n:YcmToggleLogs stderr\r\n<log pane appears but it's empty>\r\n\r\nThanks in advance for any assistance you are able to offer.\r\n\r\n[Is there a way for me to go back to an earlier version of the plugin and it's dependencies? I tried using the NeoBundle 'rev' argument to lock back to an earlier revision, but that doesn't appear to include the older revs of third_party submodules, so the plugin fails because ycmd is still the latest version, and the wrong support libraries are built (just ycm_core, no ycm_client_support).]\r\n\r\n[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md\r\n[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md\r\n[readme]: https://github.com/Valloric/YouCompleteMe/blob/master/README.md\r\n[faq]: https://github.com/Valloric/YouCompleteMe/blob/master/README.md#faq\r\n[search]: https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fgithub.com%2FValloric%2FYouCompleteMe%2Fissues%20python%20mac\r\n"},"comment":{"url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/comments/191889878","html_url":"https://github.com/Valloric/YouCompleteMe/issues/2024#issuecomment-191889878","issue_url":"https://api.github.com/repos/Valloric/YouCompleteMe/issues/2024","id":191889878,"user":{"login":"comand","id":429986,"avatar_url":"https://avatars.githubusercontent.com/u/429986?v=3","gravatar_id":"","url":"https://api.github.com/users/comand","html_url":"https://github.com/comand","followers_url":"https://api.github.com/users/comand/followers","following_url":"https://api.github.com/users/comand/following{/other_user}","gists_url":"https://api.github.com/users/comand/gists{/gist_id}","starred_url":"https://api.github.com/users/comand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/comand/subscriptions","organizations_url":"https://api.github.com/users/comand/orgs","repos_url":"https://api.github.com/users/comand/repos","events_url":"https://api.github.com/users/comand/events{/privacy}","received_events_url":"https://api.github.com/users/comand/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T18:05:45Z","updated_at":"2016-03-03T18:05:45Z","body":"If I naively fix the issue inside of SecureBytesEqual (by catching TypeError and using x != y as a test instead), the next failure is here:\r\n\r\nTraceback (most recent call last):\r\nError detected while processing function youcompleteme#Complete:\r\nline   23:\r\n  File \"<string>\", line 1, in <module>\r\nError detected while processing function youcompleteme#Complete:\r\nline   23:\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/autoload/../python/ycm/base.py\", line 58, in CompletionStartColumn\r\nError detected while processing function youcompleteme#Complete:\r\nline   23:\r\n    vimsupport.CurrentFiletypes()[ 0 ] ) - 1 )\r\nError detected while processing function youcompleteme#Complete:\r\nline   23:\r\n  File \"/home/comand/.vim/bundle/YouCompleteMe/python/ycm/../../third_party/ycmd/ycmd/request_wrap.py\", line 109, in CompletionStartColumn\r\nError detected while processing function youcompleteme#Complete:\r\nline   23:\r\n    str( utf8_line_value[ : column_num -1 ], 'utf8' ) ) + 1\r\nError detected while processing function youcompleteme#Complete:\r\nline   23:\r\nTypeError: str() takes at most 1 argument (2 given)\r\nError detected while processing function youcompleteme#Complete:\r\n"}}