Repository: spyder-ide/spyder

Issue:
Spyder is opening black DOS windows now
## Description of your problem

**What steps will reproduce the problem?**
1. spyder dev of 2016-09-15
2. start spyder on Windows 10
3. spyder start , but a side-python-screen (process) appears

**What is the expected output? What do you see instead?**

the black side window/process is new, is it a consequence of new ipython connexion method ?

I would suppose maybe we don't want to see it

**Please provide any additional information below**
## Versions and main components
- Spyder Version: github 2016-06-15
- Python Version: 3.4
- Operating system: Windows 10

![spyder-20160915](https://cloud.githubusercontent.com/assets/4312421/18606264/0b2c74d0-7cab-11e6-9fbb-d2351efca19f.PNG)
## Dependencies

jedi >=0.8.1     :  0.9.0 (OK)
matplotlib >=1.0 :  2.0.0b4 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.1 (OK)
pandas >=0.13.1  :  0.19.0rc1 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.6.0 :  1.3.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
pylint >=0.25    :  1.6.4 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.4.6 (OK)
sympy >=0.7.3    :  1.0 (OK)

Please go to the menu entry `Help > Optional Dependencies` (or
`Help > Dependencies`), press the button `Copy to clipboard`
and paste the contents below:



Discussion:
What happens if you open more IPython consoles?

I know how to fix this one, it's just a matter of using `pythonw` to start IPython kernels.

3 Ipython consoles ==> 3 black DOS windows

Yep, just what I imagined. Thanks for checking it @stonebig :-)

I can confirm this behavior on Windows 10, Python 3.6 

jedi >=0.8.1     :  0.9.0 (OK)
matplotlib >=1.0 :  1.5.1 (OK)
nbconvert >=4.0  :  4.2.0 (OK)
numpy >=1.7      :  1.11.1 (OK)
pandas >=0.13.1  :  0.18.1 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.6.0 :  1.3.0 (OK)
pygments >=2.0   :  2.1.3 (OK)
pylint >=0.25    :  1.6.4 (OK)
qtconsole >=4.2.0:  4.2.1 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.4.6 (OK)
sympy >=0.7.3    :  None (NOK)

@stonebig, could you show the full title of cmd window open by Spyder? Right now I can only see up to `winpython-64bit-3.4.x.5\...`

![spyder-20160921b](https://cloud.githubusercontent.com/assets/4312421/18698201/80a9f1ae-7fc8-11e6-8a8b-7f279c3bee72.PNG)

@stonebig, I think there's a bug in `jupyter-client` that prevents me to fix this.

Could you locate this line:

https://github.com/jupyter/jupyter_client/blob/master/jupyter_client/launcher.py#L123

and change it to

```
proc = Popen(cmd, shell=True, **kwargs)
```

to see if the cmd window goes away?


Resolving patch:
diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py
--- a/spyder/plugins/ipythonconsole.py
+++ b/spyder/plugins/ipythonconsole.py
@@ -1221,6 +1221,13 @@ def create_kernel_spec(self):
             os.environ.pop('VIRTUAL_ENV', None)
             pyexec = CONF.get('main_interpreter', 'executable')
 
+        # Fixes Issue #3427
+        if os.name == 'nt':
+            dir_pyexec = osp.dirname(pyexec)
+            pyexec_w = osp.join(dir_pyexec, 'pythonw.exe')
+            if osp.isfile(pyexec_w):
+                pyexec = pyexec_w
+
         # Command used to start kernels
         utils_path = osp.join(spy_path, 'utils', 'ipython')
         kernel_cmd = [


Test patch: