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

AttributeError when opening c or cpp files #3507

Closed
12 tasks done
tgys opened this issue Oct 17, 2019 · 2 comments
Closed
12 tasks done

AttributeError when opening c or cpp files #3507

tgys opened this issue Oct 17, 2019 · 2 comments

Comments

@tgys
Copy link

tgys commented Oct 17, 2019

I compiled YCM with go, typescript, rust, java, and semantic support for c languages through libclang (with system libclang version 9.0.0).
I get the error AttributeError: module 'yrlnrxfcnjwvlso' has no attribute 'FlagsForFile' if I open a c or c++ file. I get a new error every time I open a file (even when it's the same file) where the only thing that changes is the module name, e.g jjbsgqwsznkcvuy

error logs:
Traceback (most recent call last): File "/home/tei/.vim/bundles/YouCompleteMe/python/ycm/client/base_request.py", line 79, in HandleFuture return _JsonFromFuture( future ) File "/home/tei/.vim/bundles/YouCompleteMe/python/ycm/client/base_request.py", line 242, in _JsonFromFuture raise MakeServerException( response.json() ) ycmd.responses.ServerError: AttributeError: module 'ygjmwrqyobuiman' has no attribute 'FlagsForFile'

File "/home/tei/.vim/bundles/YouCompleteMe/third_party/ycmd/ycmd/completers/cpp/flags.py", line 185, in _GetFlagsFromExtraConfOrDatabase return _CallExtraConfFlagsForFile( module, filename, client_data ) File "/home/tei/.vim/bundles/YouCompleteMe/third_party/ycmd/ycmd/completers/cpp/flags.py", line 284, in _CallExtraConfFlagsForFile elif inspect.getargspec( module.FlagsForFile ).keywords: AttributeError: module 'ygjmwrqyobuiman' has no attribute 'FlagsForFile'

YcmDebugInfo output:
Printing YouCompleteMe debug information... -- Client logfile: /tmp/ycm_3qz125mm.log -- Server Python interpreter: /usr/bin/python3 -- Server Python version: 3.7.4 -- Server has Clang support compiled in: True -- Clang version: clang version 8.0.0 (tags/RELEASE_800/final) -- Extra configuration file found and loaded -- Extra configuration path: /home/tei/.vim/bundles/YouCompleteMe/.ycm_extra_conf.py -- Server running at: http://127.0.0.1:33743 -- Server process ID: 656243 -- Server logfiles: -- /tmp/ycmd_33743_stdout_9j67meme.log -- /tmp/ycmd_33743_stderr_d4cag8g5.log

example program that gave those errors:
`#include
#include
#include
#include
#include
using namespace std;

int main() {
string a,b,c;
cin >> a >> b >> c;
const int sum3 = stoi(a) + stoi(b) + stoi(c);
cout << sum3 << "\n";
return 0;
}`

I am using archlinux 5.3.1 and VIM 8.1 with included features (+):
+arabic +file_in_path +mouse_urxvt +tcl/dyn +autocmd +find_in_path +mouse_xterm +termguicolors +autochdir +float +multi_byte +terminal -autoservername +folding +multi_lang +terminfo -balloon_eval -footer -mzscheme +termresponse +balloon_eval_term +fork() +netbeans_intg +textobjects -browse +gettext +num64 +textprop ++builtin_terms -hangul_input +packages +timers +byte_offset +iconv +path_extra +title +channel +insert_expand +perl/dyn -toolbar +cindent +job +persistent_undo +user_commands -clientserver +jumplist +postscript +vartabs -clipboard +keymap +printer +vertsplit +cmdline_compl +lambda +profile +virtualedit +cmdline_hist +langmap +python/dyn +visual +cmdline_info +libcall +python3/dyn +visualextra +comments +linebreak +quickfix +viminfo +conceal +lispindent +reltime +vreplace +cryptv +listcmds +rightleft +wildignore +cscope +localmap +ruby/dyn +wildmenu +cursorbind +lua/dyn +scrollbind +windows +cursorshape +menu +signs +writebackup +dialog_con +mksession +smartindent -X11 +diff +modify_fname -sound -xfontset +digraphs +mouse +spell -xim -dnd -mouseshape +startuptime -xpm -ebcdic +mouse_dec +statusline -xsmp +emacs_tags +mouse_gpm -sun_workshop -xterm_clipboard +eval -mouse_jsbterm +syntax -xterm_save +ex_extra +mouse_netterm +tag_binary +extra_search +mouse_sgr -tag_old_static

  • I have read and understood YCM's CONTRIBUTING document.
  • I have read and understood YCM's CODE_OF_CONDUCT document.
  • I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue, including what I expected to happen and what actually happened.
  • If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • I understand this is an open-source project staffed by volunteers and
    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.
  • I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.
@bstaletic
Copy link
Collaborator

What's in your .ycm_extra_conf.py? This is definitely user error, though it's not at all obvious to a user what the error is. My suggestion is to go over to https://gitter.im/Valloric/YouCompleteMe and chat with us there.

@bstaletic
Copy link
Collaborator

Resolved on gitter, therefore closing.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 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

No branches or pull requests

2 participants