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.

IndexError when processing completions

See original GitHub issue

Description

No completions are shown when I type t at plt.plo$.

What steps will reproduce the problem?

I can repro it consistently after writing this code:

import numpy as np import matplotlib.pyplot as plt

my_x = np.linspace(1, -1, 1, endpoint=bool) my_y = np.linspace() my_x = np.linspace(1, -1, 2)

plt.plot()

Traceback

  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 1126, in process_signatures
    parameter_data = parameters[parameter_idx]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 1025, in emit
    msg = self.format(record)
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 869, in format
    return fmt.format(record)
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 608, in format
    record.message = record.getMessage()
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
ValueError: incomplete format
Call stack:
  File "bootstrap.py", line 186, in <module>
    start.main()
  File "/Users/patricklung/spyder/spyder/app/start.py", line 195, in main
    mainwindow.main()
  File "/Users/patricklung/spyder/spyder/app/mainwindow.py", line 3596, in main
    mainwindow = run_spyder(app, options, args)
  File "/Users/patricklung/spyder/spyder/app/mainwindow.py", line 3479, in run_spyder
    app.exec_()
  File "/Users/patricklung/spyder/spyder/app/mainwindow.py", line 3044, in show_preferences
    dlg.exec_()
  File "/Users/patricklung/spyder/spyder/plugins/completion/languageserver/client.py", line 340, in on_msg_received
    handler(resp['result'], req_id)
  File "/Users/patricklung/spyder/spyder/plugins/completion/languageserver/providers/document.py", line 132, in process_signature_completion
    {'params': response})
  File "/Users/patricklung/spyder/spyder/plugins/completion/languageserver/plugin.py", line 245, in receive_response
    self.COMPLETION_CLIENT_NAME, req_id, response)
  File "/Users/patricklung/spyder/spyder/plugins/completion/plugin.py", line 102, in receive_response
    completion_source, response_instance, req_type, req_id)
  File "/Users/patricklung/spyder/spyder/plugins/completion/plugin.py", line 167, in gather_and_send
    response_instance.handle_response(req_type, responses)
  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 886, in handle_response
    handler(params)
  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 1143, in process_signatures
    self.log_lsp_handle_errors("Error when processing signature")
  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 917, in log_lsp_handle_errors
    logger.error('%', 1, stack_info=True)
Message: '%'
Arguments: (1,)
--- Logging error ---
Traceback (most recent call last):
  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 1126, in process_signatures
    parameter_data = parameters[parameter_idx]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 1025, in emit
    msg = self.format(record)
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 869, in format
    return fmt.format(record)
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 608, in format
    record.message = record.getMessage()
  File "/Users/patricklung/anaconda3/envs/spyder-dev/lib/python3.7/logging/__init__.py", line 369, in getMessage
    msg = msg % self.args
ValueError: incomplete format
Call stack:
  File "bootstrap.py", line 186, in <module>
    start.main()
  File "/Users/patricklung/spyder/spyder/app/start.py", line 195, in main
    mainwindow.main()
  File "/Users/patricklung/spyder/spyder/app/mainwindow.py", line 3596, in main
    mainwindow = run_spyder(app, options, args)
  File "/Users/patricklung/spyder/spyder/app/mainwindow.py", line 3479, in run_spyder
    app.exec_()
  File "/Users/patricklung/spyder/spyder/app/mainwindow.py", line 3044, in show_preferences
    dlg.exec_()
  File "/Users/patricklung/spyder/spyder/plugins/completion/languageserver/client.py", line 340, in on_msg_received
    handler(resp['result'], req_id)
  File "/Users/patricklung/spyder/spyder/plugins/completion/languageserver/providers/document.py", line 132, in process_signature_completion
    {'params': response})
  File "/Users/patricklung/spyder/spyder/plugins/completion/languageserver/plugin.py", line 245, in receive_response
    self.COMPLETION_CLIENT_NAME, req_id, response)
  File "/Users/patricklung/spyder/spyder/plugins/completion/plugin.py", line 102, in receive_response
    completion_source, response_instance, req_type, req_id)
  File "/Users/patricklung/spyder/spyder/plugins/completion/plugin.py", line 167, in gather_and_send
    response_instance.handle_response(req_type, responses)
  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 886, in handle_response
    handler(params)
  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 1143, in process_signatures
    self.log_lsp_handle_errors("Error when processing signature")
  File "/Users/patricklung/spyder/spyder/plugins/editor/widgets/codeeditor.py", line 917, in log_lsp_handle_errors
    logger.error('%', 1, stack_info=True)
Message: '%'
Arguments: (1,)

Versions

  • Spyder version: 4.0.0.dev0 11611776d
  • Python version: 3.7.4
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Darwin 18.6.0

Dependencies

pygments >=2.0    :  2.4.2 (OK)
qdarkstyle >=2.6.4:  2.7 (OK)
sphinx >=0.6.6    :  2.1.2 (OK)
psutil >=0.3      :  5.6.3 (OK)
pyls >=0.27.0     :  0.28.3 (OK)
nbconvert >=4.0   :  5.5.0 (OK)
pandas >=0.13.1   :  None (NOK)
numpy >=1.7       :  None (NOK)
pympler >=0.7     :  None (NOK)
sympy >=0.7.3     :  None (NOK)
cython >=0.21     :  None (NOK)
qtconsole >=4.5.5 :  4.5.5 (OK)
IPython >=4.0     :  7.8.0 (OK)
matplotlib >=2.0.0:  None (NOK)
pylint >=0.25     :  2.3.1 (OK)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
plunggcommented, Sep 18, 2019

I cannot repro this issue anymore. If I see it in the future, I’ll record a GIF.

1reaction
ccordoba12commented, Sep 17, 2019

@dalthviz, please also try to reproduce this one by checking out beta5 and trying again. I just want to confirm that it’s fixed in master.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Complete Guide to Python IndexError with Exampels - eduCBA
IndexError is one of the built-in exceptions that occur in an application when an index of the list is referenced and that index...
Read more >
How to Fix IndexError in Python - Rollbar
The IndexError in Python occurs when an item from a list is attempted to be accessed that is outside the index range of...
Read more >
How to fix IndexError: invalid index to scalar variable
You are trying to index into a scalar (non-iterable) value: [y[1] for y in y_test] # ^ this is the problem. When you...
Read more >
IndexError: list index out of range - How to Resolve it in Python
In this post, we will be discussing about, how you can easily resolve the "IndexError: list index out of range" error when coding...
Read more >
Python IndexError: List Index Out of Range [Easy Fix] - Finxter
The error “list index out of range” arises if you access invalid indices in your Python list. For example, if you try to...
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