On Wed, 2011-03-23 at 00:24 +0000, Fons Adriaensen wrote:
Hello all,
A full system update yesterday replaced Python 3.1 by 3.2mu (what does the 'mu' mean BTW) and this seems to break pycairo:
Traceback (most recent call last): File "./mkmeter.py", line 3, in <module> from cairo import * File "/usr/lib/python3.2/site-packages/cairo/__init__.py", line 18, in <module> from ._cairo import * ImportError: /usr/lib/python3.2/site-packages/cairo/_cairo.cpython-32mu.so: undefined symbol: PyCObject_FromVoidPtr
And indeed PyCObject_FromVoidPtr() and its inverse, PyCObject_AsVoidPtr() are no longer available in Python 3.2.
They can be replaced by
P = PyCObject_FromVoidPtr(X, destroy) --> P = PyCapsule_New(X, 0, destroy) X = PyCObject_AsVoidPtr(P) --> X = PyCapsule_GetPointer(P, 0)
and the 'destroy' function now takes a PyObject* instead of PyCObject*, so you have to use PyCapsule_GetPointer() inside it to get the C/C++ pointer.
Ciao,
from python 3.2 on the flags show which build options are enabled. http://www.python.org/dev/peps/pep-3149/ --with-pymalloc (flag: m) --with-wide-unicode (flag: u)