Bug report #14947

Plugin's syntax errors in __init__.py are not reported

Added by Martin Dobias about 4 years ago. Updated about 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Python plugins
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:22896

Description

If a plugin's init.py has a syntax error in it, QGIS will report a cryptic error in startPlugin() function in utils.py instead of giving the real error:

AttributeError: 'module' object has no attribute 'classFactory' 

It seems that first attempt to import a package with syntax error will trigger an exception, however subsequent imports will not fail (and will return a broken package's module).

Most likely it is plugin installer which is too eager to see if any plugins are broken by trying to import all plugins, even if they are not enabled. Apart from this issue, this may be causing slow QGIS startup in presence of many plugins.

History

#1 Updated by Giovanni Manghi about 3 years ago

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

#2 Updated by Giovanni Manghi about 1 year ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF