north-road / qgis-processing-r

QGIS Processing R Provider Plugin

Home Page:https://north-road.github.io/qgis-processing-r/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error using script syntax _output folder then browsing to folder.

cratcliff opened this issue · comments

I am having problems using the output folder syntax and then browsing for a folder from the dialog.
My script is

##R Version2=name
##Out_fold=output folder
##Out_file=output file ##noprompt
##dont_load_any_packages

Out_file <- file.path(Out_fold, "test1.txt")

fileConn <- file(Out_file)
writeLines(R.version.string, fileConn)
close(fileConn)

By default when I browse for a folder the path loads like
image

When I run the tool, I am getting is Error: '\d' is an unrecognized escape in character string starting ""C:\d" (see full log: QGIS_3.12.3_outputfolder.log )

In QGIS 3.12.3 if I were to manually change the path in the dialog to C:\\data\\processing or C:/data/processing I do not get this error, but for QGIS QGIS LTR 3.10.3 I get Error: '\U' used without hex digits in character string starting ""C:\U" for both.

I have tested this with QGIS LTR 3.10.3 & QGIS 3.12.3 and I am running R Provider version 2.2.1.

There seems to be minor issue where some folder and file destinations were used without explicitly converting paths to correct versions. This seems to only affect Windows.

The patch is very simple. If the tests work out fine I should be able to put up PR fixing this in a few minutes.