lxml 5.x breaks doc validation
mwichmann opened this issue · 2 comments
Tested using git head as of 15 Feb: with 5.x versions of lxml installed, the doc tree no longer validates. Used 5.0.0, 5.0.1, 5.1.0. Dropping back to any 4.9.x release lets it validate. This is in my regular work virtualenv.
$ python bin/docs-validate.py
0.46% (1/216) SCons/Action.xml
Traceback (most recent call last):
File "/home/mats/github/scons/bin/docs-validate.py", line 21, in <module>
if SConsDoc.validate_all_xml(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mats/github/scons/bin/SConsDoc.py", line 462, in validate_all_xml
if not tf.validateXml(fp, xmlschema_context):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/mats/github/scons/bin/SConsDoc.py", line 357, in validateXml
TreeFactory.xmlschema = etree.XMLSchema(xmlschema_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/lxml/xmlschema.pxi", line 90, in lxml.etree.XMLSchema.__init__
lxml.etree.XMLSchemaParseError: local complex type: The content model is not determinist., line 2150
As a crosscheck I tried this with distro pkgs in Fedora rawhide, which has now flipped to python3-lxml at a 5.x level, with the same outcome.
At the moment, don't know how to narrow down to where the problem is.
Looks like lxml is complaining about processing doc/xsd/scons.xsd
and not SCons/Action.xml
Fairly certain this is an issue with line 2150 in doc/xsd/dbpoolx.xsd
The second line of this
<!-- doc:A paragraph. -->
<xs:element name="para" substitutionGroup="para.class">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="para.char.mix"/>
<xs:group ref="para.mix"/>
</xs:choice>
<xs:attributeGroup ref="para.attlist"/>
</xs:complexType>
</xs:element>
If that's commented out (the whole xs:complextype bit), then the error moves to the next xs:complextype line 2449..
Which is not the next, nor is 2150 the first use of xs:complexType
..