#1198: Error while parsing file paths in WiNGRASS with Python Script
----------------------------+-----------------------------------------------
Reporter: luislisboa1975 | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: MSWindows XP
Cpu: Unspecified |
----------------------------+-----------------------------------------------
In a Python Script, in WinGRASS6.4.1(svn) all "\" in file paths are
eliminated.
It only runs if users use "/"
#1198: Error while parsing file paths in WiNGRASS with Python Script
----------------------------+-----------------------------------------------
Reporter: luislisboa1975 | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: wingrass | Platform: MSWindows XP
Cpu: Unspecified |
----------------------------+-----------------------------------------------
Comment(by hamish):
is this from within a specific grass module, from the wxGUI command entry
box, or from a self-written script?
the `\` is used to quote the character which follows it verbatim.
so `C:\Program Files\GRASS\scripts` reduces to `C:Program
FilesGRASSscripts`.
one solution as pointed out is to use `/` instead. Another way is to use
two of them, so that the second one gets quoted verbatim: `\\`.
ISTR that some OS-specific magic was added to the wxGUI command parser,
but I suspect the solution to this will ultimately be education:
gratuitous tooltips and inset Caution-boxes in the wxGUI help pages.
#1198: Error while parsing file paths in WiNGRASS with Python Script
----------------------------+-----------------------------------------------
Reporter: luislisboa1975 | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: wingrass | Platform: MSWindows XP
Cpu: Unspecified |
----------------------------+-----------------------------------------------
Comment(by benducke):
Actually, the problem goes deeper than the wxGUI. I have experienced it
(Windows only) with shell scripts. Basically, g.parser seems to remove all
occurrences of "\" from a file type input or output option. I think this
should be fixed in g.parser, not by forcing Windows users to adopt a
notation that is strange on their system. In addition, the option value
may come from a Windows file browser, which will certainly produce the "\"
Windows notation.
#1198: Error while parsing file paths in WinGRASS with Scripts
----------------------------+-----------------------------------------------
Reporter: luislisboa1975 | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: wingrass | Platform: MSWindows XP
Cpu: Unspecified |
----------------------------+-----------------------------------------------
Comment(by glynn):
Replying to [comment:3 benducke]:
> Actually, the problem goes deeper than the wxGUI. I have experienced it
(Windows only) with shell scripts. Basically, g.parser seems to remove all
occurrences of "\" from a file type input or output option. I think this
should be fixed in g.parser, not by forcing Windows users to adopt a
notation that is strange on their system. In addition, the option value
may come from a Windows file browser, which will certainly produce the "\"
Windows notation.
It isn't g.parser doing this. It's either wxGUI (e.g. shlex.split) or the
shell.
In any case, this ticket contains insufficient information to attempt
reproduction. At a minimum, we require the exact command entered, the
means by which it was entered (cmd.exe, bash, wxGUI, etc), the GRASS
version, and the result.
#1198: Error while parsing file paths in WinGRASS with Scripts
----------------------------+-----------------------------------------------
Reporter: luislisboa1975 | Owner: grass-dev@…
Type: defect | Status: new
Priority: major | Milestone: 6.4.1
Component: wxGUI | Version: svn-releasebranch64
Keywords: wingrass | Platform: MSWindows XP
Cpu: Unspecified |
----------------------------+-----------------------------------------------
Comment(by mmetz):
Replying to [comment:5 glynn]:
> Replying to [comment:3 benducke]:
> > Actually, the problem goes deeper than the wxGUI. I have experienced
it (Windows only) with shell scripts. Basically, g.parser seems to remove
all occurrences of "\" from a file type input or output option. I think
this should be fixed in g.parser, not by forcing Windows users to adopt a
notation that is strange on their system. In addition, the option value
may come from a Windows file browser, which will certainly produce the "\"
Windows notation.
>
> It isn't g.parser doing this. It's either wxGUI (e.g. shlex.split) or
the shell.
> In any case, this ticket contains insufficient information to attempt
reproduction. At a minimum, we require the exact command entered, the
means by which it was entered (cmd.exe, bash, wxGUI, etc), the GRASS
version, and the result.
I think #1447 is related, and complete with an example and a detailed
description.