Bug report #16104

Processing: GRASS commands not escaped correctly

Added by Paolo Cavallini over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:High
Assignee:Victor Olaya
Category:Processing/GRASS
Affected QGIS version:2.18.2 Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:24016

Description

A simple GRASS command, e.g.

processing.runalg("grass7:v.clean","/home/paolo/Aree_Elementari.shp",2,0.1,"955403.9934,1054537.9351,4596890.3389,4678902.6515",-1,0.0001,None,None)

results in:

v.in.ogr min_area=0.0001 snap=-1 input="/home/paolo/" layer=Aree Elementari output=tmp14851690580813 --overwrite -o

instead of:

v.in.ogr min_area=0.0001 snap=-1 input="/home/paolo/" layer="Aree Elementari" output=tmp14851690580813 --overwrite -o

(the space in filename is not escaped) and as a consequence the command fails with:

ERROR: Sorry is not a valid option

History

#1 Updated by Giovanni Manghi over 3 years ago

  • Status changed from Open to Feedback

If is regression is a severe, not high issue.

Anyway I cannot replicate (2.18.3, grass72), so please add

1) sample data
2) exact steps on how replicate

#2 Updated by Victor Olaya over 3 years ago

Giovanni, i guess it will happen when you use any layer with blank spaces in its name as input

Should be easy to fix, i will work on it

#3 Updated by Giovanni Manghi over 3 years ago

Victor Olaya wrote:

Giovanni, i guess it will happen when you use any layer with blank spaces in its name as input

Should be easy to fix, i will work on it

Hi Victor,
yes it seems to happen when input layer name has spaces. But the above example does not have spaces in the input file name

processing.runalg("grass7:v.clean","/home/paolo/Aree_Elementari.shp",2,0.1,"955403.9934,1054537.9351,4596890.3389,4678902.6515",-1,0.0001,None,None)

and in another test using an input with underscores this are not replaced by spaces (as the above example would suggest).

#4 Updated by luca barbadoro over 3 years ago

  • Target version set to Version 2.14

#5 Updated by Paolo Cavallini over 3 years ago

I believe Victor has already fixed this.

#6 Updated by Giovanni Manghi over 3 years ago

  • Resolution set to fixed/implemented
  • Status changed from Feedback to Closed

Also available in: Atom PDF