Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear Console not working on Windows #10762

Closed
Alex-np opened this issue Nov 19, 2019 · 8 comments · Fixed by ipython/ipykernel#500
Closed

Clear Console not working on Windows #10762

Alex-np opened this issue Nov 19, 2019 · 8 comments · Fixed by ipython/ipykernel#500

Comments

@Alex-np
Copy link

Alex-np commented Nov 19, 2019

Description

What steps will reproduce the problem?

%clear
The system cannot find the path specified.

Versions

  • Spyder version: 4.0.0b5
  • Python version: 3.7.3
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies

cloudpickle >=0.5.0          :  1.2.1 (OK)
pygments >=2.0               :  2.4.2 (OK)
qtconsole >=4.5.5            :  4.5.5 (OK)
nbconvert >=4.0              :  5.5.0 (OK)
sphinx >=0.6.6               :  2.1.2 (OK)
pylint >=0.25                :  2.3.1 (OK)
psutil >=0.3                 :  5.6.3 (OK)
qtawesome >=0.5.7            :  0.5.7 (OK)
qtpy >=1.5.0                 :  1.8.0 (OK)
pickleshare >=0.4            :  0.7.5 (OK)
zmq >=17                     :  18.0.0 (OK)
chardet >=2.0.0              :  3.0.4 (OK)
numpydoc >=0.6.0             :  0.9.1 (OK)
spyder_kernels >=1.5.0;<2.0.0:  1.5.0 (OK)
qdarkstyle >=2.7             :  2.7 (OK)
atomicwrites >=1.2.0         :  1.3.0 (OK)
diff_match_patch >=20181111  :  20181111 (OK)
watchdog                     :  None (OK)
keyring                      :  None (OK)
pexpect >=4.4.0              :  4.7.0 (OK)
pympler                      :  None (OK)
sympy >=0.7.3                :  1.4 (OK)
cython >=0.21                :  0.29.12 (OK)
IPython >=4.0                :  7.6.1 (OK)
matplotlib >=2.0.0           :  3.1.0 (OK)
pandas >=0.13.1              :  0.24.2 (OK)
numpy >=1.7                  :  1.16.4 (OK)
scipy >=0.17.0               :  1.2.1 (OK)
pyls >=0.28.2;<0.29.0        :  0.28.3 (OK)
rtree >=0.8.3                :  0.8.3 (OK)
@ccordoba12 ccordoba12 added this to the 4.1.0 milestone Nov 25, 2019
@ccordoba12 ccordoba12 changed the title Clear Consol not working Clear Console not working on Windows Nov 25, 2019
@ccordoba12
Copy link
Member

This happens when your current working directory is a network mount. So avoid that until we fix it.

@darth3PO
Copy link

Same issue here with Spyder 3.3.6 as well. All other package versions being the same.

Things do work properly if the drive is mounted X:\Folder\To\Project but do not with just a network folder \\server.com\with\additional\Folder\To\Project\

@ccordoba12 ccordoba12 removed the v4.2.0 label Mar 18, 2020
@ccordoba12
Copy link
Member

This looks like a bug in IPython. We'll submit a pull request there to fix it.

@ccordoba12 ccordoba12 added this to the Sprint April milestone Apr 4, 2020
@dalthviz
Copy link
Member

dalthviz commented Apr 6, 2020

Checking the issues of IPython seems like this is related to ipython/ipython#11488

@ccordoba12
Copy link
Member

Great work finding the issue there @dalthviz! Then, as I suspected, we need to submit a PR there to fix things here. Please do that.

@dalthviz
Copy link
Member

dalthviz commented Apr 6, 2020

Doing some testing, and after reading more carefully the issue in IPython (where the user specifies he is using Spyder 3.3.1), seems like the issue is actually in QtConsole and it's not only affecting the clear magic but also other magics like ls:

image

Testing with IPython the clear magic cls works as expected

@dalthviz
Copy link
Member

dalthviz commented Apr 8, 2020

Note: Probably we need to detect that a cd is being executed with an UNC path and change the actually command being executed to one using pushd (cmd doesn't support UNC paths by default). Using pushd mounts the UNC path to a drive.

Relevant code to check:
https://github.com/ipython/ipython/blob/a0c21526a456347f5f1f397dfb58bd0e7412e235/IPython/core/interactiveshell.py#L2468

https://github.com/ipython/ipython/blob/a0c21526a456347f5f1f397dfb58bd0e7412e235/IPython/utils/_process_win32.py#L37

Edit: The change needs to be implemented in ZMQInteractiveShell (ipykernel) or the InteractiveShell (IPython). The system_piped method needs to use AvoidUNCPath as is done in system_raw to handle UNC paths. Launching IPython from the cmd works without this since TerminalInteractiveShell uses system_raw as default handler for the system commands.

@ccordoba12
Copy link
Member

This is fixed in ipykernel 5.2.1. Conda packages should be available soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants