GNOME Bugzilla – Bug 756364
[REGRESSION] Gdk.rectangle_intersect is not present anymore with pygobject
Last modified: 2015-10-24 16:32:27 UTC
Trying pitivi with PyGObject I can notice that the Gdk.rectangle_intersect is not exposed anymore but used to be. In the .gir file the symbol is obiously still there and has not been set as 'introspectable=false' so should still be exposed in the API. You can simply reproduce with: python3 -c "from gi.repository import Gdk; import gi; print(Gdk.rectangle_intersect); print(gi.version_info)" sys:1: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '3.0') before import to ensure that the right version gets loaded. Traceback (most recent call last):
+ Trace 235567
return getattr(self._introspection_module, name)
self.__name__, name))
rectangle_intersect is no longer in the gir, it's now an intersect method on the Rectangle type. Probably the same cause as bug 749625, GdkRectangle was added to the gir in 3.18 so some functions are now methods. These functions are affected: gdk_rectangle_get_type (can be ignored imo) gdk_rectangle_intersect gdk_rectangle_union I guess we can add aliases in the override for them.
I think aliases should be added to keep API compatibilty. I will port to Gdk.Rectanle.intersect though.
Actually I can not port keeping backward compatibility, please add aliases :)
Created attachment 313035 [details] [review] Fix Gdk.rectangle_intersect/rectangle_union missing with GTK+ 3.18 3.18 added a Gdk.Rectangle type which changed these functions to methods in the gir. Fix by providing aliases in the Gdk overrides.
Thanks for that :) fmpov they broke the API in Gtk and they should have to somehow maintain API compatibilitie in the gir file themselves instead of needing each GI binding implementation to keep track and write overrides.
(In reply to Thibault Saunier from comment #5) > fmpov they broke the API in Gtk and they should have to somehow maintain API > compatibilitie in the gir file themselves instead of needing each GI binding > implementation to keep track and write overrides. Yeah. gir doesn't make providing compatible things easy afaik. Pushed: https://git.gnome.org/browse/pygobject/commit/?id=dfa3a85290dd97ecd7cbe8f12fbc1ff2db5a1155
I wonder if you could not detect seach breakage easily in your documentation tool? (and report *upstream* so that they get it fixed where it should be fixed)
(In reply to Thibault Saunier from comment #7) > I wonder if you could not detect seach breakage easily in your documentation > tool? (and report *upstream* so that they get it fixed where it should be > fixed) There is some work by Philip Withnall comparing gir files: https://git.gnome.org/browse/gobject-introspection/log/?h=wip/api-diff And I've created something similar in pgi comparing typelibs, but it's not finished: https://github.com/lazka/pgi/blob/master/examples/tdump.py
Could you please cherry pick that commit and make a release?
(In reply to Thibault Saunier from comment #9) > Could you please cherry pick that commit and make a release? I should have checked before commiting, it has been cherry-picked https://git.gnome.org/browse/pygobject/commit/?h=pygobject-3-18&id=8e7f6f1458cf1c162c13422c72562b00433b762b -- just waiting the 3.18.1 release then :)
3.18.1 release is out