TypeError when processing completion signatures
See original GitHub issueDescription
What steps will reproduce the problem?
Not sure if this is spyder or tqdm: I’m attempting to use the tqdm library and walrus operator to make a progress bar on a for loop, e.g.:
from tqdm import tqdm
for i in (pbar := tqdm(mydict.items())):
pbar.set_description("processing mydict")
dosomething()
This error occurs immediately on typing opening parenthesis on set_description( or after tqdm(, so possibly a problem with linting or real time code checking? I do not need to run anything through the console, it occurs while typing in the Editor. Also, the line with the for loop still shows ‘invalid syntax: pyflakes E’.
Traceback
Traceback (most recent call last):
File "C:\Users\tswailes\AppData\Local\Programs\Python\Python39\lib\site-packages\spyder\plugins\completion\providers\languageserver\client.py", line 558, in on_msg_received
handler(resp['result'], req_id)
File "C:\Users\tswailes\AppData\Local\Programs\Python\Python39\lib\site-packages\spyder\plugins\completion\providers\languageserver\providers\document.py", line 155, in process_signature_completion
if len(response['signatures']) > 0:
TypeError: list indices must be integers or slices, not str
Versions
- Spyder version: 5.3.0
- Python version: 3.9.0
- Qt version: 5.12.10
- PyQt5 version: 5.12.3
- Operating System: Windows 10
Dependencies
# Mandatory:
atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 4.0.0 (OK)
cloudpickle >=0.5.0 : 1.6.0 (OK)
cookiecutter >=1.6.0 : 1.7.3 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree >=3.0.2 : 3.1.0 (OK)
IPython >=7.31.1;<8.0.0 : 7.32.0 (OK)
jedi >=0.17.2;<0.19.0 : 0.17.2 (OK)
jellyfish >=0.7 : 0.9.0 (OK)
jsonschema >=3.2.0 : 3.2.0 (OK)
keyring >=17.0.0 : 23.0.0 (OK)
nbconvert >=4.0 : 6.0.7 (OK)
numpydoc >=0.6.0 : 1.1.0 (OK)
paramiko >=2.4.0 : 2.7.2 (OK)
parso >=0.7.0;<0.9.0 : 0.7.0 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.8.0 (OK)
pygments >=2.0 : 2.8.1 (OK)
pylint >=2.5.0 : 2.7.2 (OK)
pyls_spyder >=0.4.0 : 0.4.0 (OK)
pylsp >=1.4.1;<1.5.0 : 1.4.1 (OK)
pylsp_black >=1.2.0 : 1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0 : 3.0.2 (OK)
qstylizer >=0.1.10 : 0.2.1 (OK)
qtawesome >=1.0.2 : 1.0.2 (OK)
qtconsole >=5.3.0;<5.4.0 : 5.3.0 (OK)
qtpy >=2.0.1 : 2.0.1 (OK)
rtree >=0.9.7 : 0.9.7 (OK)
setuptools >=49.6.0 : 60.9.3 (OK)
sphinx >=0.6.6 : 3.5.2 (OK)
spyder_kernels >=2.3.0;<2.4.0 : 2.3.0 (OK)
textdistance >=4.2.0 : 4.2.1 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3 : 1.0.2 (OK)
zmq >=17 : 22.3.0 (OK)
# Optional:
cython >=0.21 : None (NOK)
matplotlib >=3.0.0 : None (NOK)
numpy >=1.7 : 1.22.2 (OK)
pandas >=1.1.1 : 1.4.1 (OK)
scipy >=0.17.0 : 1.8.0 (OK)
sympy >=0.7.3 : None (NOK)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How do I prevent the error "Index signature of object type ...
First was child of other. I did following: Added index signature in parent interface. Used appropriate type using as keyword. Complete code is...
Read more >7 Multiprocessing Pool Common Errors in Python
Fixing this error involves updating the signature of your callback function to include the result from the task. 1. 2. 3. # result...
Read more >[aws-sdk/signature-v4] getCanonicalHeaders fails on ... - GitHub
Describe the bug Our team noticed the other day that our lambda function was failing due to the following error: TypeError: Cannot read ......
Read more >inspect — Inspect live objects — Python 3.11.1 documentation
Raises ValueError if no signature can be provided, and TypeError if that type of object is not supported. Also, if the annotations are...
Read more >Futures and error handling | Dart
... error handling, you can register a second ( onError ) callback within then() to handle Futures completed with errors. Here is then()...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @rhkarls for the reproducible case! I’m also seeing this error in the latest Spyder. We’ll try to fix it in our next version (5.3.1), to be released in a couple of weeks.
@rhkarls interesting, this is definitely the same behaviour I was getting with an error right after typing the opening bracket. I don’t get the same error with your code example though, since updating jedi and parso. I just tried a fresh install of spyder 5.3.0 into a venv and can’t replicate the error there either - so perhaps it’s something completely external? This is my package list at the moment where everything seems to be working correctly:
Package Version
alabaster 0.7.12 arrow 1.2.2 astroid 2.11.3 atomicwrites 1.4.0 attrs 21.4.0 autopep8 1.6.0 Babel 2.10.1 backcall 0.2.0 bcrypt 3.2.0 beautifulsoup4 4.11.1 binaryornot 0.4.4 black 22.3.0 bleach 5.0.0 certifi 2021.10.8 cffi 1.15.0 chardet 4.0.0 charset-normalizer 2.0.12 click 8.1.3 cloudpickle 2.0.0 colorama 0.4.4 cookiecutter 1.7.3 cryptography 37.0.1 debugpy 1.6.0 decorator 5.1.1 defusedxml 0.7.1 diff-match-patch 20200713 dill 0.3.4 docutils 0.17.1 entrypoints 0.4 fastjsonschema 2.15.3 flake8 4.0.1 idna 3.3 imagesize 1.3.0 importlib-metadata 4.11.3 inflection 0.5.1 intervaltree 3.1.0 ipykernel 6.13.0 ipython 7.33.0 ipython-genutils 0.2.0 isort 5.10.1 jedi 0.18.1 jellyfish 0.9.0 Jinja2 3.1.2 jinja2-time 0.2.0 joblib 1.1.0 jsonschema 4.4.0 jupyter-client 7.3.0 jupyter-core 4.10.0 jupyterlab-pygments 0.2.2 keyring 23.5.0 lazy-object-proxy 1.7.1 MarkupSafe 2.1.1 matplotlib-inline 0.1.3 mccabe 0.6.1 mistune 0.8.4 mypy-extensions 0.4.3 nbclient 0.6.0 nbconvert 6.5.0 nbformat 5.3.0 nest-asyncio 1.5.5 numpy 1.22.3 numpydoc 1.2.1 packaging 21.3 pandocfilters 1.5.0 paramiko 2.10.4 parso 0.8.3 pathspec 0.9.0 pexpect 4.8.0 pickleshare 0.7.5 pip 20.2.3 platformdirs 2.5.2 pluggy 1.0.0 poyo 0.5.0 prompt-toolkit 3.0.29 psutil 5.9.0 ptyprocess 0.7.0 pycodestyle 2.8.0 pycparser 2.21 pydocstyle 6.1.1 pyflakes 2.4.0 Pygments 2.12.0 pylint 2.13.7 pyls-spyder 0.4.0 PyNaCl 1.5.0 pyparsing 3.0.8 PyQt5 5.15.6 PyQt5-Qt5 5.15.2 PyQt5-sip 12.10.1 PyQtWebEngine 5.15.5 PyQtWebEngine-Qt5 5.15.2 pyrsistent 0.18.1 python-dateutil 2.8.2 python-lsp-black 1.2.1 python-lsp-jsonrpc 1.0.0 python-lsp-server 1.4.1 python-slugify 6.1.2 pytz 2022.1 pywin32 303 pywin32-ctypes 0.2.0 pyzmq 22.3.0 QDarkStyle 3.0.3 qstylizer 0.2.1 QtAwesome 1.1.1 qtconsole 5.3.0 QtPy 2.0.1 requests 2.27.1 rope 1.0.0 Rtree 1.0.0 scikit-learn 1.0.2 scipy 1.8.0 setuptools 62.1.0 six 1.16.0 sklearn 0.0 snowballstemmer 2.2.0 sortedcontainers 2.4.0 soupsieve 2.3.2.post1 Sphinx 4.5.0 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 spyder 5.3.0 spyder-kernels 2.3.0 text-unidecode 1.3 textdistance 4.2.2 threadpoolctl 3.1.0 three-merge 0.1.1 tinycss2 1.1.1 toml 0.10.2 tomli 2.0.1 tornado 6.1 tqdm 4.64.0 traitlets 5.1.1 typing-extensions 4.2.0 ujson 5.2.0 urllib3 1.26.9 watchdog 2.1.7 wcwidth 0.2.5 webencodings 0.5.1 wrapt 1.14.0 yapf 0.32.0 zipp 3.8.0