Opened 14 years ago

Closed 13 years ago

#1280 closed defect (duplicate)

problem about the output of g.parser

Reported by: met Owned by: grass-dev@…
Priority: major Milestone: 6.4.1
Component: Default Version: 6.4.1 RCs
Keywords: wingrass, g.parser Cc:
CPU: All Platform: MSWindows XP

Description

Into the output of command g.parser are eliminated all character slash \ while are keeping unotuched characters like / .

GRASS 6.4.1RC1 (sanmarino)> test.parser inp_file=D:\Modelli\nepaPy\Net3.inp

'@ARGS_PARSED@\nopt_inp_file=D:ModellinepaPyNet3.inp\n' 'opt_inp_file=D:ModellinepaPyNet3.inp' {'inp_file': 'D:ModellinepaPyNet3.inp'} ==

GRASS 6.4.1RC1 (sanmarino)> test.parser inp_file=D:/Modelli/nepaPy/Net3.inp

'@ARGS_PARSED@\nopt_inp_file=D:/Modelli/nepaPy/Net3.inp\n' 'opt_inp_file=D:/Modelli/nepaPy/Net3.inp' {'inp_file': 'D:/Modelli/nepaPy/Net3.inp'} ==

The problem come from by the Wxguy (under windows) that give back the pathname using the wrong slash \.

Using commandline this problem can be solved putting the path name between apexes " .

GRASS 6.4.1RC1 (sanmarino)> test.parser inp_file="D:\Modelli\epaPy\Net3.inp"

'opt_inp_file=D:
Modelli
epaPy
Net3.inp' {'inp_file': 'D:
Modelli
epaPy
Net3.inp'} ==

Using the Guy insetad, that trick doesn't work.

(Wed Feb 16 16:36:04 2011)

test.parser inp_file="C:\Programmi\GRASS-64\msys\m.ico"

'@ARGS_PARSED@\nopt_inp_file="C:ProgrammiGRASS-64msysm.ico"\n' 'opt_inp_file="C:ProgrammiGRASS-64msysm.ico"' ({'inp_file': '"C:ProgrammiGRASS-64msysm.ico"'}, {}) (Wed Feb 16 16:36:05 2011) Command finished (0 sec) ==

Again with the graphic guy, we can avoid this problem if the pathname has blank ( even adding one blank at the end of file name)

(Wed Feb 16 16:31:52 2011)

test.parser inp_file=C:\Programmi\GRASS-64\msys\m.ico '@ARGS_PARSED@\nopt_inp_file=C:
Programmi
GRASS-64
msys
m.ico \n' 'opt_inp_file=C:
Programmi
GRASS-64
msys
m.ico ' ({'inp_file': 'C:
Programmi
GRASS-64
msys
m.ico '}, {}) (Wed Feb 16 16:31:52 2011) Command finished (0 sec) ==

Attachments (1)

test.parser (2.9 KB ) - added by met 14 years ago.

Download all attachments as: .zip

Change History (4)

by met, 14 years ago

Attachment: test.parser added

comment:1 by hellik, 14 years ago

Keywords: wingrass added; output character removed

comment:2 by benducke, 14 years ago

CPU: OSX/IntelAll
Priority: minormajor

This bug also creates havoc for shell scripts running under Windows. E.g. I have a script that takes a file name as an output (option defined with: "gisprompt: new_file,file,output"). If the user inputs something like this: "C:\Documents\Output.tif" as option value, then g.parser mangles it to: "C:DocumentsOutput.tif". I have tested this on Windows XP with GRASS 6.4.0RC6. But given that this ticket is still open, I assume that the bug is still around, too? If so, it needs to be fixed, as it could put a number of scripts out-of-order under Windows.

comment:3 by hamish, 13 years ago

Resolution: duplicate
Status: newclosed

continued in #1198

Note: See TracTickets for help on using tickets.