spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.34k stars 1.62k forks source link

Internal Python Language Server error #10470

Closed Mantxurreta closed 4 years ago

Mantxurreta commented 5 years ago

Description

What steps will reproduce the problem?

Copy the text content of one line excluding the tab level (ctr+c), paste (ctr+v) it in a new line at the same tab level, select the recently pasted text content and copy (ctr+c) it again.

Traceback

  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls_jsonrpc/endpoint.py", line 113, in consume
    self._handle_request(message['id'], message['method'], message.get('params'))
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls_jsonrpc/endpoint.py", line 182, in _handle_request
    handler_result = handler(params)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls_jsonrpc/dispatchers.py", line 23, in handler
    return method(**(params or {}))
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls/python_ls.py", line 295, in m_text_document__completion
    return self.completions(textDocument['uri'], position)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls/python_ls.py", line 216, in completions
    completions = self._hook('pyls_completions', doc_uri, position=position)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls/python_ls.py", line 132, in _hook
    return hook_handlers(config=self.config, workspace=workspace, document=doc, **kwargs)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/hooks.py", line 289, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/manager.py", line 87, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/_tracing.py", line 80, in __call__
    return outcome.get_result()
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/callers.py", line 52, in from_call
    result = func()
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/_tracing.py", line 78, in <lambda>
    outcome = _Result.from_call(lambda: self.oldcall(hook, hook_impls, kwargs))
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/manager.py", line 81, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py", line 54, in pyls_completions
    return [_format_completion(d, snippet_support and should_include_params) for d in definitions] or None
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py", line 54, in <listcomp>
    return [_format_completion(d, snippet_support and should_include_params) for d in definitions] or None
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/pyls/plugins/jedi_completion.py", line 67, in _format_completion
    if include_params and hasattr(d, 'params') and d.params:
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/cache.py", line 143, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/api/classes.py", line 339, in params
    for signature in context.get_signatures():
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/evaluate/context/instance.py", line 227, in get_signatures
    return [sig.bind(self) for sig in init_funcs.get_signatures()]
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/evaluate/base_context.py", line 426, in get_signatures
    return [sig for c in self._set for sig in c.get_signatures()]
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/evaluate/base_context.py", line 426, in <listcomp>
    return [sig for c in self._set for sig in c.get_signatures()]
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/evaluate/context/instance.py", line 227, in get_signatures
    return [sig.bind(self) for sig in init_funcs.get_signatures()]
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/evaluate/context/instance.py", line 227, in <listcomp>
    return [sig.bind(self) for sig in init_funcs.get_signatures()]
  File "/home/aritz/virtualenvs/spyder_beta/lib/python3.6/site-packages/jedi/evaluate/signature.py", line 93, in bind
    assert not self.is_bound

AssertionErro

Versions

Dependencies

cloudpickle >=0.5.0          :  1.2.1 (OK)
pygments >=2.0               :  2.4.2 (OK)
qtconsole >=4.5.5            :  4.5.5 (OK)
nbconvert >=4.0              :  5.6.0 (OK)
sphinx >=0.6.6               :  2.2.0 (OK)
pylint >=0.25                :  2.3.1 (OK)
psutil >=0.3                 :  5.6.3 (OK)
qtawesome >=0.5.7            :  0.6.0 (OK)
qtpy >=1.5.0                 :  1.9.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
zmq >=17                     :  18.1.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
numpydoc >=0.6.0             :  0.9.1 (OK)
spyder_kernels >=1.5.0;<2.0.0:  1.6.0 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
atomicwrites >=1.2.0         :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
watchdog                     :  None (OK)
keyring                      :  None (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pympler                      :  None (OK)
sympy >=0.7.3                :  None (NOK)
cython >=0.21                :  None (NOK)
IPython >=4.0                :  7.7.0 (OK)
matplotlib >=2.0.0           :  3.1.1 (OK)
pandas >=0.13.1              :  0.25.1 (OK)
numpy >=1.7                  :  1.17.3 (OK)
scipy >=0.17.0               :  1.3.1 (OK)
pyls >=0.28.2;<0.29.0        :  0.28.3 (OK)
xdg >=0.26                   :  0.26 (OK)
ccordoba12 commented 5 years ago

What's your Jedi version?

Mantxurreta commented 5 years ago

jedi.version says: 0.14.1

ccordoba12 commented 5 years ago

Copy the text content of one line excluding the tab level (ctr+c), paste (ctr+v) it in a new line at the same tab level, select the recently pasted text content and copy (ctr+c) it again.

Does this happen with any line? Or with a specific piece of code?

Mantxurreta commented 5 years ago

I just tried with a random line and it happened again. This time the line had no tab, so the selected first character was a letter as well, and I reproduced the error. Then I tried another random line and I cannot reproduce it.

ccordoba12 commented 5 years ago

Please post an animated gif displaying the problem.

Mantxurreta commented 5 years ago

While creating the gif I have noticed something new. The error window pops up by just holding control as well, not need to click c to copy in the second copy action of my explanation. I did not manage to reproduce this with every line, but I did with different lines many times. It appears not to happen twice with the same line. While setting the gif recorder I reproduced the issue many times and then it stopped happening. I restarted Spyder and I could reproduce the issue again.

This picture shows a copy paste with keyboard (control + c and then control + v) overwriting the same text.

spyder_v_4 0 0b7_select_line_copy_paste

This picture shows a line copied and pasted below, then selected and control key hold when the mouse points to the comment. A help menu under the highlighted text appears at the same time as the error reporting window.

spyder_v_4 0 0b7_select_pasted_line_and_hold_control

ccordoba12 commented 5 years ago

I'm sorry but I can't reproduce this just by copy/pasting

diff = inv_n_out - linalg_inv

Please provide a self-contained, complete code that we can use to reproduce this in our side.

ccordoba12 commented 4 years ago

This is an error in Jedi. Hopefully it's fixed in the latest version we support for it. If not, we'll try to update to a more recent Jedi version in 4.1.4, to be released in a month or so.