[GRASS-dev] [GRASS GIS] #637: Problems with paths in the TCL/TK Windows GUI

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------------+------------------------------------------
Reporter: marmai | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Keywords: Tcl Window Gui path | Platform: MSWindows 2K
      Cpu: Unspecified |
---------------------------------+------------------------------------------
Within the tcltk-GUI it is not possible to select a map within the
project:
When clicking 'Add vector layer', then on the icon in the lower part of
the
GIS Manager (tcltk-GUI) 'vector map to display'. Within the following pop-
up window
there are no maps listed. With the 'g.list type=vect' command entered in
the GIS.m window, all vector maps are listed as expected. And it is also
possible to show the maps by entering the names of the maps in the
'Vector map'- field in the lower part of the GIS Manager. Just selecting
with the icon is not possible.

Furthermore another path related problem with the tcltk-GUI:
Using the 'Show attribute data' button within the 'GIS Manager' window the
following command is sent to be executed:

db.select table=veg_buffer_1_dissolve
database=D:\daten\GISDataBase/demolocation/PERMANENT/dbf/ driver=dbf

For this command I get the following error in the output:
  BMI-DBF driver error:
  Cannot create dbf database:
  D:datenGISDataBase/demolocation/PERMANENT/dbf/
  Unable to open database
  <D:datenGISDataBase/demolocation/PERMANENT/dbf/>
Notice: the \ are gone!

By correcting the command manually (backslash to slash) to:
db.select table=veg_buffer_1_dissolve
database=D:/daten/GISDataBase/demolocation/PERMANENT/dbf/ driver=dbf
everything works fine.

All was tested with the GRASS6.4.0RC3 and GRASS6.4svn-2 (OSGeo4W
installer)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/637&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by hamish):

  * keywords: Tcl Window Gui path => Tcl Window Gui path, wingrass
  * priority: normal => critical

Comment:

Replying to [ticket:637 marmai]:
> Within the tcltk-GUI it is not possible to select a map within
> the project:
> When clicking 'Add vector layer', then on the icon in the lower
> part of the GIS Manager (tcltk-GUI) 'vector map to display'.
> Within the following pop-up window there are no maps listed.
> With the 'g.list type=vect' command entered in the GIS.m window,
> all vector maps are listed as expected. And it is also possible
> to show the maps by entering the names of the maps in the
> 'Vector map'- field in the lower part of the GIS Manager.
> Just selecting with the icon is not possible.

confirmed with the latest wingrass installer (Colin's stand alone version
is much newer than the current osgeo4w build)

this is a close relative of bug #593.

> Furthermore another path related problem with the tcltk-GUI:
> Using the 'Show attribute data' button within the 'GIS Manager'
> window the following command is sent to be executed:
>
> db.select table=veg_buffer_1_dissolve
database=D:\daten\GISDataBase/demolocation/PERMANENT/dbf/ driver=dbf
>
> For this command I get the following error in the output:
> BMI-DBF driver error:
> Cannot create dbf database:
> D:datenGISDataBase/demolocation/PERMANENT/dbf/
> Unable to open database
> <D:datenGISDataBase/demolocation/PERMANENT/dbf/>
> Notice: the \ are gone!
>
> By correcting the command manually (backslash to slash) to:
> db.select table=veg_buffer_1_dissolve
database=D:/daten/GISDataBase/demolocation/PERMANENT/dbf/ driver=dbf
everything works fine.

this is slightly different, but probably a close relative of error seen in
https://trac.osgeo.org/grass/ticket/629#comment:5

> All was tested with the GRASS6.4.0RC3 and GRASS6.4svn-2
> (OSGeo4W installer)

please could you try with the latest stand-alone installer?
a lot has been fixed there.
(you can have both installed without conflicts)

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

probably G_convert_dirseps_to_host() is needed somewhere in the code.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:2 hamish]:
> probably G_convert_dirseps_to_host() is needed somewhere in the code.

Did you mean G_convert_dirseps_from_host()?

It's only necessary to convert / to \ if the path is being passed to
Windows' command interpreter. The rest of the OS understands both / and \.

OTOH, some GRASS functions only recognise /, so any \ characters need to
be converted.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by marmai):

I just tested with the latest stand-alone version (wingrass-6.4.0SVN-
r37703-1-setup.exe). Here everything works fine on my W2k system, so
probably everything is already fixed.
Thanks a lot.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/637#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

Replying to [comment:3 glynn]:
> Did you mean G_convert_dirseps_from_host()?

umm, yeah.

> It's only necessary to convert / to \ if the path is being
> passed to Windows' command interpreter. The rest of the OS
> understands both / and \.

Ok, so the code we need to check then is the bit that launches e.g.
dbf.exe child from lib/db/dbmi_client/start.c ???

> OTOH, some GRASS functions only recognise /, so any \
> characters need to be converted.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by glynn):

Replying to [comment:5 hamish]:

> > It's only necessary to convert / to \ if the path is being
> > passed to Windows' command interpreter. The rest of the OS
> > understands both / and \.
>
> Ok, so the code we need to check then is the bit that launches e.g.
dbf.exe child from lib/db/dbmi_client/start.c ???

I don't think so. The backslashes are getting lost. Windows' command
interpreter doesn't interpret backslashes, so this looks more like Tcl's
doing. It looks like something is (implicitly or explicitly) using "eval"
or "subst" on the string, causing backslash-<char> to be replaced with
<char>.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

> Replying to [comment:5 hamish]:
> > Ok, so the code we need to check then is the bit that launches
> > e.g. dbf.exe child from lib/db/dbmi_client/start.c ???

Replying to [comment:6 glynn]:
> I don't think so. The backslashes are getting lost.

(comment:4 of this ticket reports that fixed now)

> Windows' command interpreter doesn't interpret backslashes, so
> this looks more like Tcl's doing. It looks like something is
> (implicitly or explicitly) using "eval" or "subst" on the string,
> causing backslash-<char> to be replaced with <char>.

maybe fixed by the new `eval [list ]` stuff?

anyway I was more thinking about the ''Bad file descriptor'' problems of
unquoted spaces from https://trac.osgeo.org/grass/ticket/629#comment:5,
not the missing '\'s.

Hamish

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

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hellik):

Replying to [comment:7 hamish]:
> > Replying to [comment:5 hamish]:
> > > Ok, so the code we need to check then is the bit that launches
> > > e.g. dbf.exe child from lib/db/dbmi_client/start.c ???
>
> Replying to [comment:6 glynn]:
> > I don't think so. The backslashes are getting lost.
>
> (comment:4 of this ticket reports that fixed now)
>
> > Windows' command interpreter doesn't interpret backslashes, so
> > this looks more like Tcl's doing. It looks like something is
> > (implicitly or explicitly) using "eval" or "subst" on the string,
> > causing backslash-<char> to be replaced with <char>.
>
> maybe fixed by the new `eval [list ]` stuff?
>
>
> anyway I was more thinking about the ''Bad file descriptor'' problems of
unquoted spaces from https://trac.osgeo.org/grass/ticket/629#comment:5,
not the missing '\'s.
>
>
> Hamish

WinVista 32
Grass65-svn - self-compiled today in the osgeo4w-tree
nc-dataset

i can confirm the problem
i'm not able to select a vector/raster map in the tcltk-gui, but it's
possible to enter the name for displaying the maps

helli

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/637#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: marisn
      Type: defect | Status: assigned
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by hamish):

* cc: grass-dev@lists.osgeo.org (added)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: marisn
      Type: defect | Status: assigned
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

sqlbuilder.py in the wxGUI now updated to safely handles spaces in the DB
path and spaces in the SQL query.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: marisn
      Type: defect | Status: assigned
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by marisn):

Should be fixed in 6.4 as of r39149.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/637#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: marisn
      Type: defect | Status: assigned
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

Replying to [comment:17 marisn]:
> Should be fixed in 6.4 as of r39149.

thanks,

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: marisn
      Type: defect | Status: assigned
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

tested & fixed with latest (WinGRASS-6.4.0SVN-r39271-1-Setup.exe) native
installer.

still get _spawnl error if map is not in the current mapset (both wx and
tcltk), but that's a different matter.

thanks,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>

#637: Problems with paths in the TCL/TK Windows GUI
---------------------------+------------------------------------------------
  Reporter: marmai | Owner: marisn
      Type: defect | Status: closed
  Priority: critical | Milestone: 6.4.0
Component: Tcl | Version: 6.4.0 RCs
Resolution: fixed | Keywords: Tcl Window Gui path, wingrass
  Platform: MSWindows 2K | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by hamish):

  * status: assigned => closed
  * resolution: => fixed

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/637#comment:20&gt;
GRASS GIS <http://grass.osgeo.org>