XPathEvaluator namespaces regression in 3.6.3+
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Invalid
|
Undecided
|
Unassigned |
Bug Description
This code used to work.
lxml.etree : (3, 6, 2, 0)
libxml used : (2, 9, 1)
libxml compiled : (2, 9, 1)
libxslt used : (1, 1, 28)
libxslt compiled : (1, 1, 28)
>>> xml = etree.XML(
>>> xpath = etree.XPathEval
>>> xpath('
['200']
It throws an exception now.
lxml.etree : (3, 6, 3, 0)
libxml used : (2, 9, 4)
libxml compiled : (2, 9, 4)
libxslt used : (1, 1, 29)
libxslt compiled : (1, 1, 29)
>>> xpath('
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "src/lxml/
File "src/lxml/
lxml.etree.
XML names must not start with a digit. That includes namespace prefixes. It seems that libxml2 got stricter here in recent versions, although I have no idea why that wasn't an error before. Seems like an unusual bug to allow that in the first place.