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

Closing error on dash #13339

Open darlainedeme opened 4 years ago

darlainedeme commented 4 years ago

Description

What steps will reproduce the problem?

I closed without stopping dash running. No worry guys.

Traceback

  File "C:\Users\Lenovo\anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\client.py", line 623, in _restart_thread_main
    stderr=self.stderr_handle)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\jupyter_client\manager.py", line 442, in restart_kernel
    self.shutdown_kernel(now=now, restart=True)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\jupyter_client\manager.py", line 385, in shutdown_kernel
    self.request_shutdown(restart=restart)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\jupyter_client\manager.py", line 317, in request_shutdown
    self._connect_control_socket()
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\jupyter_client\manager.py", line 221, in _connect_control_socket
    self._control_socket = self._create_connected_socket('control')
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\jupyter_client\connect.py", line 545, in _create_connected_socket
    sock = self.context.socket(socket_type)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\zmq\sugar\context.py", line 211, in socket
    raise ZMQError(ENOTSUP)
zmq.error.ZMQError: Not supported
Traceback (most recent call last):
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\client.py", line 609, in <lambda>
    lambda: self._finalise_restart(True))
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\client.py", line 644, in _finalise_restart
    sw.spyder_kernel_comm.open_comm(sw.kernel_client)
  File "C:\Users\Lenovo\anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\comms\kernelcomm.py", line 114, in open_comm
    kernel_client.comm_manager.new_comm(self._comm_name, data={
AttributeError: 'NoneType' object has no attribute 'new_comm'

Versions

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.5.0 (OK)
diff_match_patch >=20181111    :  20200713 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.16.1 (OK)
jedi =0.17.1                   :  0.17.1 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  1.1.0 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.7.0                   :  0.7.0 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=1.0                   :  2.4.4 (OK)
pyls >=0.34.0;<1.0.0           :  0.34.1 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.5 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.1.2 (OK)
spyder_kernels >=1.9.2;<1.10.0 :  1.9.2 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  19.0.1 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  3.2.2 (OK)
numpy >=1.7                    :  1.18.5 (OK)
pandas >=0.13.1                :  1.0.5 (OK)
scipy >=0.17.0                 :  1.5.0 (OK)
sympy >=0.7.3                  :  1.6.1 (OK)
goanpeca commented 4 years ago

Hi @nondarloavedere, thanks for the report.

@impact27 thoughts on this?

Thanks!

impact27 commented 4 years ago

I don’t know how kernel_client.comm_manager can be none. The correct thing here would be to show an error message in the shell widget along the line of : can’t restart console

goanpeca commented 4 years ago

Should we check it is not None kernel_client.comm_manager? Or ?

impact27 commented 4 years ago

Sure but if it is None then what? That shouldn’t be the case so I don’t really see how to recover from that error