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 789972 - python module fails to load with python 3.6
python module fails to load with python 3.6
Status: RESOLVED INVALID
Product: libxml2
Classification: Platform
Component: python
git master
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2017-11-06 15:17 UTC by Patrick Welche
Modified: 2017-11-06 15:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Patrick Welche 2017-11-06 15:17:09 UTC
$ python3.6
Python 3.6.3 (default, Oct 27 2017, 17:16:29) 
[GCC 5.4.0] on netbsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import libxml2
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
  • File "/usr/pkg/lib/python3.6/site-packages/libxml2.py", line 1 in <module>
    import libxml2mod
ImportError: /usr/pkg/lib/python3.6/site-packages/libxml2mod.so: Undefined PLT symbol "PyCObject_Check" (symnum = 488)
>>> 

Not surprising that PyCObject_Check isn't found. It is introduced in libxml2/python/libxml_wrap.h:

#ifndef PyCapsule_New
#define PyCapsule_New PyCObject_FromVoidPtrAndDesc
#define PyCapsule_CheckExact PyCObject_Check
#define PyCapsule_GetPointer(o, n) PyCObject_GetDesc((o))
#endif

In Python-3.6.3/Include/pycapsule.h:

PyAPI_FUNC(PyObject *) PyCapsule_New(
    void *pointer,
    const char *name,
    PyCapsule_Destructor destructor);

so as far as I can tell, PyCapsule_New is a real function, and not a macro, so #ifndef PyCapsule_New will fire.

Also:

#define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type)

so PyCapsule_CheckExact, which exists, then gets redefined by libxml_wrap.h to PyCapsule_Check which doesn't, which results in that symbol not being find when trying to load libxml2.
Comment 1 Patrick Welche 2017-11-06 15:27:34 UTC
The source for libxml2 git master I was using wasn't pristine.
Comment 2 Patrick Welche 2017-11-06 15:40:33 UTC
I now hit bug #776815 with python 3.6.3 and libxml2-2.9.7