[GRASS-dev] [GRASS GIS] #888: Error in i.ortho.photo

#888: Error in i.ortho.photo
---------------------------+------------------------------------------------
Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Keywords: i.ortho.photo | Platform: Linux
      Cpu: Unspecified |
---------------------------+------------------------------------------------
I'm running GRASS 6.4-svn in a Linux Machine (CENT OS) and I needed to run
i.ortho.photo but I got this error:
Exception in thread Thread-8:
Traceback (most recent call last):
      File "/usr/lib64/python2.4/threading.py", line 442, in
__bootstrap
         self.run( )
      File "/usr/local/grass-5.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 528, in run
         stderr=subprocess.PIPE)
     File "/usr/lib64/python2.4/subprocess.py", line 550, in
__init__
          errread, errwrite)
     File "/usr/lib64/python2.4/subprocess.py", line 993, in
_execute_child
          raise child_exception
TypeError: execv( ) arg 2 must contain only strings
Traceback (most recent call last):
     File "/usr/local/grass-6.4svn/etc/wxpython/wxgui.py",
line 1019, in 0nXTerm

p= gcmd.Command(cmdlist)
     File "/usr/local/grass-6.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 345, in __init__

Debug.msg (3, "Command( ): cmd='%s', wait=%s, returncode=%d,
alive=%s" % \
TypeError
:
sequence item 2: exepected string, list found

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):

Try turning off debug messages;

but that fails from the wx command console because it tries to parse the
second "=" in {{{ g.gisenv set="DEBUG=0" }}}

Hamish

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by nikosdu1980):

By doing:
g.gisenv set="DEBUG=0"
If if insert i.ortho.photo in command line, it opens the i.ortho.photo
menu
But If I choose in GUI menu it gives the following error:
Exception in thread Thread-9:
Traceback (most recent call last):
    File "/usr/lib64/python2.4/threading.py", line 442, in
__bootstrap
      self.run()
    File "/usr/local/grass6.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 528, in run
      stderr=subprocess.PIPE)
    File "usr/lib64/python2.4/subprocess.py", line 550, in
__init__
      errread, errwrite)
    File "usr/lib64/python2.4/subprocess.py", line 993, in
_execute_child
      raise child_exception
TypeError: execv() arg 2 must contain only strings
Traceback (most recent call last):
   File "/usr/local/grass-6.4.0svn/etc/wxpython/wxgui.py",
line 1019, in 0xTerm

p=gcmd.Command(cmdlist)
   File "/usr/local/grass-6.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 345, in __init__

Debug.msg (3, "Command(): cmd='%s', wait=%s, returncode=%d,
alive=%s" % \
TypeError
:
sequence item 2:expected string, list found

And opens a blank xmonitor

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):

AFAICT in gui/wxpython/gui_modules/gcmd.py the "wait" variable should be
True/False, but that should print out ok as a %s string.

I've got no idea how that could be turning itself into a list.

  * note at this point in the code it has already failed, this is in the
error handling logic)

  * see also ticket #693; the XTerm stuff has not all been backported from
6.5. I'm not able to test 6.4 right now, but in the very latest 6.5svn it
works for me.

workaround: from the command prompt do:
{{{
d.mon x0
i.ortho.photo
}}}

Hamish

ps- put { { { ... } } } (with no spaces in between) around formatted text
to show it verbatim.

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by nikosdu1980):

With {{{ d.mon x0 }}} command I got a windows saying "Command 'd.mon'
not yet implemented so there is no way I can test that.
If I insert i.ortho.photo in command windows it works (I as far as I can
see). How can I change menudata.xml in order to avoid this error?

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):

Hamish:
> > from the command prompt do:

Nikos:
> With d.mon x0 command I got a windows saying
> "Command 'd.mon' not yet implemented

Sorry to be confusing, I meant the terminal command prompt, not the GUI
one.
(the xterm, gnome-terminal, etc. at the GRASS> prompt)

> If I insert i.ortho.photo in command windows it works

(the xterm, gnome-terminal, etc. GRASS> prompt, right?)

somehow in the wxPython code the "wait" variable is becoming a list on
your system. That doesn't happen for me and I don't see any obvious reason
for it in the code. A more expert wxPy'er than myself would need to tell
you why and how to fix it.

Hamish

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Old description:

I'm running GRASS 6.4-svn in a Linux Machine (CENT OS) and I needed to
run i.ortho.photo but I got this error:
Exception in thread Thread-8:
Traceback (most recent call last):
     File "/usr/lib64/python2.4/threading.py", line 442, in
__bootstrap
        self.run( )
     File "/usr/local/grass-5.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 528, in run
        stderr=subprocess.PIPE)
    File "/usr/lib64/python2.4/subprocess.py", line 550, in
__init__
         errread, errwrite)
    File "/usr/lib64/python2.4/subprocess.py", line 993, in
_execute_child
         raise child_exception
TypeError: execv( ) arg 2 must contain only strings
Traceback (most recent call last):
    File "/usr/local/grass-6.4svn/etc/wxpython/wxgui.py",
line 1019, in 0nXTerm

p= gcmd.Command(cmdlist)
    File "/usr/local/grass-6.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 345, in __init__

Debug.msg (3, "Command( ): cmd='%s', wait=%s, returncode=%d,
alive=%s" % \
TypeError
:
sequence item 2: exepected string, list found

New description:

I'm running GRASS 6.4-svn in a Linux Machine (CENT OS) and I needed to run
i.ortho.photo but I got this error:
{{{
Exception in thread Thread-8:
Traceback (most recent call last):
      File "/usr/lib64/python2.4/threading.py", line 442, in
__bootstrap
         self.run( )
      File "/usr/local/grass-5.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 528, in run
         stderr=subprocess.PIPE)
     File "/usr/lib64/python2.4/subprocess.py", line 550, in
__init__
          errread, errwrite)
     File "/usr/lib64/python2.4/subprocess.py", line 993, in
_execute_child
          raise child_exception
TypeError: execv( ) arg 2 must contain only strings
Traceback (most recent call last):
     File "/usr/local/grass-6.4svn/etc/wxpython/wxgui.py",
line 1019, in 0nXTerm

p= gcmd.Command(cmdlist)
     File "/usr/local/grass-6.4.0svn/etc/wxpython/gui_modules/g
cmd.py", line 345, in __init__

Debug.msg (3, "Command( ): cmd='%s', wait=%s, returncode=%d,
alive=%s" % \
TypeError
:
sequence item 2: exepected string, list found
}}}

Comment (by hamish):

(fix code quoting)

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by glynn):

Replying to [comment:5 hamish]:

> somehow in the wxPython code the "wait" variable is becoming a list on
your system. That doesn't happen for me and I don't see any obvious reason
for it in the code. A more expert wxPy'er than myself would need to tell
you why and how to fix it.

OnXTerm() is seriously broken, and should be re-written or removed.

E.g.:
{{{
         # run the command
         command = ' '.join(command)
}}}
and:
{{{
                cmdlist = [xtermwrapper, '-e "%s"' % grassrun, command]
}}}

Hint: xterm's "-e" switch doesn't take an argument. It indicates that all
remaining arguments are the program and its arguments (i.e. the next
argument after -e is the program, the one after that is argv[1], etc).

This also applies to the grass-xterm-wrapper and grass-run scripts: they
take individual arguments, not a "command string".

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):

> OnXTerm() is seriously broken, and should be re-written or removed.

It has been re-written in 6.5svn, but this has not been backported to 6.4
yet (see comment:3).

see also
  r39924
  r39928
  r40019
  r40021
  r40619

if there are no objections I'll do the backport later today.

Hamish

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

#888: Error in i.ortho.photo
--------------------------+-------------------------------------------------
  Reporter: nikosdu1980 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: unspecified
Resolution: | Keywords: i.ortho.photo
  Platform: Linux | Cpu: Unspecified
--------------------------+-------------------------------------------------
Comment (by hamish):

see also #693, this bug is really a derivative of that one.

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