question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError when using let g:jedi#show_call_signatures = 2

See original GitHub issue

Issue

jedi 0.11.1
vim 8.0.1553
Windows 10 x64
[I don't know how to obtain jedi-vim version]

When using let g:jedi#show_call_signatures = 2 in my .vimrc (together with set noshowmode, of course), Vim produces the following error instead of showing the function signature on the command line:

Traceback (most recent call last):
  File "...vim/vimfiles\pythonx\jedi_vim.py", line 128, in wrapper
    return func(*args, **kwargs)
  File "...vim/vimfiles\pythonx\jedi_vim.py", line 457, in cmdline_call_signatures
    max_msg_len -= len(signatures[0].call_name) + 2  # call name + parentheses
AttributeError: 'CallSignature' object has no attribute 'call_name'

Curiously enough, let g:jedi#show_call_signatures = 1 works perfectly, showing the popup with the correct function signature.

Steps to reproduce

Create an empty Python file, edit it with Vim and include the following text:

import time
time.sleep(

After typing the opening parentheses the error is produced, silently. The error message is only visible when typing :messages after it has produced, in my Vim setup.

No difference between my usual .vimrc and a minimal one, but I’m including here the minimal one I’ve used for testing:

set nocompatible
set noshowmode

let script_dir = fnamemodify(expand('<sfile>'), ':h')
let &runtimepath .= ','.script_dir.','.script_dir.'/after'

" Put your config changes here.
let g:jedi#show_call_signatures=2

syntax on
filetype plugin indent on

Output of “:verbose JediDebugInfo”

I’m sorry, when trying to get JediDebugInfo I got the following error:

Messages maintainer: Bram Moolenaar <Bram@vim.org>
"test.pyw" [unix] 2L, 17C
Error detected while processing function jedi#debug_info:
line   28:
Traceback (most recent call last):
  File "C:/Users/DervishD/Desktop/Drive/config/vim/vimfiles\pythonx\jedi_vim_debug.py", line 34, in display_debug_info
    for p in jedi_vim.jedi.Script('')._evaluator.sys_path:
AttributeError: 'Evaluator' object has no attribute 'sys_path'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:/Users/DervishD/Desktop/Drive/config/vim/vimfiles\pythonx\jedi_vim_debug.py", line 38, in display_debug_info
    "{0!r})".format(e))
  File "C:/Users/DervishD/Desktop/Drive/config/vim/vimfiles\pythonx\jedi_vim_debug.py", line 8, in echo
    vim.command('echo {0}'.format(msg))
vim.error: Vim(echo):E117: Unknown function: AttributeError
E171: Missing :endif

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
davidhaltercommented, Mar 6, 2018

This was probably fixed in 7e6811cb4b214fce25d39eec2c4362378c50e479.

Please upgrade your jedi-vim version (the other errors were AFAIK also fixed with the newer version).

0reactions
DervishDcommented, Mar 14, 2018

Nope, David, the only setting I have regarding jedi-vim is let g:jedi#smart_auto_mappings = 0.

When I have the time I’ll try to debug this issue and I’ll provide more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix AttributeError in Python - Rollbar
The Python AttributeError is an exception that occurs when an attribute reference or assignment fails. Learn how to fix it.
Read more >
Correct handling of AttributeError in __getattr__ when using ...
It seems incorrect to me that when a property exists but fails, __getattr__ is still attempted instead of letting the error from the...
Read more >
Python AttributeError — What is it and how do you fix it?
The attribute error in Python means that you tried accessing a ... "object has no attribute" means the object you're using doesn't have...
Read more >
Python AttributeError: A How-To Guide - Career Karma
Let's write a program that merges two lists of shoes. Two shoe stores are going through a merger and want to make a...
Read more >
Python: AttributeError - GeeksforGeeks
AttributeError can be defined as an error that is raised when an attribute reference or assignment fails. For example, if we take a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found