Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lxml 5.x breaks doc validation #4482

Open
mwichmann opened this issue Feb 16, 2024 · 2 comments
Open

lxml 5.x breaks doc validation #4482

mwichmann opened this issue Feb 16, 2024 · 2 comments

Comments

@mwichmann
Copy link
Collaborator

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.

@bdbaddog
Copy link
Contributor

bdbaddog commented Sep 22, 2024

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>

@bdbaddog
Copy link
Contributor

bdbaddog commented Sep 22, 2024

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants