Skip to content

After SigimaX merge, datalab point to the wrong settings folder #362

Description

@StefanoPierini-Codra

Bug: user plugin directory resolves to .none instead of .DataLab_v1

Component: datalab.config / datalab.plugins
Affected version: 1.3.0 (develop, unreleased — last tag is v1.2.2)
Type: regression, introduced by the SigimaX extraction
Severity: medium — no data loss, but user plugins silently stop being discovered

Symptom

The default user plugin directory changed from ~/.config/.DataLab_v1/plugins to ~/.config/.none/plugins (on Windows: %USERPROFILE%\.DataLab_v1\plugins%USERPROFILE%\.none\plugins).

Consequences:

  • plugins previously installed by the user are no longer loaded;
  • the path shown in Plugins > Configure plugins... points to the wrong directory, so newly installed plugins land in .none too;
  • a stray ~/.config/.none/ directory is created on every startup.

Root cause

datalab/plugins.py resolves its default path at import time:

PLUGINS_DEFAULT_PATH = get_config_path("plugins")

if not osp.isdir(PLUGINS_DEFAULT_PATH):
    os.makedirs(PLUGINS_DEFAULT_PATH)

get_config_path() delegates to the guidata UserConfig backend held in sigimax.utils.conf.CONF. UserConfig.__init__ sets self.name = "none", and UserConfig.get_path() resolves — and creates~/.config/.{self.name}/…. The name only becomes correct once set_application() is called.

Before the SigimaX extraction the configuration was initialized while the config module itself was imported, so the name was always bound early enough. Now initialization is explicit and deferred (initialize() / ensure_initialized()), and it runs after datalab.app has imported datalab.gui.maindatalab.plugins. At that point CONF.name is still "none", so the plugin path is frozen to ~/.config/.none/plugins.

The failure is silent: no exception, no warning, just a wrong (and freshly created) directory.

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions