Bug report #16061
Rasterize and Rasterize Over algorithms not opening
Status: | Closed | ||
---|---|---|---|
Priority: | High | ||
Assignee: | Victor Olaya | ||
Category: | Processing/GDAL | ||
Affected QGIS version: | 2.18.13 | Regression?: | Yes |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 23976 |
Description
Both gdal algorithms of gdal won't open in processing due to this python error (QGIS compiled from source):
TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/gui/ProcessingToolbox.py", line 259, in executeAlgorithm
dlg = alg.getCustomParametersDialog()
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/algs/gdal/GdalAlgorithm.py", line 57, in getCustomParametersDialog
return GdalAlgorithmDialog(self)
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py", line 39, in init
AlgorithmDialogBase.__init__(self, alg)
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/gui/AlgorithmDialogBase.py", line 108, in init
algHelp = self.alg.shortHelp()
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/algs/gdal/GdalAlgorithm.py", line 86, in shortHelp
url = helpPath + '{}.html'.format(self.commandName())
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/algs/gdal/GdalAlgorithm.py", line 98, in commandName
name = alg.getConsoleCommands()[0]
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/algs/gdal/rasterize.py", line 162, in getConsoleCommands
return ['gdal_rasterize', GdalUtils.escapeAndJoin(arguments)]
File "/home/matteo/lavori/QGIS/build-qgis3/output/python/plugins/processing/algs/gdal/GdalUtils.py", line 183, in escapeAndJoin
if s0 != '-' and ' ' in s:
TypeError: 'NoneType' object is not subscriptable
Associated revisions
[processing] Fix rasterize dialog openning
Fix #16061
Do not pass in getConsoleCommand just to get commandName for shortHelp.
This avoid errors with non initialized parameters.
[processing] prevent Python error if input layer is not set (fix #16061)
History
#1 Updated by Giovanni Manghi over 7 years ago
- Priority changed from High to Severe/Regression
#2 Updated by Alexander Bruy over 7 years ago
- Operating System deleted (
Linux mint) - OS version deleted (
sarah)
#3 Updated by Alexander Bruy over 7 years ago
Just a small note. This error thrown only if algorithm opened with empty project, if there is a vector layer loaded all not error is displayed.
#4 Updated by matteo ghetta over 7 years ago
mmm.. on my machine I get the same error also with layers in the toc and with or without any project opened
#5 Updated by Giovanni Manghi over 7 years ago
I also see the error regardless the project is empty or not.
#6 Updated by Arnaud Morvan over 7 years ago
Pull request proposed : https://github.com/qgis/QGIS/pull/4445
#7 Updated by Alexander Bruy over 7 years ago
- Resolution set to fixed/implemented
- Status changed from Open to Closed
- Description updated (diff)
#8 Updated by Richard Duivenvoorde about 7 years ago
- Priority changed from Severe/Regression to Low
- Regression? changed from No to Yes
Reopening this , running current 2.18(.13) head ( QGIS code revision ce11ebb48b ) here.
Having exact this error message in 'Rasterize (vector to raster)'
Printing out the 'arguments'-string of share/qgis/python/plugins/processing/algs/gdal/rasterize.py" I have:
['-a', u'1', '-ot', 'Int16', '-of', 'GTiff', '-tr', u'1', u'1', '-a_nodata', u'1', '-co COMPRESS=JPEG', u'-co JPEG_QUALITY=1', '-co BIGTIFF=YES', u'1', '-l', None, u'1', u'dummy']
Looks like this is the inLayer? Which in my case is not yet choosen (as it is the first time I open the dialog, maybe not even with layers in my legend...)?
#9 Updated by Giovanni Manghi about 7 years ago
- Status changed from Closed to Open
- Priority changed from Low to High
- Affected QGIS version changed from master to 2.18.13
- Resolution deleted (
fixed/implemented) - Subject changed from Rasterize and Rasterize Ovr algorithm not opening to Rasterize and Rasterize Over algorithms not opening
The error (seen on Windows and Linux) is
Traceback (most recent call last):
File "/usr/local/share/qgis/python/plugins/processing/gui/ProcessingToolbox.py", line 250, in executeAlgorithm
dlg = alg.getCustomParametersDialog()
File "/usr/local/share/qgis/python/plugins/processing/algs/gdal/GdalAlgorithm.py", line 49, in getCustomParametersDialog
return GdalAlgorithmDialog(self)
File "/usr/local/share/qgis/python/plugins/processing/algs/gdal/GdalAlgorithmDialog.py", line 40, in init
AlgorithmDialogBase.__init__(self, alg)
File "/usr/local/share/qgis/python/plugins/processing/gui/AlgorithmDialogBase.py", line 71, in init
algHelp = self.alg.shortHelp()
File "/usr/local/share/qgis/python/plugins/processing/algs/gdal/GdalAlgorithm.py", line 78, in shortHelp
url = helpPath + '{}.html'.format(self.commandName())
File "/usr/local/share/qgis/python/plugins/processing/algs/gdal/GdalAlgorithm.py", line 90, in commandName
name = alg.getConsoleCommands()[0]
File "/usr/local/share/qgis/python/plugins/processing/algs/gdal/rasterize_over.py", line 80, in getConsoleCommands
return ['gdal_rasterize', GdalUtils.escapeAndJoin(arguments)]
File "/usr/local/share/qgis/python/plugins/processing/algs/gdal/GdalUtils.py", line 180, in escapeAndJoin
if s0 != '-' and ' ' in s:
TypeError: 'NoneType' object has no attribute '__getitem__'
#10 Updated by Alexander Bruy about 7 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
Applied in changeset qgis|2116a60b32067fb9160fac2c9f10847e5ea7359a.