Opened 17 years ago

Closed 16 years ago

#114 closed defect (worksforme)

wxPython GUI fails in Windows Vista if GISDBASE contains spaces

Reported by: jrobins Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: wxGUI Version: 6.3.0 RCs
Keywords: wxPython, Windows, Vista Cc:
CPU: Unspecified Platform: MSWindows Vista

Description

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?

Change History (11)

comment:1 by jrobins, 17 years ago

Priority: majorminor
Resolution: worksforme
Status: newclosed

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

comment:2 by marisn, 17 years ago

Milestone: 6.3.06.4.0
Priority: minormajor
Resolution: worksforme
Status: closedreopened
Summary: wxPython GUI fails in VistawxPython GUI fails in Windows if GISDBASE contains spaces

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

in reply to:  2 comment:3 by martinl, 17 years ago

Replying to 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

in reply to:  1 ; comment:4 by 4everskiff, 17 years ago

Replying to jrobins:

I apologize for reporting this trivial error. I found that the root of this problem was that my
GIS data directory had been set to 'c:\grass\GIS Database'. This is the default value
when winGRASS is installed using the experimental installer program. The space in the
directory name was causing problems inside the Python code. When I changed the GISDBASE
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

in reply to:  4 ; comment:5 by jrobins, 17 years ago

Replying to 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

in reply to:  5 comment:6 by 4everskiff, 17 years ago

Replying to jrobins:

Replying to 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

comment:7 by 4everskiff, 17 years ago

Summary: wxPython GUI fails in Windows if GISDBASE contains spaceswxPython GUI fails in Windows Vista if GISDBASE contains spaces

comment:8 by hamish, 17 years ago

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

comment:9 by martinl, 16 years ago

Component: PythonwxGUI

comment:10 by neteler, 16 years ago

CPU: Unspecified
Platform: MSWindows Vista

comment:11 by marcopx, 16 years ago

Resolution: worksforme
Status: reopenedclosed
Note: See TracTickets for help on using tickets.