[GRASS-dev] [GRASS GIS] #114: wxPython GUI fails in Vista

#114: wxPython GUI fails in Vista
--------------------------------------+-------------------------------------
Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.3.0
Component: Python | Version: 6.3.0 RCs
Keywords: wxPython, Windows, Vista |
--------------------------------------+-------------------------------------
I used the new Windows installer package to install GRASS 6.3.0RC6 on my
PC. I installed GRASS to c:\GRASS and tried running the startup script
found in c:\GRASS\msys\home\users\john using the msys shell. Here is a
transcript:

{{{
John@JOHN-LAPTOP /home/users/john
$ grass63 -wxpython

WELCOME TO GRASS Version 6.3.0RC6 2008

    1) Have at your side all available GRASS tutorials

    2) When working on your location, the following materials
       are extremely useful:
       - A topo map of your area
       - Current catalog of available computer maps

    3) Check the GRASS webpages for feedback mailinglists and more:
       http://www.grass-gis.org
       http://grass.osgeo.org

Hit RETURN to continue

Starting GRASS ...
Traceback (most recent call last):
   File "c:/GRASS/etc/wxpython/gis_set.py", line 710, in <module>
     GRASSStartUp = StartUp(0)
   File "c:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py",
line 7836, in __init__
     self._BootstrapApp()
   File "c:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py",
line 7433, in _BootstrapApp
     return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "c:/GRASS/etc/wxpython/gis_set.py", line 694, in OnInit
     StartUp = GRASSStartup()
   File "c:/GRASS/etc/wxpython/gis_set.py", line 154, in __init__
     self._set_properties()
   File "c:/GRASS/etc/wxpython/gis_set.py", line 154, in __init__
     self._set_properties()
   File "c:/GRASS/etc/wxpython/gis_set.py", line 193, in _set_properties
     self.OnSetDatabase(None)
   File "c:/GRASS/etc/wxpython/gis_set.py", line 579, in OnSetDatabase
     self.OnSelectLocation(event)
   File "c:/GRASS/etc/wxpython/gis_set.py", line 561, in OnSelectLocation
     self.lbmapsets.SetSelection(0)
   File "c:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx\_controls.py",
line 1325, in SetSelection
     return _controls_.ListBox_SetSelection(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "N == (-1) || IsValid(N)" failed
at ..\..\src\msw\listbox.cpp(390) in wxListBox::DoSetSelection(): invalid
index in wxListBox::SetSelection
Error in GUI startup. If necessary, please
report this error to the GRASS developers.
Switching to text mode now.
Hit RETURN to continue...
}}}

I have Python 2.5, wxPython widgets, numPy, and the python extensions
suggested on the installer download page. These are installed in
c:\Python25. My computer uses Windows Vista. What do I need to do to fix
this?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Vista
-------------------------+--------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: minor | Milestone: 6.3.0
Component: Python | Version: 6.3.0 RCs
Resolution: worksforme | Keywords: wxPython, Windows, Vista
-------------------------+--------------------------------------------------
Changes (by jrobins):

  * priority: major => minor
  * status: new => closed
  * resolution: => worksforme

Comment:

I apologize for reporting this trivial error. I found that the root of
this problem was that my [[BR]]
GIS data directory had been set to 'c:\grass\GIS Database'. This is the
default value[[BR]]
when winGRASS is installed using the experimental installer program. The
space in the[[BR]]
directory name was causing problems inside the Python code. When I
changed the GISDBASE[[BR]]
variable to a path without spaces, the wxPython GUI launched correctly.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Python | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Changes (by marisn):

  * priority: minor => major
  * status: closed => reopened
  * summary: wxPython GUI fails in Vista => wxPython GUI fails in Windows
              if GISDBASE contains spaces
  * resolution: worksforme =>
  * milestone: 6.3.0 => 6.4.0

Comment:

Reopening as all failures due to spaces in path's need to be fixed sooner
or later. Changed ticket summary to match problem.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Python | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Comment (by martinl):

Replying to [comment:2 marisn]:
> Reopening as all failures due to spaces in path's need to be fixed
sooner or later. Changed ticket summary to match problem.

Under Windows XP wxGUI seems to work even with whitespaces in path.

{{{
g.gisenv.exe
GISDBASE='C:\grass data';
LOCATION_NAME='spearfish60';
MAPSET='PERMANENT';
GRASS_GUI='wxpython';
}}}

I started GUI without visible problems.

Martin
Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Python | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Comment (by 4everskiff):

Replying to [comment:1 jrobins]:
> I apologize for reporting this trivial error. I found that the root of
this problem was that my [[BR]]
> GIS data directory had been set to 'c:\grass\GIS Database'. This is the
default value[[BR]]
> when winGRASS is installed using the experimental installer program.
The space in the[[BR]]
> directory name was causing problems inside the Python code. When I
changed the GISDBASE[[BR]]
> variable to a path without spaces, the wxPython GUI launched correctly.

I confirm, as Martin, that on XP spaces in GISDBASE don't create errors;
this is apparently another Vista problem!

Could you try with tcl-tk GUI, please?

Marco

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Python | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Comment (by jrobins):

Replying to [comment:4 4everskiff]:
> I confirm, as Martin, that on XP spaces in GISDBASE don't create errors;
this is apparently another Vista problem!
>
> Could you try with tcl-tk GUI, please?
>
> Marco

I tried using the path 'c:\grass\GIS Database' in Tcl-Tk and it worked
fine. I guess that this is a wxPython problem, then?

John

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Python | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Comment (by 4everskiff):

Replying to [comment:5 jrobins]:
> Replying to [comment:4 4everskiff]:
> > I confirm, as Martin, that on XP spaces in GISDBASE don't create
errors; this is apparently another Vista problem!
> >
> > Could you try with tcl-tk GUI, please?
> >
> > Marco
>
> I tried using the path 'c:\grass\GIS Database' in Tcl-Tk and it worked
fine. I guess that this is a wxPython problem, then?
>
> John

John,

I think we should say that is a "wxPython/Vista problem".

Marco

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows Vista if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Python | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Changes (by 4everskiff):

  * summary: wxPython GUI fails in Windows if GISDBASE contains spaces =>
              wxPython GUI fails in Windows Vista if GISDBASE
              contains spaces

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows Vista if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: Python | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Comment (by hamish):

I think it is a very big call to say that "on XP spaces in GISDBASE don't
create errors". I will guarantee there is somewhere in the code which
doesn't quote a path name and so will have problems with a space in one,
regardless of OS.

Before labeling things as "on Vista", I'd like to know if someone else can
confirm that? And if so, is this really a wx for Win bug not a GRASS bug?

{{{
..\..\src\msw\listbox.cpp(390) in wxListBox::DoSetSelection(): invalid
index in wxListBox::SetSelection
}}}

or did we pass that a truncated entry?

Also, I don't really see the point in leaving a bug report open for a
vague things like "may cause problems". We know that, but it's something
that is very hard to systematically audit, so we just have to wait for
specific bug reports to roll in..

2c,
Hamish

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/114#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#114: wxPython GUI fails in Windows Vista if GISDBASE contains spaces
----------------------+-----------------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
----------------------+-----------------------------------------------------
Changes (by martinl):

  * component: Python => wxGUI

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

#114: wxPython GUI fails in Windows Vista if GISDBASE contains spaces
------------------------------+---------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: reopened
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.3.0 RCs
Resolution: | Keywords: wxPython, Windows, Vista
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Changes (by neteler):

  * platform: => MSWindows Vista
  * cpu: => Unspecified

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

#114: wxPython GUI fails in Windows Vista if GISDBASE contains spaces
------------------------------+---------------------------------------------
  Reporter: jrobins | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.3.0 RCs
Resolution: worksforme | Keywords: wxPython, Windows, Vista
  Platform: MSWindows Vista | Cpu: Unspecified
------------------------------+---------------------------------------------
Changes (by marcopx):

  * status: reopened => closed
  * resolution: => worksforme

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