Skip to content

Commit

Permalink
Return canonical path when using %APPDATA% on NT
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbussmann committed Apr 5, 2021
1 parent e69a436 commit ad09dbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jupyter_core/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def jupyter_data_dir():
elif os.name == 'nt':
appdata = os.environ.get('APPDATA', None)
if appdata:
return pjoin(appdata, 'jupyter')
return os.path.realpath(pjoin(appdata, 'jupyter'))
else:
return pjoin(jupyter_config_dir(), 'data')
else:
Expand Down
8 changes: 4 additions & 4 deletions jupyter_core/tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def test_data_dir_darwin():
def test_data_dir_windows():
with windows, appdata:
data = jupyter_data_dir()
assert data == pjoin('appdata', 'jupyter')
assert data == realpath(pjoin('appdata', 'jupyter'))

with windows, appdata, xdg:
# windows should ignore xdg
data = jupyter_data_dir()
assert data == pjoin('appdata', 'jupyter')
assert data == realpath(pjoin('appdata', 'jupyter'))


def test_data_dir_linux():
Expand Down Expand Up @@ -155,12 +155,12 @@ def test_runtime_dir_darwin():
def test_runtime_dir_windows():
with windows, appdata:
runtime = jupyter_runtime_dir()
assert runtime == pjoin('appdata', 'jupyter', 'runtime')
assert runtime == realpath(pjoin('appdata', 'jupyter', 'runtime'))

with windows, appdata, xdg:
# windows should ignore xdg
runtime = jupyter_runtime_dir()
assert runtime == pjoin('appdata', 'jupyter', 'runtime')
assert runtime == realpath(pjoin('appdata', 'jupyter', 'runtime'))


def test_runtime_dir_linux():
Expand Down

0 comments on commit ad09dbf

Please sign in to comment.