'import ldtp' crashes - incorrect use of gi.repository

Bug #845729 reported by Vadim Rutkovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ldtp (Ubuntu)
Fix Released
Undecided
Michael Terry

Bug Description

TEST CASE:
1. Start python
2. Input 'import ldtp'

Result: exception occurs:

------
>>> import ldtp
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/ldtpd/__init__.py", line 46, in main
    from xmlrpc_daemon import XMLRPCLdtpd
  File "/usr/lib/pymodules/python2.7/ldtpd/xmlrpc_daemon.py", line 23, in <module>
    from core import Ldtpd
  File "/usr/lib/pymodules/python2.7/ldtpd/core.py", line 22, in <module>
    from pyatspi import findDescendant, Registry
  File "/usr/lib/python2.7/dist-packages/pyatspi/__init__.py", line 17, in <module>
    from gi.repository import Atspi
  File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 23, in <module>
    from ._gi import _API, Repository
ImportError: could not import gobject (error was: ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".',))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.7/ldtp/__init__.py", line 491, in <module>
    _populateNamespace(globals())
  File "/usr/lib/pymodules/python2.7/ldtp/__init__.py", line 225, in _populateNamespace
    for method in client._client.system.listMethods():
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1575, in __request
    verbose=self.__verbose
  File "/usr/lib/pymodules/python2.7/ldtp/client.py", line 77, in request
    self, host, handler, request_body, verbose=0)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1292, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1439, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 951, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 811, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 773, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 754, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 111] Connection refused
-----------

Note, that in clean python session 'from pyatspi import findDescendant, Registry' or 'from gi.repository import Atspi' work correctly

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: ldtp 2.1.1-2ubuntu1
ProcVersionSignature: User Name 3.0.0-10.16-generic 3.0.4
Uname: Linux 3.0.0-10-generic i686
ApportVersion: 1.22.1-0ubuntu2
Architecture: i386
Date: Fri Sep 9 08:32:35 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Beta i386 (20110418)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ldtp
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Vadim Rutkovsky (roignac) wrote :
Revision history for this message
Nagappan Alagappan (nagappan) wrote :

This issue has been fixed in LDTP git head

Michael Terry (mterry)
Changed in ldtp (Ubuntu):
assignee: nobody → Michael Terry (mterry)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ldtp - 2.2.0-1ubuntu1

---------------
ldtp (2.2.0-1ubuntu1) oneiric; urgency=low

  * Merge from Debian, to fix import errors (LP: #845729)
  * Remaining changes:
    - debian/control: Depend on python-pyatspi2 instead of python-pyatspi
  * debian/control:
    - Update dependencies to refer to gir1.2 packages
 -- Michael Terry <email address hidden> Fri, 07 Oct 2011 15:50:17 -0400

Changed in ldtp (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.