RIDE icon indicating copy to clipboard operation
RIDE copied to clipboard

recentfiles plugin blocks startup after upgrade to v2.2.1.1

Open JFoederer opened this issue 1 month ago • 3 comments

After upgrading to RIDE v2.2.1.1 it doesn't startup anymore

Running from command line reveals this logging:

'Plugins'
'Plugins'
Traceback (most recent call last):
  File "C:\Users\...\Python313\Lib\site-packages\robotide\application\application.py", line 131, in OnInit
    self.workspace_path = self.workspace_path or self._get_latest_path()
                                                 ~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\...\Python313\Lib\site-packages\robotide\application\application.py", line 476, in _get_latest_path
    recent = self._get_recentfiles_plugin()
  File "C:\Users\...\Python313\Lib\site-packages\robotide\application\application.py", line 487, in _get_recentfiles_plugin
    if isinstance(pl.conn_plugin, RecentFilesPlugin):
                  ^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'conn_plugin'
OnInit returned false, exiting...

JFoederer avatar Dec 12 '25 13:12 JFoederer

The None object seems to originate from this code in pluginconnector.py:

def plugin_factory(application, plugin_class, silent=False):
    try:
        plugin = plugin_class(application)
    except Exception as e:
        print(e)
        msg, traceback = utils.get_error_details()
        if not silent:
            return BrokenPlugin(msg, traceback, plugin_class)
    else:
        return PluginConnector(plugin, application)

The if not silent branch lacks an else clause, causing an implicit return None.

JFoederer avatar Dec 12 '25 13:12 JFoederer

Original message:

Note that the 'Plugins' line in the logging comes from the print(e) statement logging the str() for KeyError: 'Plugins'.

Traceback (most recent call last):
  File "C:\Users\...\Python313\Lib\site-packages\robotide\application\application.py", line 128, in OnInit
    self._plugin_loader = PluginLoader(self, self._get_plugin_dirs(), [RecentFilesPlugin],
                          ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                       silent=True)
                                       ^^^^^^^^^^^^
  File "C:\Users\...\Python313\Lib\site-packages\robotide\application\pluginloader.py", line 31, in __init__
    self.plugins = [plugin_factory(application, cls, silent) for cls in standard_classes +
                    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\...\Python313\Lib\site-packages\robotide\application\pluginconnector.py", line 22, in plugin_factory
    plugin = plugin_class(application)
  File "C:\Users\...\Python313\Lib\site-packages\robotide\recentfiles\recentfiles.py", line 46, in __init__
    Plugin.__init__(self, application, default_settings=settings)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\...\Python313\Lib\site-packages\robotide\pluginapi\plugin.py", line 110, in __init__
    self.__settings = application.settings['Plugins'].add_section(self.name)
                      ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\...\Python313\Lib\site-packages\robotide\preferences\settings.py", line 257, in __getitem__
    value = self.config_obj[name]
            ~~~~~~~~~~~~~~~^^^^^^
  File "C:\Users\...\Python313\Lib\site-packages\robotide\preferences\configobj\src\configobj\__init__.py", line 549, in __getitem__
    val = dict.__getitem__(self, key)
KeyError: 'Plugins'
OnInit returned false, exiting...

JFoederer avatar Dec 12 '25 13:12 JFoederer

in robotide\pluginapi\plugin.py line 110: self.__settings = application.settings['Plugins'].add_section(self.name)

Could it be that on this line a new section for Plugins needs to be created if it isn't there yet? And now I am wondering why this section wasn't there after the upgrade.

JFoederer avatar Dec 12 '25 13:12 JFoederer

Fixed in v2.2.2dev2

HelioGuilherme66 avatar Dec 16 '25 15:12 HelioGuilherme66

Fix confirmed

JFoederer avatar Dec 17 '25 06:12 JFoederer