xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1

I am trying to parse a string to xml using xmltree.Below is the string variable.

r="""<EntityConfig xmlns="urn:sun:fm:SAML:2.0:entityconfig" xmlns:fm="urn:sun:fm:SAML:2.0:entityconfig" hosted="0" entityID='com.applitools'</EntityConfig>"""

My Code is below:

root = ET.fromstring(r)

Error seen in console is below:

AppData\Local\anaconda3\lib\xml\etree\ElementTree.py", line 1342, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 135

The EntityConfig start tag in the string is not closed. That makes the xml invalid.

EntityConfig is closed. Still I am not able to parse variable.

As already said, the opening tag in what you posted isn’t closed, it doesn’t have its > just before the closing tag.