Bug report #14947
Plugin's syntax errors in __init__.py are not reported
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 over 7 years ago
- Easy fix? set to No
- Regression? set to No
#2 Updated by Giovanni Manghi over 5 years ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR
Source:
http://blog.qgis.org/2019/03/09/end-of-life-notice-qgis-2-18-ltr/