After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 586698 - tutorial describes incorrect function usage
tutorial describes incorrect function usage
Status: RESOLVED FIXED
Product: LDTP
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: LDTP maintainers
LDTP Development Mailing List
Depends on:
Blocks:
 
 
Reported: 2009-06-22 22:39 UTC by Andres Salomon
Modified: 2009-06-23 08:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andres Salomon 2009-06-22 22:39:23 UTC
The tutorial at http://download.freedesktop.org/ldtp/doc/ldtp-tutorial.pdf using launchapp("gedit", 1) to launch applications.  However, this doesn't appear to actually work.

With ldtp 1.6, I get the following:

Python 2.5.4 (r254:67916, Feb 17 2009, 20:16:45) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ldtp import *
>>> launchapp("gedit", 1)
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
  • File "/usr/lib/pymodules/python2.5/ldtp.py", line 3675 in launchapp
    arg.insert (0, appName)
AttributeError: 'int' object has no attribute 'insert'


With ldtp 1.2 (from debian stable), I get the following:

Python 2.5.2 (r252:60911, Jan  4 2009, 17:40:26) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ldtp import *
>>> launchapp("gedit", 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/python-support/python2.5/ldtp.py", line 3173, in launchapp
    os.execvpe (appName, arg, envVar)
  File "/usr/lib/python2.5/os.py", line 363, in execvpe
    _execvpe(file, args, env)
  File "/usr/lib/python2.5/os.py", line 390, in _execvpe
    func(fullname, *argrest)
TypeError: execve() arg 2 must be a tuple or list


Note that in both cases, dropping the second argument allows launchapp to succeed.  The tutorial should be updated to drop the second arg as well.
Comment 1 Nagappan Alagappan 2009-06-23 08:35:00 UTC
Thanks for the bug report. Have uploaded the updated doc.

Thanks.