[pypy-issue] [issue1178] adding support to lxml in pypy

Ian Delaney tracker at bugs.pypy.org
Mon Jun 18 10:14:02 CEST 2012


Ian Delaney <della5 at iinet.com.au> added the comment:

afa, 
thank you explaining, ack that I'm a pypy novice, so I just would like to get a
grasp on some pypy fundamentals.

Key point you made;
lxml C code is mostly generated by Cython.
hmm that is an important insight

ok, unwinding the changes I made to get it to compile, removing the CPython
struct PyListObject yields this;


src/lxml/lxml.etree.c:3684:16: error: ‘PyListObject’ has no member named ‘allocated’
src/lxml/lxml.etree.c:3690:9: warning: return makes pointer from integer without
a cast
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_moveNodeToDocument’:
src/lxml/lxml.etree.c:9482:32: warning: passing argument 3 of
‘__pyx_v_doc->__pyx_vtab->_findOrBuildNodeNs’ discards qualifiers from poi$
src/lxml/lxml.etree.c:9482:32: note: expected ‘char *’ but argument is of type
‘const xmlChar *’
src/lxml/lxml.etree.c:9482:32: warning: passing argument 4 of
‘__pyx_v_doc->__pyx_vtab->_findOrBuildNodeNs’ discards qualifiers from poi$
src/lxml/lxml.etree.c:9482:32: note: expected ‘char *’ but argument is of type
‘const xmlChar *’
src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_fixThreadDictNameForNode’:
src/lxml/lxml.etree.c:10165:18: warning: assignment discards qualifiers from
pointer target type
src/lxml/lxml.etree.c:10222:22: warning: assignment discards qualifiers from
pointer target type
src/lxml/lxml.etree.c: In function
‘__pyx_f_4lxml_5etree_fixThreadDictContentForNode’:
src/lxml/lxml.etree.c:10285:42: warning: comparison of distinct pointer types
lacks a cast
src/lxml/lxml.etree.c:10309:31: warning: assignment discards qualifiers from
pointer target type

So at this point I have uncommented PyListObject in pypy_decl.h, removed it from
descrobject.h.  Remember it took me 3 days of experimenting to get the effective
compile, so the permutations of errors is huge.  This is just 1 sample.  This it
appears is an example of the source coded being CPython specific.  pypy_decl.h
list it with
typedef struct { PyObject_HEAD } PyListObject;
and to the lxml source code it is ill equipped.

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1178>
________________________________________


More information about the pypy-issue mailing list