[lxml-dev] Strange segmentation fault if class inherited from objectify.ObjectifiedElement

Daniel Albeseder daniel.albeseder at tttech.com
Fri Jul 31 13:17:53 CEST 2009


I just tried this and got an segmentation fault :-(

Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import objectify
>>> from lxml import etree
>>> 
>>> print etree.LXML_VERSION, etree.LIBXML_VERSION
(2, 2, 2, 0) (2, 6, 32)
>>> 
>>> class test (objectify.ObjectifiedElement) :
...     pass
... 
>>> good = objectify.Element ("abc")
>>> print type (good), repr (good)
<type 'lxml.objectify.ObjectifiedElement'> <Element abc at 7f0797587fc8>
>>> 
>>> bad  = test ("abc")
Segmentation fault

I read that you have to instantiate a parser with objectify.makeparser
and use the method makeelement from there. However I would expect that
at least not Segmentation Fault happens, if someone is using the normal
inheritance as used to be.

regards
Daniel




More information about the lxml-dev mailing list