[GRASS-dev] OSGeo4W GRASS 7 startup error

Hi,

we are currently trying to install G7/OSGeo4W on a CZ laptop in the
office, but both 6.4.svn and 7.svn fail.
While I cannot ready the startup error in G6 (terminal closes too
quickly), we reach the command line in G7. The error is

Launching <wxpython> GUI in the background, please wait...
GRASS 7.0.svn> Traceback (most recent call last):
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\wxgui.py", line 39,
in <module>
    from lmgr.frame import GMFrame
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\lmgr\frame.py", lin
e 50, in <module>
    from lmgr.layertree import LayerTree, LMIcons
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\lmgr\layertree.py",
line 37, in <module>
    from mapdisp.frame import MapFrame
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\mapdisp\frame.py",
line 71, in <module>
    class MapFrame(SingleMapFrame):
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\mapdisp\frame.py",
line 77, in MapFrame
    page = None, Map = Map(), auimgr = None, name = 'MapWindow', **kwargs):
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 400, in __init__
    self.GetWindow()
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 495, in GetWindow
    key, value = line.split(":", 1)
ValueError: need more than 1 value to unpack

Any ideas about this?

thanks
Markus

Hi Markus,

2014-02-27 18:13 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

we are currently trying to install G7/OSGeo4W on a CZ laptop in the
office, but both 6.4.svn and 7.svn fail.
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\mapdisp\frame.py",
line 77, in MapFrame
    page = None, Map = Map(), auimgr = None, name = 'MapWindow', **kwargs):
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 400, in __init__
    self.GetWindow()
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 495, in GetWindow
    key, value = line.split(":", 1)
ValueError: need more than 1 value to unpack

strangely I cannot reproduce this bug on the server where these builds
are being created. There is Czech MS Windows 2008 Server. I will try
out also my laptop with Windows 8 CZ.

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

On Thu, Feb 27, 2014 at 6:13 PM, Markus Neteler <neteler@osgeo.org> wrote:

Hi,

we are currently trying to install G7/OSGeo4W on a CZ laptop in the
office, but both 6.4.svn and 7.svn fail.
While I cannot ready the startup error in G6 (terminal closes too
quickly),

With aggressive screenshot generation I caught the G6 error, too :slight_smile:
See attachment.

It is a Windows7 Machine.

Markus

(attachments)

osgeo4w_grass64svn_wx.jpg

Hi,

2014-02-27 18:19 GMT+01:00 Martin Landa <landa.martin@gmail.com>:

we are currently trying to install G7/OSGeo4W on a CZ laptop in the
office, but both 6.4.svn and 7.svn fail.
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\mapdisp\frame.py",
line 77, in MapFrame
    page = None, Map = Map(), auimgr = None, name = 'MapWindow', **kwargs):
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 400, in __init__
    self.GetWindow()
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 495, in GetWindow
    key, value = line.split(":", 1)
ValueError: need more than 1 value to unpack

strangely I cannot reproduce this bug on the server where these builds
are being created. There is Czech MS Windows 2008 Server. I will try
out also my laptop with Windows 8 CZ.

tested also on MS Windows 7 CZ with fresh OSGeo4w installation
(32bit), everything seems to work. Could you please try to modify
`render.py` in your installation folder to print content of 'line'
variable?

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

On Thu, Feb 27, 2014 at 7:24 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2014-02-27 18:19 GMT+01:00 Martin Landa <landa.martin@gmail.com>:

we are currently trying to install G7/OSGeo4W on a CZ laptop in the
office, but both 6.4.svn and 7.svn fail.
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\mapdisp\frame.py",
line 77, in MapFrame
    page = None, Map = Map(), auimgr = None, name = 'MapWindow', **kwargs):
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 400, in __init__
    self.GetWindow()
  File "C:\OSGeo4W\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\render.py", li
ne 495, in GetWindow
    key, value = line.split(":", 1)
ValueError: need more than 1 value to unpack

strangely I cannot reproduce this bug on the server where these builds
are being created. There is Czech MS Windows 2008 Server. I will try
out also my laptop with Windows 8 CZ.

tested also on MS Windows 7 CZ with fresh OSGeo4w installation
(32bit), everything seems to work. Could you please try to modify
`render.py` in your installation folder to print content of 'line'
variable?

I did Python debugging in the end:
http://grasswiki.osgeo.org/wiki/GRASS_Debugging#Python_script_debugging

It turned out that the WIND file contained only
NULNULNUL...

        for line in windfile.readlines():
            import pdb; pdb.set_trace()
            line = line.strip()
            key, value = line.split(":", 1)
            self.wind[key.strip()] = value.strip()

Launching <wxpython> GUI in the background, please wait...
GRASS 7.0.svn> > c:\osgeo4w\apps\grass\grass-7.0.svn\etc\gui\wxpython\core\rende
r.py(495)GetWindow()
-> line = line.strip()
(Pdb) line
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
(Pdb)

No idea how that can happen.
g.region -d
solved it.

Dunno if the function should have a test for WIND-may-contain-junk?

Markus

Hi Markus,

2014-02-28 9:17 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

It turned out that the WIND file contained only
NULNULNUL...

        for line in windfile.readlines():
            import pdb; pdb.set_trace()
            line = line.strip()
            key, value = line.split(":", 1)
            self.wind[key.strip()] = value.strip()

Launching <wxpython> GUI in the background, please wait...

really strange, in any case in r59148 wxGUI tries to recover from
default region.

GRASS 7.0.svn (test):~/src/grass_trunk/gui/wxpython >
ERROR: Unable to read WIND file: need more than 1 value to unpack
Trying to recover from default region...

Martin

--
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

hi Martin,

On Fri, Feb 28, 2014 at 12:33 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi Markus,

2014-02-28 9:17 GMT+01:00 Markus Neteler <neteler@osgeo.org>:

It turned out that the WIND file contained only
NULNULNUL...

        for line in windfile.readlines():
            import pdb; pdb.set_trace()
            line = line.strip()
            key, value = line.split(":", 1)
            self.wind[key.strip()] = value.strip()

Launching <wxpython> GUI in the background, please wait...

really strange, in any case in r59148 wxGUI tries to recover from
default region.

GRASS 7.0.svn (test):~/src/grass_trunk/gui/wxpython >
ERROR: Unable to read WIND file: need more than 1 value to unpack
Trying to recover from default region...

perfect - like this it is now self-healing.

Thanks for the fix
Markus