
Op Sa, 2012-06-09 om 15:32 +0200 skryf Stefan Behnel:
F Wolff, 09.06.2012 14:35:
cc -fPIC -Wimplicit -I/usr/include/libxml2 -I/home/fwolff/download/python/lxml-lxml-2260f8d/src/lxml//include -I/home/fwolff/download/python/pypy-1.9/include -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.7/src/lxml/lxml.etree.o -w src/lxml/lxml.etree.c: In function ‘__pyx_f_4lxml_5etree_9_ErrorLog_connect’: src/lxml/lxml.etree.c:31030: error: ‘xmlStructuredErrorContext’ undeclared (first use in this function) src/lxml/lxml.etree.c:31030: error: (Each undeclared identifier is reported only once src/lxml/lxml.etree.c:31030: error: for each function it appears in.) error: command 'cc' failed with exit status 1
This is neither related to PyPy nor Cython. It's due to my rewrite of the error reporting code (intended to make it less intrusive when mixed with other users of libxml2), for which I accidentally used a feature that was only added in libxml2 2.7.4. That's too bad because this feature is rather crucial to the way error reporting should work. Guess I'll have to undo those changes, at least conditionally. I don't see how to make them work in those really old libxml2 versions that the current lxml releases still work with (even 2.7.4 has been out for almost three years now).
Thanks for the report anyway, better to do it now than when trying to get out the release. I pushed a quick fix that makes it compile again, so that you can test it.
Thanks for the quick reply! Now I was able to build and install it successfully. Thanks! I tried to run the test suite of the Translate Toolkit with this new lxml under pypy. It is not able to complete the test run due to crashes. I'll try to isolate a few issues and get it down to small test cases. Here are the first few: =============================================================
from lxml import etree string_xpath = etree.XPath("string()") string_xpath(etree.fromstring('<a> </a>')) Traceback (most recent call last): File "<console>", line 1, in <module> File "xpath.pxi", line 462, in lxml.etree.XPath.__call__ (src/lxml/lxml.etree.c:126663) RuntimeError: maximum recursion depth exceeded
Here lxml under cpython gives: u'\xa0' =============================================================
from lxml import etree string_xpath = etree.XPath("string()") t = etree.fromstring('<a></a>') Segmentation fault
Here lxml under cpython gives: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "lxml.etree.pyx", line 2440, in lxml.etree.fromstring (src/lxml/lxml.etree.c:23985) File "parser.pxi", line 1510, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:63925) File "parser.pxi", line 1389, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:62857) File "parser.pxi", line 931, in lxml.etree._BaseParser._parseDoc (src/lxml/lxml.etree.c:60016) File "parser.pxi", line 542, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:56659) File "parser.pxi", line 628, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:57504) File "parser.pxi", line 568, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:56902) lxml.etree.XMLSyntaxError: xmlParseCharRef: invalid xmlChar value 16, line 1, column 9 =============================================================
from lxml import etree import StringIO etree.DTD(StringIO.StringIO('<!ENTITY test.me "">')) Fatal error in cpyext, CPython compatibility layer, calling PyFile_AsFile Either report a bug or consider not using this particular extension <SystemError object at 0x905d7b8> RPython traceback: File "module_cpyext_pyobject.c", line 106, in from_ref File "rpython_lltypesystem_rdict.c", line 647, in ll_dict_getitem__dicttablePtr_Signed Segmentation fault
Here lxml under cpython gives: <lxml.etree.DTD object at 0xb76f6c2c> ============================================================= I hope it helps! I realise some of this might be pypy bugs, but it is impossible for me to say, so I'll start here. Keep well Friedel -- Recently on my blog: http://translate.org.za/blogs/friedel/en/content/localisation-guide-now-avai...