From f0616ffadf1a7afd0ca97875e27898eea03cedf1 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 14 Dec 2022 09:32:45 +0100 Subject: [PATCH] use jupyter_config_dir instead of config_path[0] for workspaces, settings avoids these being siloed in virtualenvs, which is: 1. rarely desirable, I suspect 2. may not be writable --- jupyterlab/commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jupyterlab/commands.py b/jupyterlab/commands.py index 8f2ad4e49b80..0750905c96ef 100644 --- a/jupyterlab/commands.py +++ b/jupyterlab/commands.py @@ -26,7 +26,7 @@ from urllib.error import URLError from urllib.request import Request, quote, urljoin, urlopen -from jupyter_core.paths import jupyter_config_path +from jupyter_core.paths import jupyter_config_dir from jupyter_server.extension.serverextension import ( GREEN_ENABLED, GREEN_OK, @@ -139,14 +139,14 @@ def pjoin(*args): def get_user_settings_dir(): """Get the configured JupyterLab user settings directory.""" settings_dir = os.environ.get("JUPYTERLAB_SETTINGS_DIR") - settings_dir = settings_dir or pjoin(jupyter_config_path()[0], "lab", "user-settings") + settings_dir = settings_dir or pjoin(jupyter_config_dir(), "lab", "user-settings") return osp.abspath(settings_dir) def get_workspaces_dir(): """Get the configured JupyterLab workspaces directory.""" workspaces_dir = os.environ.get("JUPYTERLAB_WORKSPACES_DIR") - workspaces_dir = workspaces_dir or pjoin(jupyter_config_path()[0], "lab", "workspaces") + workspaces_dir = workspaces_dir or pjoin(jupyter_config_dir(), "lab", "workspaces") return osp.abspath(workspaces_dir)