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 652127 - RuntimeError: unable to get the value
RuntimeError: unable to get the value
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-08 17:34 UTC by Michael Terry
Modified: 2018-01-10 20:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't expose fields that cannot be retrieved (989 bytes, text/plain)
2011-08-14 17:06 UTC, Sebastian Pölsterl
Details

Description Michael Terry 2011-06-08 17:34:26 UTC
To reproduce:

from gi.repository import Gtk
w = Gtk.Window()
for k in dir(w):
  print k
  print getattr(w, k)

This will quickly raise the exception "RuntimeError: unable to get the value" on the attribute "bin".  Same problem on the attribute "container" and presumably all the attributes named after parent classes.

This causes problems with some standard modules like inspect.getmembers() that run code much like the above.
Comment 1 Sebastian Pölsterl 2011-08-14 17:06:17 UTC
Created attachment 193822 [details]
Don't expose fields that cannot be retrieved

Accessing fields only works for simple types. The attached patch checks if retrieving the value is actually possible before adding it to the class.
Comment 2 Sebastian Pölsterl 2011-08-15 09:36:52 UTC
Unfortunately, this patch breaks Gdk.Event where fields like "type" get removed.
Comment 3 Martin Pitt 2012-04-04 16:04:31 UTC
Can reproduce with current pygobject master.
Comment 4 Martin Pitt 2012-04-04 16:06:42 UTC
Comment on attachment 193822 [details]
Don't expose fields that cannot be retrieved

Untagging as patch to get it off the patch review queue, as this is not a working solution.
Comment 5 GNOME Infrastructure Team 2018-01-10 20:09:46 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/18.