Bug report #16238

Loading a plugin that adds to the processing plugin does not work correctly

Added by Ari Jolma about 7 years ago. Updated about 6 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Core
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:24148

Description

Loading a plugin that adds to the processing plugin leads to a keyerror:

Traceback (most recent call last):
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 320, in addProvider
    providerItem = TreeProviderItem(provider_id, self.algorithmTree, self)
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 383, in __init__
    self.populate()
  File "/home/ajolma/usr/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 395, in populate
    provider = algList.algs[self.provider_id]
KeyError: 'perl'

This is probably due to a bug in core/alglist.py, where the provider is added to processing registry before adding it to the algs hash, leading to a chicken-and-egg type of problem.

The bug is not fatal since the plugin gets loaded and once it is activated in the processing options (a deactivate - activate cycle is needed), it is ok.

In addition, I did not get the _loadAlgorithms method of the provider to execute via any other way than through an unload-load-deactivate-activate cycle.

History

#1 Updated by Ari Jolma about 7 years ago

I forgot to mention that the plugin initially loads ok. This bug happens only when one unloads + loads the plugin, which I had to do to invoke the refreshing of the algorithm list.

#2 Updated by Giovanni Manghi almost 7 years ago

  • Easy fix? set to No
  • Regression? set to No

#3 Updated by Alexander Bruy about 6 years ago

  • Description updated (diff)
  • Status changed from Open to Feedback

Still true in latest master?

#4 Updated by Giovanni Manghi about 6 years ago

  • Status changed from Feedback to Closed
  • Resolution set to not reproducable

Closing for lack of feedback, please reopen if necessary.

#5 Updated by Arnaud Morvan about 6 years ago

There is no more "algList" in source code, registry should be used everywhere now, so this should not append anymore.

Also available in: Atom PDF