north-road / qgis-processing-saga-nextgen

GNU General Public License v3.0
22 stars 13 forks source link

Failed to Run on Profile with Special Charater on its Path #26

Closed ismailsunni closed 1 year ago

ismailsunni commented 1 year ago

The SAGA processing can't be run on a profile that has a special character on its path. The original bug happens on a computer that put the QGIS directory on something like this: D:\\Users\Company\UserName\AppData(Roaming)\QGIS\QGIS3\profiles\default\processing. Note the bracket on AppData(Roaming). To reproduce, create a new profile with a bracket on its name, for example: new(profile) then run any algorithm on it. For example, this is the error message that I got:

QGIS version: 3.22.5-Białowieża
QGIS code revision: c2723178
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.4.1
GEOS version: 3.10.2-CAPI-1.16.0
PROJ version: Rel. 8.2.1, January 1st, 2022
PDAL version: 2.3.0 (git-version: 9f35b7)
SAGA Next Gen version: 0.0.7
Algorithm started at: 2022-11-16T04:27:35
Algorithm 'Split lines at points' starting…
Input parameters:
{ 'EPSILON' : 1, 'INTERSECT' : 'TEMPORARY_OUTPUT', 'LINES' : 'C:/Users/fclementi/Documents/projects/data/db-saga-issue/lines.gpkg|layername=lines', 'OUTPUT' : 1, 'SPLIT' : 'C:/Users/fclementi/Documents/projects/data/db-saga-issue/lines.gpkg|layername=point' }

shapes_lines "Split Lines at Points" -LINES "C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/db9ffe63b94a40e28439c5445bb206bb/LINES.shp" -SPLIT "C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/ec9c4c70a3184734bf524e3289258e99/SPLIT.shp" -OUTPUT 1 -EPSILON 1.0 -INTERSECT "C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/0758aa058d5a41c1b26e51dc49e9e8dc/INTERSECT.shp"
'C:\Users\fclementi\AppData\Roaming\QGIS\QGIS3\profiles\new' is not recognized as an internal or external command,
operable program or batch file.
Execution completed in 0.31 seconds
Results:
{'INTERSECT': 'C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/0758aa058d5a41c1b26e51dc49e9e8dc/INTERSECT.shp'}

Loading resulting layers
The following layers were not correctly generated.
• C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/0758aa058d5a41c1b26e51dc49e9e8dc/INTERSECT.shp
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

and this is the log:

2022-11-16T04:27:36     INFO    SAGA execution commands
             shapes_lines "Split Lines at Points" -LINES "C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/db9ffe63b94a40e28439c5445bb206bb/LINES.shp" -SPLIT "C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/ec9c4c70a3184734bf524e3289258e99/SPLIT.shp" -OUTPUT 1 -EPSILON 1.0 -INTERSECT "C:/Users/fclementi/AppData/Local/Temp/processing_fmRWFV/0758aa058d5a41c1b26e51dc49e9e8dc/INTERSECT.shp"
2022-11-16T04:27:36     INFO    SAGA execution console output
             'C:\Users\fclementi\AppData\Roaming\QGIS\QGIS3\profiles\new' is not recognized as an internal or external command,
             operable program or batch file.

Of course, we can use a "proper" naming of the profile or make sure that the QGIS directory is under a "proper" path (proper = without a special character). But it would be great to handle this case.