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

AttributeErrors since 0.13 update #259

Closed
RicherMans opened this issue Jul 13, 2018 · 9 comments
Closed

AttributeErrors since 0.13 update #259

RicherMans opened this issue Jul 13, 2018 · 9 comments
Labels

Comments

@RicherMans
Copy link

Hey there,
I recently updated to the new version and got the following error everytime I type anything:

Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 685, in on_query_completions
    res = vel.on_query_completions(prefix, locations)
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/sublime_jedi/completion.py", line 158, in on_query_completions
    cplns = [tuple(x) for x in self._sort_completions(cplns)]
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/sublime_jedi/completion.py", line 174, in _sort_completions
    key=lambda x: (
TypeError: 'NoneType' object is not iterable
Jedi - Python autocompletion.sublime_jedi.facade: `JediFacade.get_autocomplete` failed
Traceback (most recent call last):
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/sublime_jedi/facade.py", line 110, in get
    return getattr(self, 'get_' + _action)(*args, **kwargs)
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/sublime_jedi/facade.py", line 139, in get_autocomplete
    filter(lambda c: not c[0].endswith('\tparam'), completion))
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/sublime_jedi/facade.py", line 168, in _completion
    completions = self.script.completions()
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/api/__init__.py", line 174, in completions
    completions = completion.completions()
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/api/completion.py", line 98, in completions
    completion_names = self._get_context_completions()
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/api/completion.py", line 173, in _get_context_completions
    completion_names = list(self._get_keyword_completion_names(allowed_transitions))
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/api/completion.py", line 212, in _get_keyword_completion_names
    yield keywords.KeywordName(self._evaluator, k)
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/api/keywords.py", line 28, in __init__
    self.parent_context = evaluator.builtins_module
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/evaluate/cache.py", line 40, in wrapper
    rv = function(obj, *args, **kwargs)
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/evaluate/__init__.py", line 115, in builtins_module
    return compiled.get_special_object(self, u'BUILTINS')
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/evaluate/compiled/__init__.py", line 27, in get_special_object
    evaluator.compiled_subprocess.get_special_object(identifier)
  File "/home/richman/.config/sublime-text-3/Packages/Jedi - Python autocompletion/dependencies/jedi/evaluate/compiled/context.py", line 460, in create_from_access_path
    for name, access in access_path.accesses:
AttributeError: 'tuple' object has no attribute 'accesses'

Any hits how to avoid that?

@srusskih
Copy link
Owner

@RicherMans thanks for report, could you please post a code fragment to reproduce the issue?

@jmouradev
Copy link

jmouradev commented Jul 13, 2018

Hi,

For example, on Mac OS 10.13, this simple fragment code reproduces that issue reported.
ST build 3176

screen shot 2018-07-13 at 15 12 17

@RicherMans
Copy link
Author

Sorry, somehow didn't get any notification for this thread.
I agree with @jmdev33376 , any autocompletion fails, even for built-in`s like print.
After typing the any character, Sublime will hang for a second and report the error above.

@srusskih
Copy link
Owner

srusskih commented Jul 16, 2018

I manged to reproduce with numpy exmple.

As temporary workaround, I suggest wait for a fist completion (:
Due to first long response from jedi, first completion (or other action that requires jedi) can be slow :(

Possible solution set actions in a queue and pass them to jedi one by one.

@srusskih
Copy link
Owner

Please check if #260 works for you. Thanks!

@RicherMans
Copy link
Author

Thanks @srusskih !
That fix works and no errors appear. However it seems to be quite a bit slower :(

@srusskih
Copy link
Owner

@RicherMans can you describe the case when it slower? i'd like to try to reproduce (understand)

@RicherMans
Copy link
Author

@srusskih actually that could have been an issue of my connection. I only use sublime for remote applications over a sshfs mounted drive. It was general knowledge to me that anaconda ( which includes jedi ) is super laggy for those cases, so I was a bit surprised that jedi lagged yesterday.
Today everything is fine, I don't think it had anything to do with Jedi! Thanks a lot!

@srusskih
Copy link
Owner

@RicherMans thanks for your feedback. going merge change to master and release it today (I hope)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants