Repository: spyder-ide/spyder

Issue:
TypeError: object list can't be used in 'await' expression with PyZMQ 25
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

as soon as I upgraded spyder via 'pip install --upgrade spyder' I found this error while openenig it.

### Traceback
```python-traceback
Uncaught exception in ZMQStream callback
Traceback (most recent call last):
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\eventloop\zmqstream.py", line 584, in _run_callback
    f = callback(*args, **kwargs)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\jupyter_client\threaded.py", line 124, in _handle_recv
    msg_list = self.ioloop._asyncio_event_loop.run_until_complete(get_msg(future_msg))
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\nest_asyncio.py", line 81, in run_until_complete
    return f.result()
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\asyncio\futures.py", line 201, in result
    raise self._exception
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\asyncio\tasks.py", line 256, in __step
    result = coro.send(None)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\jupyter_client\threaded.py", line 35, in get_msg
    return await msg
TypeError: object list can't be used in 'await' expression
Uncaught exception in zmqstream callback
Traceback (most recent call last):
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\eventloop\zmqstream.py", line 621, in _handle_events
    self._handle_recv()
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\eventloop\zmqstream.py", line 650, in _handle_recv
    self._run_callback(callback, msg)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\eventloop\zmqstream.py", line 584, in _run_callback
    f = callback(*args, **kwargs)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\jupyter_client\threaded.py", line 124, in _handle_recv
    msg_list = self.ioloop._asyncio_event_loop.run_until_complete(get_msg(future_msg))
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\nest_asyncio.py", line 81, in run_until_complete
    return f.result()
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\asyncio\futures.py", line 201, in result
    raise self._exception
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\asyncio\tasks.py", line 256, in __step
    result = coro.send(None)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\jupyter_client\threaded.py", line 35, in get_msg
    return await msg
TypeError: object list can't be used in 'await' expression
Exception in callback AddThreadSelectorEventLoop._handle_select([4164], [])
handle: <Handle AddThreadSelectorEventLoop._handle_select([4164], [])>
Traceback (most recent call last):
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\tornado\platform\asyncio.py", line 647, in _handle_select
    self._handle_event(r, self._readers)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\tornado\platform\asyncio.py", line 661, in _handle_event
    callback()
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\tornado\platform\asyncio.py", line 206, in _handle_events
    handler_func(fileobj, events)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\eventloop\zmqstream.py", line 621, in _handle_events
    self._handle_recv()
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\eventloop\zmqstream.py", line 650, in _handle_recv
    self._run_callback(callback, msg)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\zmq\eventloop\zmqstream.py", line 584, in _run_callback
    f = callback(*args, **kwargs)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\jupyter_client\threaded.py", line 124, in _handle_recv
    msg_list = self.ioloop._asyncio_event_loop.run_until_complete(get_msg(future_msg))
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\nest_asyncio.py", line 81, in run_until_complete
    return f.result()
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\asyncio\futures.py", line 201, in result
    raise self._exception
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\asyncio\tasks.py", line 256, in __step
    result = coro.send(None)
  File "C:\Users\elham\AppData\Local\Programs\Python\Python39\lib\site-packages\jupyter_client\threaded.py", line 35, in get_msg
    return await msg
TypeError: object list can't be used in 'await' expression
```

## Versions

* Spyder version: 5.4.1  (pip)
* Python version: 3.9.10 64-bit
* 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           :  2.0.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;<9.0.0       :  7.32.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.4.0 (OK)
keyring >=17.0.0              :  23.5.0 (OK)
nbconvert >=4.0               :  6.4.2 (OK)
numpydoc >=0.6.0              :  1.2 (OK)
paramiko >=2.4.0              :  2.9.2 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0;<3.0           :  2.15.10 (OK)
pylint_venv >=2.1.1           :  2.3.0 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.7.0;<1.8.0          :  1.7.0 (OK)
pylsp_black >=1.2.0           :  1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.2 (OK)
qstylizer >=0.2.2             :  0.2.2 (OK)
qtawesome >=1.2.1             :  1.2.2 (OK)
qtconsole >=5.4.0;<5.5.0      :  5.4.0 (OK)
qtpy >=2.1.0                  :  2.3.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  58.1.0 (OK)
sphinx >=0.6.6                :  4.4.0 (OK)
spyder_kernels >=2.4.1;<2.5.0 :  2.4.1 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=22.1.0                  :  25.0.0 (OK)

# Optional:
cython >=0.21                 :  0.29.28 (OK)
matplotlib >=3.0.0            :  3.5.1 (OK)
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)
```

### Environment

<details><summary>Environment</summary>

```
Package                       Version
----------------------------- -------------------
absl-py                       1.0.0
alabaster                     0.7.12
appdirs                       1.4.4
arrow                         1.2.2
astroid                       2.13.2
astunparse                    1.6.3
atomicwrites                  1.4.0
attrs                         21.4.0
autopep8                      1.6.0
Babel                         2.9.1
backcall                      0.2.0
bcrypt                        3.2.0
beautifulsoup4                4.10.0
binaryornot                   0.4.4
black                         22.12.0
bleach                        4.1.0
cachetools                    5.0.0
certifi                       2021.10.8
cffi                          1.15.0
chardet                       4.0.0
charset-normalizer            2.0.12
click                         8.0.4
cloudpickle                   2.0.0
colorama                      0.4.6
comm                          0.1.2
cookiecutter                  1.7.3
cryptography                  36.0.1
cuda-python                   11.6.0
cupy-cuda115                  10.2.0
cycler                        0.11.0
Cython                        0.29.28
debugpy                       1.5.1
decorator                     5.1.1
defusedxml                    0.7.1
diff-match-patch              20200713
dill                          0.3.6
docopt                        0.6.2
docstring-to-markdown         0.11
docutils                      0.17.1
entrypoints                   0.4
fastrlock                     0.8
flake8                        6.0.0
flatbuffers                   2.0
fonttools                     4.29.1
gast                          0.5.3
google-auth                   2.6.0
google-auth-oauthlib          0.4.6
google-pasta                  0.2.0
grpcio                        1.44.0
h5py                          3.6.0
idna                          3.3
imagesize                     1.3.0
importlib-metadata            4.11.2
inflection                    0.5.1
intervaltree                  3.1.0
ipykernel                     6.20.1
ipython                       7.32.0
ipython-genutils              0.2.0
isort                         5.10.1
jedi                          0.18.1
jellyfish                     0.9.0
Jinja2                        3.0.3
jinja2-time                   0.2.0
joblib                        1.1.0
Js2Py                         0.71
jsonschema                    4.4.0
jupyter_client                7.4.8
jupyter-core                  4.9.2
jupyterlab-pygments           0.1.2
keras                         2.8.0
Keras-Preprocessing           1.1.2
keyring                       23.5.0
kiwisolver                    1.3.2
lazy-object-proxy             1.7.1
libclang                      13.0.0
Mako                          1.1.6
Markdown                      3.3.6
MarkupSafe                    2.1.0
matplotlib                    3.5.1
matplotlib-inline             0.1.3
mccabe                        0.7.0
mistune                       0.8.4
mypy-extensions               0.4.3
nbclient                      0.5.11
nbconvert                     6.4.2
nbformat                      5.1.3
nest-asyncio                  1.5.4
numpy                         1.22.2
numpydoc                      1.2
oauthlib                      3.2.0
opt-einsum                    3.3.0
packaging                     23.0
pandas                        1.4.1
pandocfilters                 1.5.0
paramiko                      2.9.2
parso                         0.8.3
pathspec                      0.9.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.0.1
pip                           22.3.1
pipwin                        0.5.1
platformdirs                  2.5.1
pluggy                        1.0.0
poyo                          0.5.0
prompt-toolkit                3.0.28
protobuf                      3.19.4
psutil                        5.9.0
ptyprocess                    0.7.0
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pycodestyle                   2.10.0
pycparser                     2.21
pycuda                        2021.1+cuda115
pydocstyle                    6.1.1
pyflakes                      3.0.1
Pygments                      2.11.2
pyjsparser                    2.7.1
pylint                        2.15.10
pylint-venv                   2.3.0
pyls-spyder                   0.4.0
PyNaCl                        1.5.0
pyparsing                     3.0.7
PyPrind                       2.11.3
PyQt5                         5.12.3
PyQt5-sip                     12.9.1
PyQtWebEngine                 5.12.1
pyrsistent                    0.18.1
pySmartDL                     1.3.4
python-dateutil               2.8.2
python-lsp-black              1.2.1
python-lsp-jsonrpc            1.0.0
python-lsp-server             1.7.0
python-slugify                6.1.1
pytoolconfig                  1.2.4
pytools                       2022.1
pytz                          2021.3
pytz-deprecation-shim         0.1.0.post0
pywin32                       303
pywin32-ctypes                0.2.0
pyzmq                         25.0.0
QDarkStyle                    3.0.2
qstylizer                     0.2.2
QtAwesome                     1.2.2
qtconsole                     5.4.0
QtPy                          2.3.0
requests                      2.27.1
requests-oauthlib             1.3.1
rope                          1.6.0
rsa                           4.8
Rtree                         0.9.7
scikit-learn                  1.0.2
scipy                         1.8.0
setuptools                    58.1.0
six                           1.16.0
sklearn                       0.0
snowballstemmer               2.2.0
sortedcontainers              2.4.0
soupsieve                     2.3.1
Sphinx                        4.4.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.4.1
spyder-kernels                2.4.1
tensorboard                   2.8.0
tensorboard-data-server       0.6.1
tensorboard-plugin-wit        1.8.1
tensorflow                    2.8.0
tensorflow-io-gcs-filesystem  0.24.0
termcolor                     1.1.0
testpath                      0.6.0
text-unidecode                1.3
textdistance                  4.2.2
tf-estimator-nightly          2.8.0.dev2021122109
threadpoolctl                 3.1.0
three-merge                   0.1.1
tinycss2                      1.1.1
toml                          0.10.2
tomli                         2.0.1
tomlkit                       0.11.6
tornado                       6.2
traitlets                     5.8.1
typing_extensions             4.1.1
tzdata                        2021.5
tzlocal                       4.1
ujson                         5.1.0
urllib3                       1.26.8
watchdog                      2.1.6
wcwidth                       0.2.5
webencodings                  0.5.1
Werkzeug                      2.0.3
whatthepatch                  1.0.3
wheel                         0.37.1
wrapt                         1.13.3
yapf                          0.32.0
zipp                          3.7.0

```
</details>



Discussion:
Hey @najafi82, thanks for reporting. This is an issue with pyzmq 25, which was released some hours ago. Please downgrade to pyzmq 24 in the meantime to have Spyder working again.
I submitted a pull request to fix this to Jupyter-client: https://github.com/jupyter/jupyter_client/pull/914.
My pull request was merged and released in Jupyter-client 7.4.9, so you need to update to that version. I'll add this requirement to Spyder-kernels too so other people don't encounter this issue.

Resolving patch:
diff --git a/external-deps/spyder-kernels/setup.py b/external-deps/spyder-kernels/setup.py
--- a/external-deps/spyder-kernels/setup.py
+++ b/external-deps/spyder-kernels/setup.py
@@ -44,7 +44,7 @@ def get_version(module='spyder_kernels'):
     'ipython<6; python_version<"3"',
     'ipython>=7.31.1,<9; python_version>="3"',
     'jupyter-client>=5.3.4,<6; python_version<"3"',
-    'jupyter-client>=7.3.4,<8; python_version>="3"',
+    'jupyter-client>=7.4.9,<8; python_version>="3"',
     'pyzmq>=17,<20; python_version<"3"',
     'pyzmq>=22.1.0; python_version>="3"',
     'wurlitzer>=1.0.3;platform_system!="Windows"',


Test patch: