[GRASS-dev] Re: [GRASS GIS] #1447: wxGUI wingrass scripts need whitespace in path

GRASS GIS trac at osgeo.org
Fri Sep 23 07:21:33 EDT 2011


#1447: wxGUI wingrass scripts need whitespace in path
------------------------------+---------------------------------------------
 Reporter:  mmetz             |       Owner:  grass-dev@…              
     Type:  defect            |      Status:  new                      
 Priority:  major             |   Milestone:  6.4.2                    
Component:  wxGUI             |     Version:  svn-releasebranch64      
 Keywords:  wingrass, spaces  |    Platform:  MSWindows XP             
      Cpu:  All               |  
------------------------------+---------------------------------------------

Comment(by mmetz):

 Replying to [comment:6 glynn]:
 > Replying to [comment:5 mmetz]:
 > > In wxGUI, the command plus args disappears in a Python Queue, up to
 there it seems ok.
 >
 > AFAICT, after entering goutput.!CmdThread.requestQ, it gets pulled out
 in goutput.!CmdThread.run(), to goutput.!GrassCmd, to
 gcmd.!CommandThread.run().

 OK. Then it goes apparently into gcmd.!Popen and still looks ok, i.e.
 D:\\GRASS test data\\IT\\IT.txt

 I guess it should be \"D:\\GRASS test data\\IT\\IT.txt\", but I did not
 manage to get it like this. I was putting file arguments into quotes and
 got within wxGUI "D:\\GRASS test data\\IT\\IT.txt", not \"D:\\GRASS test
 data\\IT\\IT.txt\", even when explicitely using '\"'. "D:\\GRASS test
 data\\IT\\IT.txt" is reduced to "D:GRASS test dataITIT.txt", all
 backslashes gone, quotes kept.

 Trying \\"D:\\GRASS test data\\IT\\IT.txt\\", gets converted to \D:\GRASS
 test data\IT\IT.txt\ when arriving at v.in.geonames. That is, the
 backslashes in the file path are preserved, the quotes have been stripped,
 but the leading and ending backslashes have been preserved too...

 Trying the equivalents not in the wxGUI code but in the wxGUI dialog did
 not work either.

 BTW, I noticed that wxGUI is calling $GISBASE/scripts/v.in.geonames, not
 $GISBASE/bin/v.in.geonames.bat. I gave that a try as well, no difference.
 Then I tried using Popen without shell, changing this line [0], that works
 with v.in.geonames.bat insofar as I got the same errors.

 [0]
 https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcmd.py#L490

 It's not g.parser, when it arrives there, the damage is already done.

 Mysterious. Maybe someone can make some sense out of it.

 Markus M

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/1447#comment:7>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list