Bug report #11335

NameError with Processing - global name self is not defined

Added by Pedro Venâncio almost 5 years ago. Updated almost 5 years ago.

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

Description

After update to QGIS 2.5.0-92 (OSGeo4W) I get this error:

Couldn't load plugin processing due an error when calling its initGui() method

Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis-dev/./python\\qgis\\utils.py", line 217, in startPlugin
    plugins[packageName].initGui()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\ProcessingPlugin.py", line 54, in initGui
    Processing.initialize()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\Processing.py", line 153, in initialize
    Processing.loadFromProviders()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\Processing.py", line 166, in loadFromProviders
    Processing.loadAlgorithms()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\Processing.py", line 210, in loadAlgorithms
    Processing.modeler.loadAlgorithms()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\core\\AlgorithmProvider.py", line 57, in loadAlgorithms
    self._loadAlgorithms()
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithmProvider.py", line 74, in _loadAlgorithms
    self.loadFromFolder(folder)
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithmProvider.py", line 84, in loadFromFolder
    alg = ModelerAlgorithm.fromFile(fullpath)
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithm.py", line 541, in fromFile
    alg = ModelerAlgorithm.fromOldFormatFile(filename)
  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\\processing\\modeler\\ModelerAlgorithm.py", line 637, in fromOldFormatFile
    raise WrongModelException(self.tr('Error in model definition line: %s\
%s', 'ModelerAlgorithm') % (line.strip(), traceback.format_exc()))
NameError: global name 'self' is not defined

It seems something related with the backward compatibility of models.

1_1_preparacao.model (4.61 KB) Pedro Venâncio, 2014-10-06 02:11 AM

1_preparacao.model (20 KB) Pedro Venâncio, 2014-10-06 02:11 AM

History

#1 Updated by Victor Olaya almost 5 years ago

  • Status changed from Open to Feedback

There are two problems in here. One, the model is not being loaded, so the backwards compatibility is not perfect. Two, there is an error in the internationalization code that Alex added during the HF. I will work on the first one. Coudl you attach the model that is causing this problem? Thanks!

#2 Updated by Pedro Venâncio almost 5 years ago

Hi Victor,

I attach two models:

- with 1_1_preparacao.model, I get no error;

- with 1_preparacao.model, I get the error described.

#3 Updated by Victor Olaya almost 5 years ago

The error with int i18n is fixed. The error of not being able to load your model is actually not a modeler error. The syntax of the raster calculator has changed, so all old models using it will break.

I will try to manually edit you model and send a corrected one back to you, since it is a very big model and i guess you do not want to create it again :-)

#4 Updated by Pedro Venâncio almost 5 years ago

Hi Victor,

No, it is not necessary, I take care of it! Don't worry! These are not yet final models!

Thank you so much!

Best regards!

#5 Updated by Paolo Cavallini almost 5 years ago

Seems fixed here.

#6 Updated by Pedro Venâncio almost 5 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF