[arch-general] Python 3.2mu breaks pycairo ?
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, -- FA
On Tue, Mar 22, 2011 at 7:24 PM, Fons Adriaensen <fons@linuxaudio.org> 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,
-- FA
Please report a bug report at bugs.archlinux.org
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)
participants (3)
-
Fons Adriaensen
-
jonathan
-
Thomas Dziedzic