Opened 14 years ago

Closed 14 years ago

#888 closed defect (fixed)

Error in i.ortho.photo

Reported by: nikosdu1980 Owned by: grass-dev@…
Priority: major Milestone: 6.4.0
Component: wxGUI Version: unspecified
Keywords: i.ortho.photo Cc:
CPU: Unspecified Platform: Linux

Description (last modified by hamish)

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

Change History (10)

comment:1 by hamish, 14 years ago

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

comment:2 by nikosdu1980, 14 years ago

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

comment:3 by hamish, 14 years ago

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.

in reply to:  3 comment:4 by nikosdu1980, 14 years ago

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?

comment:5 by hamish, 14 years ago

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

comment:6 by hamish, 14 years ago

Description: modified (diff)

(fix code quoting)

in reply to:  5 comment:7 by glynn, 14 years ago

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

comment:8 by hamish, 14 years ago

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

comment:9 by hamish, 14 years ago

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

comment:10 by hamish, 14 years ago

Resolution: fixed
Status: newclosed

fixed with #693 & backport to the relbr64

Note: See TracTickets for help on using tickets.