ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.44k stars 2.81k forks source link

Failed to convert returned python object to vim value #227

Closed lekv closed 11 years ago

lekv commented 11 years ago

The error

""" Error detected while processing function youcompleteme#Complete..62_CompletionsForQuery: line 12: E859: Failed to convert returned python object to vim value """

comes up when typing the following example code in a .py file (same as in #146):

!/usr/bin/python

import os os. (Error comes up when hitting .)

This is similar to Issue #146, but as #146 has been fixed, this is probably something new. I tried to remove all python related config from my .vimrc but the error still occurs.

What information do I have to gather to enable you to debug this?

lekv commented 11 years ago

I tracked this down to line 111 in python/completers/python/jedi_completer. event.wait() always returns None for Python versions prior to 2.7 (I have 2.6). This None value gets passed upwards until Vim tries to parse it and fails. Wrapping it in bool() fixes the issue. However no completions show up in this case.

I'm at work now and this is a very minor change but when I get home I can create a pull request.