Bug report #14947

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

Added by Martin Dobias over 6 years ago. Updated over 3 years ago.

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


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.


#1 Updated by Giovanni Manghi over 5 years ago

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

#2 Updated by Giovanni Manghi over 3 years ago

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

Also available in: Atom PDF