← Back to team overview

desktop-packages team mailing list archive

[Bug 729933] Re: 2.27.90 => 2.27.91 regression: AttributeError: type object 'Widget' has no attribute '__info__'

 

Ah, I didn't realize this at the time, but this bug is actually invalid
as PyGI isn't meant to play nice with static bindings like PyGTK.  It
was pretty much by accident when it worked before.

The pygobject version in Oneiric doesn't let you dangerously mix them
anymore:

>>> import gtk
>>> from gi.repository import WebKit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  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".',))



** Changed in: pygobject (Ubuntu)
       Status: Incomplete => Invalid

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to pygobject in Ubuntu.
https://bugs.launchpad.net/bugs/729933

Title:
  2.27.90 => 2.27.91 regression: AttributeError: type object 'Widget'
  has no attribute '__info__'

Status in “pygobject” package in Ubuntu:
  Invalid

Bug description:
  Came across this as I was working on dmedia.  This is a simple example
  that triggers it:

  ###
  import sys

  import gtk
  from gi.repository import WebKit

  window = gtk.Window()
  window.set_title('test')
  window.set_default_size(800, 450)
  window.connect('destroy', gtk.main_quit)

  view = WebKit.WebView()
  window.add(view)

  view.load_uri(sys.argv[1])

  window.show_all()
  gtk.main()
  ###

  The above works with pygobject 2.27.90, but with 2.27.91 I get an
  attribute error:

  Traceback (most recent call last):
    File "./dummy-client", line 34, in <module>
      view = WebKit.WebView()
    File "/usr/lib/pymodules/python2.7/gi/module.py", line 261, in __getattr__
      return getattr(self._introspection_module, name)
    File "/usr/lib/pymodules/python2.7/gi/module.py", line 142, in __getattr__
      parent = get_parent_for_object(info)
    File "/usr/lib/pymodules/python2.7/gi/module.py", line 67, in get_parent_for_object
      module = __import__('gi.repository.%s' % namespace, fromlist=[name])
    File "/usr/lib/pymodules/python2.7/gi/importer.py", line 77, in load_module
      dynamic_module._load()
    File "/usr/lib/pymodules/python2.7/gi/module.py", line 242, in _load
      overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
    File "/usr/lib/pymodules/python2.7/gi/overrides/Gtk.py", line 46, in <module>
      Widget = override(Widget)
    File "/usr/lib/pymodules/python2.7/gi/overrides/__init__.py", line 63, in override
      registry.register(type_)
    File "/usr/lib/pymodules/python2.7/gi/overrides/__init__.py", line 38, in register
      self[override_class] = override_class
    File "/usr/lib/pymodules/python2.7/gi/overrides/__init__.py", line 20, in __setitem__
      info = getattr(value, '__info__')
  AttributeError: type object 'Widget' has no attribute '__info__'

  ProblemType: Bug
  DistroRelease: Ubuntu 11.04
  Package: python-gobject 2.27.91-0ubuntu1
  ProcVersionSignature: Ubuntu 2.6.38-5.32-generic 2.6.38-rc6
  Uname: Linux 2.6.38-5-generic x86_64
  Architecture: amd64
  CheckboxSubmission: fdbdfcded0c0bb479a6b52e9ec5af131
  CheckboxSystem: edda5d4f616ca792bf437989cb597002
  Date: Sat Mar  5 16:38:46 2011
  EcryptfsInUse: Yes
  InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007.1)
  ProcEnviron:
   LANGUAGE=en_US:en
   PATH=(custom, user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: pygobject
  UpgradeStatus: Upgraded to natty on 2011-01-30 (34 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pygobject/+bug/729933/+subscriptions