[lxml-dev] lxml 1.1 problems with python 2.3
Stefan Behnel
behnel_ml at gkec.informatik.tu-darmstadt.de
Fri Dec 1 10:21:19 CET 2006
Hi Martijn,
Martijn Faassen wrote:
> Stupid of me not to see it earlier, but that's because it's trying to
> import from lxl.local_doctest and you added it as local_doctest.
Ah, stupid me then. :)
>>> Things then fail with what looks like a new, unrelated issue:
>>>
>>> Traceback (most recent call last):
>>> File "test.py", line 591, in ?
>>> exitcode = main(sys.argv)
>>> File "test.py", line 554, in main
>>> test_cases = get_test_cases(test_files, cfg, tracer=tracer)
>>> File "test.py", line 254, in get_test_cases
>>> module = import_module(file, cfg, tracer=tracer)
>>> File "test.py", line 197, in import_module
>>> mod = __import__(modname)
>>> File
>>> "/home/faassen/working/lxml/lxml-trunk/src/lxml/tests/test_objectify.py",
>>>
>>> line 16, in ?
>>> from lxml import objectify
>>> ImportError:
>>> /home/faassen/working/lxml/lxml-trunk/src/lxml/objectify.so: undefined
>>> symbol: previousElement
>>
>> That's rather bizarre, previousElement is definitely a public function
>> (i.e.
>> defined in etree.so). I have no idea how that could be missing.
>
> It's consistently missing though in Python 2.3. Perhaps it accidentally
> gets turned off together with thread support? I did try to test this
> theory yesterday though on Python 2.4 by explicitly disabling tests, and
> that didn't help.
Ok, then, first thing to check: does "previousElement" turn up as a static
function in the generated src/lxml/etree.h? Could you check what the
preprocessor sees in objectify.c (gcc -E)?
On my side (Py 2.5), it sees the following:
-----------------------
...
static xmlNode (*((*nextElement)(xmlNode (*))));
static xmlNode (*((*previousElement)(xmlNode (*))));
...
{"nextElement", &nextElement},
{"previousElement", &previousElement},
...
__pyx_v_next = nextElement;
...
__pyx_v_next = previousElement;
...
-----------------------
I'm showing both functions here, as both are used in objectify, but only the
second seems to be missing according to your report. If this looks the same on
your side, I'm really out of ideas.
Stefan
More information about the lxml-dev
mailing list