Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1965591

Summary: python-zeep fails to build with Python 3.10: lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 64
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-zeepAssignee: Georg Sauthoff <fedora>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: fedora, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-31 05:58:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1890881    

Description Tomáš Hrnčiar 2021-05-28 08:54:01 UTC
python-zeep fails to build with Python 3.10.0b1.

=================================== FAILURES ===================================
_____________________ test_mime_content_serialize_text_xml _____________________

    def test_mime_content_serialize_text_xml():
        wsdl_content = StringIO(
            """
        <definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
                     xmlns:tns="http://tests.python-zeep.org/tns"
                     xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     targetNamespace="http://tests.python-zeep.org/tns">
    
          <message name="Input">
            <part name="arg1" type="xsd:string"/>
            <part name="arg2" type="xsd:string"/>
          </message>
          <message name="Output">
            <part name="Body" type="xsd:string"/>
          </message>
    
          <portType name="TestPortType">
            <operation name="TestOperation">
              <input message="Input"/>
              <output message="Output"/>
            </operation>
          </portType>
    
          <binding name="TestBinding" type="tns:TestPortType">
            <http:binding verb="POST"/>
            <operation name="TestOperation">
              <http:operation location="test-operation"/>
              <input>
                <mime:content type="text/xml"/>
              </input>
              <output>
                <mime:mimeXml part="Body"/>
              </output>
            </operation>
          </binding>
        </definitions>
        """.strip()
        )
    
        root = wsdl.Document(wsdl_content, None)
    
        binding = root.bindings["{http://tests.python-zeep.org/tns}TestBinding"]
        operation = binding.get("TestOperation")
    
        assert (
            operation.input.body.signature(schema=root.types)
            == "TestOperation(arg1: xsd:string, arg2: xsd:string)"
        )
        assert (
            operation.input.signature(as_output=False)
            == "arg1: xsd:string, arg2: xsd:string"
        )
    
        assert (
            operation.output.body.signature(schema=root.types)
            == "TestOperation(Body: xsd:string)"
        )
        assert operation.output.signature(as_output=True) == "xsd:string"
    
        serialized = operation.input.serialize(arg1="ah1", arg2="ah2")
        assert serialized.headers == {"Content-Type": "text/xml"}
        assert serialized.path == "test-operation"
        assert_nodes_equal(
>           load_xml(serialized.content),
            load_xml("<TestOperation><arg1>ah1</arg1><arg2>ah2</arg2></TestOperation>"),
        )

tests/test_wsdl_messages_http.py:286: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/utils.py:8: in load_xml
    return etree.fromstring(xml.strip(), parser=parser)
src/lxml/etree.pyx:3237: in lxml.etree.fromstring
    ???
src/lxml/parser.pxi:1896: in lxml.etree._parseMemoryDocument
    ???
src/lxml/parser.pxi:1784: in lxml.etree._parseDoc
    ???
src/lxml/parser.pxi:1141: in lxml.etree._BaseParser._parseDoc
    ???
src/lxml/parser.pxi:615: in lxml.etree._ParserContext._handleParseResultDoc
    ???
src/lxml/parser.pxi:725: in lxml.etree._handleParseResult
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E     File "<string>", line 2
E   lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 2, column 64


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/02197949-python-zeep/

For all our attempts to build python-zeep with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-zeep/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Georg Sauthoff 2021-05-30 17:25:52 UTC
Hm, this reminds me of #1962465 where the same unittest failed in the same way under Python 3.9, in Rawhide.

There it fixed itself when I tried to reproduce it (cf. my comment there).

So perhaps this goes away as well if you rebase your python3 copr environment on current rawhide and then re-trigger this build?

Comment 2 Tomáš Hrnčiar 2021-05-31 05:58:01 UTC
Yes, you were right. Apologies for the noise.