Opened 16 years ago

Closed 16 years ago

#289 closed defect (fixed)

setting 'at=' to anything crashes raster legend

Reported by: msieczka Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: wxGUI Version: svn-develbranch6
Keywords: Cc:
CPU: All Platform: All

Description

Playing around with raster legend settings in wxGUI I got a following error. Can't tell the exact way to reproduce.

Traceback (most recent call last):
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/gd
ialogs.py", line 408, in OnOK

self.parent.MapWindow.UpdateMap()
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/ma
pdisp.py", line 715, in UpdateMap

for img in self.GetOverlay():
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/ma
pdisp.py", line 592, in GetOverlay

if os.path.isfile(overlay.mapfile) and
os.path.getsize(overlay.mapfile):
  File "/usr/lib/python2.5/posixpath.py", line 208, in
isfile

st = os.stat(path)
TypeError
:
coercing to Unicode: need string or buffer, NoneType found
Traceback (most recent call last):
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/gd
ialogs.py", line 408, in OnOK

self.parent.MapWindow.UpdateMap()
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/ma
pdisp.py", line 664, in UpdateMap

windres=windres)
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 875, in Render

self._renderLayers(force, mapWindow, maps, masks, opacities)
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 821, in _renderLayers

if not layer.Render():
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 189, in Render

del os.environ["GRASS_PNGFILE"]
  File "/usr/lib/python2.5/os.py", line 499, in __delitem__

del self.data[key]
KeyError
:
'GRASS_PNGFILE'
Traceback (most recent call last):
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/gd
ialogs.py", line 408, in OnOK

self.parent.MapWindow.UpdateMap()
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/ma
pdisp.py", line 664, in UpdateMap

windres=windres)
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 875, in Render

self._renderLayers(force, mapWindow, maps, masks, opacities)
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 821, in _renderLayers

if not layer.Render():
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 189, in Render

del os.environ["GRASS_PNGFILE"]
  File "/usr/lib/python2.5/os.py", line 499, in __delitem__

del self.data[key]
KeyError
:
'GRASS_PNGFILE'
Traceback (most recent call last):
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/gd
ialogs.py", line 408, in OnOK

self.parent.MapWindow.UpdateMap()
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/ma
pdisp.py", line 664, in UpdateMap

windres=windres)
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 875, in Render

self._renderLayers(force, mapWindow, maps, masks, opacities)
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 821, in _renderLayers

if not layer.Render():
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/re
nder.py", line 189, in Render

del os.environ["GRASS_PNGFILE"]
  File "/usr/lib/python2.5/os.py", line 499, in __delitem__

del self.data[key]
KeyError
:
'GRASS_PNGFILE'

Change History (2)

comment:1 by msieczka, 16 years ago

Summary: error changing raster legend settingssetting 'at=' to anything crashes raster legend

Now I know what's the origin of the problem: setting the 'at=' option to anything, e.g. '0,0'. The initial error is:

Traceback (most recent call last):
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/gd
ialogs.py", line 408, in OnOK

self.parent.MapWindow.UpdateMap()
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/ma
pdisp.py", line 715, in UpdateMap

for img in self.GetOverlay():
  File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/ma
pdisp.py", line 592, in GetOverlay

if os.path.isfile(overlay.mapfile) and
os.path.getsize(overlay.mapfile):
  File "/usr/lib/python2.5/posixpath.py", line 208, in
isfile

st = os.stat(path)
TypeError
:
coercing to Unicode: need string or buffer, NoneType found

The rest of the errors crops out when I press "OK" again.

comment:2 by cmbarton, 16 years ago

Resolution: fixed
Status: newclosed

This was fixed in recent improvements to overlays. I just tested it and it works fine.

Note: See TracTickets for help on using tickets.