-
Notifications
You must be signed in to change notification settings - Fork 184
jupyter-core==4.8.1 causes PermissionError on Windows #241
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
Comments
Ironically, we switched to using Path.resolve to solve a different Windows issue: #222 (comment) The discussion in that pytest issue certainly looks like Path.resolve causes issues. Do you happen to have instructions I could use on a Windows machine to try to replicate this? Also, what exact Python version are you using? It seems that the behavior has changed over the years with Python, and possibly moving back to realpath won't help in the future since its behavior seems to have changed as well, if I read the pytest discussion correctly. |
Thanks for the quick response! I did do a little digging and realised just how subtle dealing with these windows paths across various python versions is. To replicate this,
Doing |
Just curious, is it easy for you to check if it still works with jupyter-core 4.7.0 and Python 3.9 (or even 3.8)? My cursory understanding is that they changed realpath (see https://bugs.python.org/issue37993) to behave more like Path.resolve (which is what we were using before the PR mentioned above), so I'm not sure that even reverting to the code in 4.7.0 will help with later versions of Python. |
Ran the tests and here are the results Rather surprised that it worked with python3.9 actually. Currently I'm a bit pinned down to python3.6 but this should change in the near-ish future. |
That is very interesting, thanks for testing! If you have time, can you test Python 3.7? I ask because Python 3.6 is almost EOL (Dec 2021), so if it is a 3.6-specific problem, and not a problem on Python 3.7, it may be easiest to document the issue, recommend those having this issue with 3.6 stay with jupyter_core 4.7.0, and recommend upgrading to Python 3.7. |
Sorry for the late response on this! Looks like something changed in python 3.8 which avoids the error python3.7 + jupyter-core==4.8.1: Fails |
More data: Python 3.7:
Python 3.8:
|
I'm trying to reproduce this problem on Windows. I tried your reproduction steps (within the miniconda prompt). Here,
With this setup, it seems that
On your computer, this similar setup gives that permission error? |
One option is for us to revert the get_home_dir change in line 40 from a942444#diff-e185ceb5aea025405e24e7c43c570a827b66ff50b33e43a99f2d7c66ea192316R41, which was done for consistency with the actual fix in this PR over in line 93. However, this is subtle enough that I'd rather understand more precisely if (a) the change in line 93 is still good, and (b) exactly what the problem is with line 40. |
Unfortunately I don't know much about windows network shares either. I appreciate that this is a very specific issue and it might not be worth rolling back. I have a workaround by downgrading jupyter-core and simultaneously planning to migrate to python 3.8 |
Given that Python 3.7 support ends in 10 months at this point (June 2023), I think either downgrading to jupyter-core 4.7 if you are on Python 3.7 and this issue is a problem, or migrating to Python 3.8+ is a great strategy. |
I upgraded to the latest version of jupyter-core and find that I get the following error
PermissionError: [WinError 5] Access is denied: '<my_home_drive>'
This error seems to be due to the fact that pathlib.Path().resolve() does not work on windows with networkshares. Since my home drive is on a network share, I get a crash from
Is it possible to patch this to avoid using
resolve()
?Related comment from the same issue being discovered in pytest
The text was updated successfully, but these errors were encountered: