el = et.fromstring('<a><!-- hello world --></a>', parser)
el.getchildren()
File "<stdin>", line 1, in <module>
File "src/lxml/lxml.etree.pyx", line 1351, in lxml.etree._Element.getchildren (src/lxml/lxml.etree.c:57046)
File "src/lxml/apihelpers.pxi", line 805, in lxml.etree._collectChildren (src/lxml/lxml.etree.c:25788)
File "src/lxml/lxml.etree.pyx", line 1617, in lxml.etree._elementFactory (src/lxml/lxml.etree.c:60167)
File "src/lxml/classlookup.pxi", line 405, in lxml.etree._parser_class_lookup (src/lxml/lxml.etree.c:93219)
File "src/lxml/classlookup.pxi", line 526, in lxml.etree._python_class_lookup (src/lxml/lxml.etree.c:94017)
TypeError: Cannot convert lxml.etree._ReadOnlyProxy to lxml.etree._ReadOnlyElementProxy
Python : sys.version_ info(major= 3, minor=6, micro=2, releaselevel= 'final' , serial=0)
lxml.etree : (4, 0, 0, 0)
libxml used : (2, 9, 5)
libxml compiled : (2, 9, 5)
libxslt used : (1, 1, 30)
To reproduce:
import lxml.etree as et et.PythonElemen tClassLookup) :
class MyLookup(
def lookup(self, document, element):
return None
parser = et.XMLParser() set_element_ class_lookup( MyLookup( ))
parser.
el = et.fromstring( '<a><!- - hello world --></a>', parser) lxml.etree. pyx", line 1351, in lxml.etree. _Element. getchildren (src/lxml/ lxml.etree. c:57046) apihelpers. pxi", line 805, in lxml.etree. _collectChildre n (src/lxml/ lxml.etree. c:25788) lxml.etree. pyx", line 1617, in lxml.etree. _elementFactory (src/lxml/ lxml.etree. c:60167) classlookup. pxi", line 405, in lxml.etree. _parser_ class_lookup (src/lxml/ lxml.etree. c:93219) classlookup. pxi", line 526, in lxml.etree. _python_ class_lookup (src/lxml/ lxml.etree. c:94017) _ReadOnlyProxy to lxml.etree. _ReadOnlyElemen tProxy
el.getchildren()
File "<stdin>", line 1, in <module>
File "src/lxml/
File "src/lxml/
File "src/lxml/
File "src/lxml/
File "src/lxml/
TypeError: Cannot convert lxml.etree.