spyder-ide / spyder

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

Spyder crashing when holding `Ctrl + W` with focus on the IPython Console #21415

Open Techguy109 opened 1 year ago

Techguy109 commented 1 year ago

Description

What steps will reproduce the problem?

Holding Ctrl+W while the cursor is in the console.

Traceback

Exception in thread Thread-437:
Traceback (most recent call last):
  File "C:\Users\dinan\Anaconda\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Users\dinan\Anaconda\Lib\site-packages\jupyter_client\channels.py", line 112, in run
    loop.run_until_complete(self._async_run())
  File "C:\Users\dinan\Anaconda\Lib\site-packages\nest_asyncio.py", line 90, in run_until_complete
    return f.result()
           ^^^^^^^^^^
  File "C:\Users\dinan\Anaconda\Lib\asyncio\futures.py", line 203, in result
    raise self._exception.with_traceback(self._exception_tb)
  File "C:\Users\dinan\Anaconda\Lib\asyncio\tasks.py", line 267, in __step
    result = coro.send(None)
             ^^^^^^^^^^^^^^^
  File "C:\Users\dinan\Anaconda\Lib\site-packages\jupyter_client\channels.py", line 146, in _async_run
    self._create_socket()
  File "C:\Users\dinan\Anaconda\Lib\site-packages\jupyter_client\channels.py", line 102, in _create_socket
    self.socket = self.context.socket(zmq.REQ)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dinan\Anaconda\Lib\site-packages\zmq\sugar\context.py", line 259, in socket
    s: ST = self._socket_class(  # set PYTHONTRACEMALLOC=2 to get the calling frame
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dinan\Anaconda\Lib\site-packages\zmq\_future.py", line 221, in __init__
    super().__init__(context, socket_type, **kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dinan\Anaconda\Lib\site-packages\zmq\sugar\socket.py", line 93, in __init__
    super().__init__(*a, **kw)
  File "zmq\backend\cython\socket.pyx", line 330, in zmq.backend.cython.socket.Socket.__init__
zmq.error.ZMQError: Too many open files

Versions

Dependencies

# Mandatory:
atomicwrites >=1.2.0                             :  1.4.0 (OK)
chardet >=2.0.0                                  :  4.0.0 (OK)
cloudpickle >=0.5.0                              :  2.2.1 (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,!=8.8.0,!=8.9.0,!=8.10.0 :  8.12.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.17.3 (OK)
keyring >=17.0.0                                 :  23.13.1 (OK)
nbconvert >=4.0                                  :  6.5.4 (OK)
numpydoc >=0.6.0                                 :  1.5.0 (OK)
paramiko >=2.4.0                                 :  2.8.1 (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.15.1 (OK)
pylint >=2.5.0,<3.0                              :  2.16.2 (OK)
pylint_venv >=2.1.1                              :  2.3.0 (OK)
pyls_spyder >=0.4.0                              :  0.4.0 (OK)
pylsp >=1.7.2,<1.8.0                             :  1.7.2 (OK)
pylsp_black >=1.2.0                              :  1.2.1 (OK)
qdarkstyle >=3.0.2,<3.2.0                        :  3.0.2 (OK)
qstylizer >=0.2.2                                :  0.2.2 (OK)
qtawesome >=1.2.1                                :  1.2.2 (OK)
qtconsole >=5.4.2,<5.5.0                         :  5.4.2 (OK)
qtpy >=2.1.0                                     :  2.2.0 (OK)
rtree >=0.9.7                                    :  1.0.1 (OK)
setuptools >=49.6.0                              :  68.0.0 (OK)
sphinx >=0.6.6                                   :  5.0.2 (OK)
spyder_kernels >=2.4.3,<2.5.0                    :  2.4.3 (OK)
textdistance >=4.2.0                             :  4.2.1 (OK)
three_merge >=0.1.1                              :  0.1.1 (OK)
watchdog >=0.10.3                                :  2.1.6 (OK)
zmq >=22.1.0                                     :  23.2.0 (OK)

# Optional:
cython >=0.21                                    :  None (NOK)
matplotlib >=3.0.0                               :  3.7.1 (OK)
numpy >=1.7                                      :  1.24.3 (OK)
pandas >=1.1.1                                   :  1.5.3 (OK)
scipy >=0.17.0                                   :  1.10.1 (OK)
sympy >=0.7.3                                    :  1.11.1 (OK)
dalthviz commented 1 year ago

Hi @Techguy109 thank you for the feedback! Not totally sure but maybe this could be related with https://github.com/spyder-ide/spyder/issues/19336 ?

Also, checking this locally, although maybe I'm not doing enought to get the traceback, I'm seeing that the console is getting killed when using the Ctrl + W shortcut (which checking I think is used to remove the input in the console or at least that is what is I'm seeing when using it on IPython directly):

shortcut_kill

shortcut_ipython

So definetly something abnormal is happening here 🤔 What do you think @ccordoba12 ?