Just triggers on opening Spyder:
```File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\base.py", line 331, in
toggled=lambda checked: self.toggle_view(checked),
File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\plugin.py", line 207, in toggle_view
self.create_new_client(give_focus=False)
File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\plugin.py", line 703, in create_new_client
self.register_client(client)
File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\plugin.py", line 918, in register_client
shellwidget.set_cwd(cwd_path)
File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\shell.py", line 178, in set_cwd
self.call_kernel(interrupt=True).set_cwd(dirname)
File "C:\Users...\Anaconda3\lib\site-packages\spyder_kernels\comms\commbase.py", line 538, in __call__
call_dict, call_data, self._comm_id)
File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\comms\kernelcomm.py", line 130, in _get_call_return_value
with self.comm_channel_manager(comm_id, queue_message=not interrupt):
File "C:\Users...\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\comms\kernelcomm.py", line 87, in comm_channel_manager
timeout)
File "C:\Users...\Anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\comms\kernelcomm.py", line 168, in _wait
raise TimeoutError(timeout_msg)
TimeoutError: Timeout while waiting for comm port.
## Versions
* Spyder version: 4.1.2
* Python version: 3.7.3
* Qt version: 5.9.6
* PyQt5 version: 5.9.2
* Operating System: Windows 10
### Dependencies
atomicwrites >=1.2.0 : 1.3.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
cloudpickle >=0.5.0 : 1.3.0 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
IPython >=4.0 : 7.13.0 (OK)
jedi =0.15.2 : 0.15.2 (OK)
nbconvert >=4.0 : 5.6.1 (OK)
numpydoc >=0.6.0 : 0.9.2 (OK)
paramiko >=2.4.0 : 2.7.1 (OK)
parso =0.5.2 : 0.5.2 (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 >=0.25 : 2.4.4 (OK)
pyls >=0.31.9;<0.32.0 : 0.31.9 (OK)
qdarkstyle >=2.8 : 2.8 (OK)
qtawesome >=0.5.7 : 0.7.0 (OK)
qtconsole >=4.6.0 : 4.7.2 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
rtree >=0.8.3 : 0.9.3 (OK)
sphinx >=0.6.6 : 2.4.4 (OK)
spyder_kernels >=1.9.0;<1.10.0 : 1.9.0 (OK)
watchdog : None (OK)
zmq >=17 : 18.1.1 (OK)
cython >=0.21 : 0.29.15 (OK)
matplotlib >=2.0.0 : 3.1.3 (OK)
numpy >=1.7 : 1.18.1 (OK)
pandas >=0.13.1 : 1.0.3 (OK)
scipy >=0.17.0 : 1.4.1 (OK)
sympy >=0.7.3 : 1.5.1 (OK)
spyder_notebook : 0.2.2 (OK)
```
OK. My bad. Turns out the IPython settings were pointing to the wrong place for a file to run on startup. I've changed them now and it seems to work.
Do you have a reproducible way of generating this error? We have this one often but I am not clear on what exactly is happening because I was never able to replicate it.
Your mileage may vary, but it replicates on my machine if I:
1) set up a python script to run via tools > Preferences > ipython console > startup
2) rename the file or move it or whatever (it doesn't seem to make a difference if spyder is running or not when I do this)
3) launch spyder or relaunch the console
It works again if you either rename the file to its original name, or choose a different file. Of course something more complicated may be going on, but it seems pretty simple on my machine.
Is it the case that if you do that then you can't use the console? If this is the case can you reopen this issue? Because then the bug is:
- set up a python script to run via tools > Preferences > ipython console > startup
- rename the file or move it or whatever (it doesn't seem to make a difference if spyder is running or not when I do this)
- launch spyder or relaunch the console
Which prevents the console from opening
Yes. The console won't open and you get the timeout error message. I don't know much about Spyder's innards, but I'd imagine that it's a mishandled error because it cant find the setup script file - so instead of just ploughing on, or informing the user, it falls over.
Apparently ipython does handle the error by exiting the kernel:
https://github.com/ipython/ipython/blob/95d5171b7b79a660cdfb318a5e9b99dd948b55e6/IPython/core/shellapp.py#L427
I added a check at the spyder-kernel level to avoid this
Most helpful comment
Apparently ipython does handle the error by exiting the kernel:
https://github.com/ipython/ipython/blob/95d5171b7b79a660cdfb318a5e9b99dd948b55e6/IPython/core/shellapp.py#L427
I added a check at the spyder-kernel level to avoid this