Gdk.color_parse returns Gdk.Color instead of a tuple after updating python-gobject to 2.90.3-1svn1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pygobject (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I installed Oneiric Beta1, and then updated some packages, among them python-gobject (which pulled a new package, python-gobject-2). After this, System Testing (checkbox-gtk) crashes as described in bug 839675.
As indicated in that bug, the problem is caused by an API-breaking change in PyGTK:
https:/
"
Change Gdk.color_parse() to not return a tuple, instead just
return the created color or None if it wasn't possible to parse
the name into a color.
This keeps compatibility with PyGTK but breaks the current API.
"
So I'm filing this bug to keep track of the fact that the API has changed.
Steps to reproduce:
1- On an Oneiric b1 system check the version of python-gobject, should be 2.28.6-4.
2- Launch a Python shell and execute:
from gi.repository import Gdk
Gdk.color_
3- Result should be a tuple, like (True, <Gdk.Color(
4- update python-gobject by running sudo apt-get install python-gobject. This will bring in python-gobject-2 and versions will be:
python-gobject 2.90.3-1svn1
python-gobject-2 2.28.6-6svn1
5- Again, aunch a Python shell and execute:
from gi.repository import Gdk
Gdk.color_
6- Result is now just a Gdk.color, like: <Gdk.Color(
This was done by http:// git.gnome. org/browse/ pygobject/ commit/ ?id=5b1c875269b 7979caae97e8491 9a690a34d92f29
It is indeed an API break compared to the previous pygobject version, but it actually brings back the API that PyGTK has. Unfortunately this was unavoidable, as the old API returning a bool and a color object was unsafe: it caused crashes when the boolean return value was False, as the returned pointer was invalid.
So this needs to be fixed in checkbox, sorry about that. As there is already a bug about that, I'm just closing this one.