jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
13.81k stars 3.12k forks source link

Cannot toggle extensions at system level #16240

Closed krassowski closed 2 weeks ago

krassowski commented 2 weeks ago

Description

https://github.com/jupyterlab/jupyterlab/pull/16102 introduced a bug which leads to the following error:

traitlets.traitlets.TraitError: The 'write_config_dir' trait of a ConfigManager instance expected a unicode string, not the NoneType None.

https://github.com/jupyterlab/jupyterlab/blob/3206e7c5460c283e6b9333f63ed1bc8260e6a179/jupyterlab/commands.py#L1108-L1131

First, allowed is acting as both a set of allowed actions and as an ordered list but the order in it is:

["all", "user", "sys_prefix", "system", "app", "extension"]

When toggle_extension gets called with system level it then invokes _is_extension_locked with app level; however, app level has no directory associated with it, so the ConfigManager cannot be created in _get_config_manager() of jupyterlab-server.

Reproduce

jupyter labextension disable @jupyterlab/application-extension:faviconbusy --level system

Expected behavior

Context