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 449318 - API change in 2.11.4 borks pygtk-2.10.4
API change in 2.11.4 borks pygtk-2.10.4
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: gtk
2.10.x
Other Linux
: Immediate blocker
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
: 450044 450440 452570 (view as bug list)
Depends on:
Blocks: 459740
 
 
Reported: 2007-06-20 00:59 UTC by Joseph Sacco
Modified: 2008-01-03 18:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
patch against trunk to remove accessors for private GtkTooltips struct (2.37 KB, patch)
2007-06-22 13:53 UTC, Sven Neumann
none Details | Review

Description Joseph Sacco 2007-06-20 00:59:53 UTC
gtktooltips.h contains a struct, _GtkTooltips, that contains an element

       GList *_tips_data_list; /* unused */

In gtk+-2.11.3, the element was named

       GList *tips_data_list;

This element is used by pygtk-2.10.4 in ./gtk/gtk.override,

To get pygtk to build I patched that file

--- pygtk-2.10.4/gtk/gtk.override-  2007-06-19 20:39:19.000000000 -0400
+++ pygtk-2.10.4/gtk/gtk.override   2007-06-19 20:39:35.000000000 -0400
@@ -3127,7 +3127,7 @@
 static PyObject *
 _wrap_gtk_tooltips__get_tips_data_list(PyGObject *self, void *closure)
 {
-    GList *list = GTK_TOOLTIPS(self->obj)->tips_data_list;
+    GList *list = GTK_TOOLTIPS(self->obj)->_tips_data_list;
     gint         i, length;
     PyObject    *pylist;
     GList *iter;

The question is whether or not tips_data_list will be available in future, irrespective of the leading "_".

If this element is to be removed, the pygtk team needs to make some changes. 

[I looked at SVN-trunk. pygtk still uses tips_data_list.]


-Joseph
Comment 1 Joseph Sacco 2007-06-20 01:29:42 UTC
Redirecting this report to PYGTK.


-Joseph
Comment 2 Tim Janik 2007-06-20 08:49:38 UTC
(In reply to comment #0)
> gtktooltips.h contains a struct, _GtkTooltips, that contains an element
> 
>        GList *_tips_data_list; /* unused */
> 
> In gtk+-2.11.3, the element was named
> 
>        GList *tips_data_list;
> 
> This element is used by pygtk-2.10.4 in ./gtk/gtk.override,

this element will be useless in newer Gtk+ versions, which is why we did a slight rename to make it easier to catch cases like this. from the README:

  * The GtkTooltips struct (this is the old tooltips API) is now considered
    private. Code that used to access this struct, in particular the
    tips_data_list field, will need to change.

the old tooltips are now maintained in a hash table instead of a list, so if you continue to use _tips_data_list, you could just as well write literally NULL there. the tooltip hashtable cannot be accessed, and the tooltips of the new tooltip system GtkTooltip can also not be accessed/enumerated.
Comment 3 Elijah Newren 2007-06-21 13:19:35 UTC
Just a heads up:  This issue is blocking the release of GNOME-2.19.4.  (Downgrading gtk+ to 2.11.3 would result in all c++ apps not compiling, so we had to bump gtk+ up.)  I probably should have commented sooner about this, sorry.  (I assumed it was a simple fix and someone would do it in a few minutes.  I shouldn't have assumed.)
Comment 4 Luca Ferretti 2007-06-21 19:14:07 UTC
Is seems to break the pygtk build on jhbuild sandbox:

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/opt/gnome2/include/python2.4 -I/opt/gnome2/include/pygtk-2.0 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I./gtk -I/opt/gnome2/include/pycairo -I/opt/gnome2/include/cairo -I/opt/gnome2/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/gnome2/include/gtk-2.0 -I/opt/gnome2/lib/gtk-2.0/include -I/opt/gnome2/include/atk-1.0 -I/opt/gnome2/include/cairo -I/opt/gnome2/include/pango-1.0 -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/opt/gnome2/include -I/usr/include/freetype2 -I/usr/include/libpng12 -g -O2 -Wall -std=c9x -fno-strict-aliasing -MT _gtk_la-gtk.lo -MD -MP -MF .deps/_gtk_la-gtk.Tpo -c gtk.c  -fPIC -DPIC -o .libs/_gtk_la-gtk.o
gtk.c: In function '_wrap_gtk_entry_get_inner_border':
gtk.c:41290: warning: assignment discards qualifiers from pointer target type
gtk.c: In function '__GtkNotebook_class_init':
gtk.c:62730: warning: assignment from incompatible pointer type
gtk.c:62750: warning: assignment from incompatible pointer type
gtk.c: In function '__GtkScrolledWindow_class_init':
gtk.c:68636: warning: assignment from incompatible pointer type
./gtk.override: In function '_wrap_gtk_tooltips__get_tips_data_list':
./gtk.override:3130: error: 'GtkTooltips' has no member named 'tips_data_list'
make[2]: *** [_gtk_la-gtk.lo] Error 1
make[2]: Leaving directory `/home/luca/svn/gnome2/pygtk/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/luca/svn/gnome2/pygtk'
make: *** [all] Error 2
Comment 5 Daniel Macks 2007-06-22 02:58:01 UTC
I think bug #447214 is where this change was discussed and approved?
Comment 6 Gustavo Carneiro 2007-06-22 12:45:48 UTC
*** Bug 450044 has been marked as a duplicate of this bug. ***
Comment 7 Sven Neumann 2007-06-22 13:53:11 UTC
Created attachment 90452 [details] [review]
patch against trunk to remove accessors for private GtkTooltips struct
Comment 8 Johan (not receiving bugmail) Dahlin 2007-06-23 18:57:41 UTC
*** Bug 450440 has been marked as a duplicate of this bug. ***
Comment 9 Johan (not receiving bugmail) Dahlin 2007-06-23 18:58:46 UTC
(In reply to comment #7)
> Created an attachment (id=90452) [edit]
> patch against trunk to remove accessors for private GtkTooltips struct
> 

This will break existing pygtk programs accessing these fields, which is something we should avoid.
Comment 10 Sven Neumann 2007-06-23 20:26:34 UTC
You don't really have a choice as these fields are private and have been private.
Comment 11 Johan (not receiving bugmail) Dahlin 2007-06-23 20:36:02 UTC
(In reply to comment #10)
> You don't really have a choice as these fields are private and have been
> private.
> 

Yes we do, the whole PyGTK API is public, there are no private parts of it regardless of private fields in gtk+. Even if a mistake was made to use a private API of Gtk+ we should still stick to the exported Python API.

For instance, gtk.Tooltips.tips_data_list should probably just return an empty list. As for the other fields, it's probably better just to leave them as they were. I know that plenty of code exists out there that uses tip_window and tip_label.
Comment 12 Sven Neumann 2007-06-23 21:03:48 UTC
Ok, if that is how you want to handle this, then you probably don't need to do anything as the incompatible renaming of the tips_data_list memeber is likely to be changed back in GTK+. And it will always contain NULL (the empty LIST).
Comment 13 Johan (not receiving bugmail) Dahlin 2007-06-24 12:50:49 UTC
I committed a fix to pygtk trunk (rev 2831)
But I still think the change should be reverted to allow pygtk 2.10.4 to compile against gtk+ trunk.
Comment 14 Elijah Newren 2007-06-24 23:40:51 UTC
Could you release a tarball as well?
Comment 15 Johan (not receiving bugmail) Dahlin 2007-06-26 00:07:02 UTC
(In reply to comment #14)
> Could you release a tarball as well?
> 

Unfortunately I don't have much time this week, maybe during the weekend or early next week.
Comment 16 Johan (not receiving bugmail) Dahlin 2007-06-30 14:36:07 UTC
*** Bug 452570 has been marked as a duplicate of this bug. ***
Comment 17 Andreas Røsdal 2007-08-04 21:42:09 UTC
This API change has caused this bug in glChess:  #459740.