GNOME Bugzilla – Bug 652127
RuntimeError: unable to get the value
Last modified: 2018-01-10 20:09:46 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.
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.
Unfortunately, this patch breaks Gdk.Event where fields like "type" get removed.
Can reproduce with current pygobject master.
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.
-- 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.