Bug 515455 - problem with pycairo 1.8.2 C API
Summary: problem with pycairo 1.8.2 C API
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pycairo
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Matthew Barnes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-08-04 11:22 UTC by Steve
Modified: 2009-08-05 09:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-05 09:00:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Steve 2009-08-04 11:22:08 UTC
There is a problem with the pycairo 1.8.2 C API.

In pycairo-pattern.c, PyObject *PycairoPattern_FromPattern
was changed from
PyObject *PycairoPattern_FromPattern (cairo_pattern_t *pattern)
to
PyObject *PycairoPattern_FromPattern (cairo_pattern_t *pattern, PyObject *base)

but in pycairo.h
the typedef Pycairo_CAPI_t still has
PyObject *(*Pattern_FromPattern)(cairo_pattern_t *pattern);

This can cause problems for python modules/programs which use Pycairo_CAPI_t.

Upgrading to pycairo 1.8.4 or 1.8.6, and recompiling all the modules which use Pycairo_CAPI_t (for example pygtk2 and pygoocanvas) fixes the problem.

Comment 1 Matthew Barnes 2009-08-04 16:40:02 UTC
Huh, I've had pycairo 1.8.6 built for Fedora 11 for awhile now but apparently never pushed it to Fedora Updates.

Are you sure the other packages need rebuilt?  Is this an ABI break somehow?  What kind of problems is it causing currently?

Comment 2 Steve 2009-08-05 00:39:01 UTC
Yes.
Yes.
http://bugs.freedesktop.org/show_bug.cgi?id=23073

Comment 3 Matthew Barnes 2009-08-05 01:34:49 UTC
Neither of the reproducers in the fd.o bug throw an exception for me on Fedora 11 (the one using pygtk/pangocairo or the one that doesn't).  What am I missing?

Tested with:
python-2.6-9.fc11.i586
pycairo-1.8.2-2.fc11.i586
pygtk2-2.14.1-1.fc11.i586

Comment 4 Steve 2009-08-05 01:57:51 UTC
Did you test with both pycairo-1.8.2 and pycairo-1.8.6 ?

The problem was:
1. pycairo-1.8.2 with pygtk2-2.14.1 worked OK.
2. Upgrading to pycairo-1.8.6 and using pygtk2-2.14.1 compiled against pycairo-1.8.2 gave the error.
3. Using pycairo-1.8.6 with pygtk2-2.14.1 recompiled against pycairo-1.8.6, fixed the problem.

Comment 5 Matthew Barnes 2009-08-05 02:38:20 UTC
It sounds then like Fedora 11 should remain frozen on pycairo 1.8.2 and live with the API discrepancy, since fixing it requires an ABI break.  Rawhide already has pycairo 1.8.6, and we just had a mass rebuild of all Fedora 12 packages, so there should be no problems there.

Is there anything more to do here?

Comment 6 Steve 2009-08-05 03:43:33 UTC
It depends if you want to fix the underlying problem in Fedora 11, or simply wait for pycairo 1.8.6 in Fedora 12 where the problem will disappear.

In pycairo 1.8.2 any other package which uses the pycairo C function PycairoPattern_FromPattern (or other functions listed after it in Pycairo_CAPI_t) will probably experience problems.

There are not many packages using Pycairo_CAPI_t, so Fedora 11 may not receive any related bug reports. However, (non-Fedora) pygoocanvas 0.14 did experience problems, shown here
http://bugzilla.gnome.org/show_bug.cgi?id=581895
and solved it by requiring pycairo 1.8.4.

Comment 7 Matthew Barnes 2009-08-05 09:00:54 UTC
I'd rather wait it out than break ABI in a stable Fedora release and deal with all the issues that brings.  Thanks for bringing the issue to my attention though.  I'll close this as being fixed in Rawhide.


Note You need to log in before you can comment on or make changes to this bug.