sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

Overriding modules are reloaded if package is being disabled

Open deathaxe opened this issue 5 months ago • 2 comments

Description of the bug

If plugins of a MyPackage.sublime-package are overriden, but the overriding package doesn't contain a .python-version file, setting "ignored_packages": ["MyPackage"] causes the overriding plugin plugin.py to be re-loaded.

folder structure:

Installed Packages
  - MyPackage.sublime-package
    - .python-version
    - plugin.py

Packages
  - MyPackage
    - plugin.py

If MyPackage is ignored, .python-version is no longer visible, which causes Packages/plugin.py to switch plugin hosts (unloaded from 3.8 -> reloaded to 3.3).

If "disable_plugin_host_3.3": true is set the plugin is unloaded and reloaded by python 3.8 plugin_host.

ST actively calls sublime_plugin.reload_plugin("MyPackage.plugin") - likely related with or caused by changing .python-version visibility. FWIW, this behavior disappears, when also overriding .python-version file.

This behavior is not correct, as modules of a disabled packages shouldn't be loaded by any means - not by another plugin_host nor the same.

Steps to reproduce

  1. add a MyPackage.sublime-package file containing a .python-version and an empty plugin.py to Data/Installed Packages.
  2. add an empty Data/Packages/MyPackage/plugin.py
  3. Start vanilla ST
  4. set "ignored_packages": ["MyPackage", "Vintage"]
  5. check console output

Expected behavior

Console:

ignored packages updated to: ["MyPackage", "Vintage"]
reloading settings Packages/MyPackage/MyPackage.sublime-settings
unloading plugin MyPackage.plugin

Modules from Packages/ shouldn't be reloaded if associated Installed Packages/MyPackage.sublime-package is being unmounted.

Actual behavior

Console ("disable_plugin_host_3.3": false):

ignored packages updated to: ["MyPackage", "Vintage"]
unloading plugin MyPackage.plugin
reloading python 3.3 plugin MyPackage.plugin
reloading settings Packages/User/Preferences.sublime-settings

Console ("disable_plugin_host_3.3": true):

ignored packages updated to: ["MyPackage", "Vintage"]
unloading plugin MyPackage.plugin
reloading plugin MyPackage.plugin
reloading settings Packages/User/Preferences.sublime-settings

Sublime Text build number

4200

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information


deathaxe avatar Aug 18 '25 20:08 deathaxe

Since it was mentioned that there will only be one plugin host moving forward, I suspect that this issue will kind of resolve itself by then.

FichteFoll avatar Nov 01 '25 16:11 FichteFoll

Not by removing a plugin host. It also happens for overriding modules in Packages/ if corresponding *.sublime-package file is disabled.

deathaxe avatar Nov 01 '25 17:11 deathaxe