You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the above script, lxml throws a ValueError exception:
Traceback (most recent call last):
File "scratch.py", line 20, in <module>
test('{{}}')
File "scratch.py", line 16, in test
print(serializer.render(element))
File "env38.win\lib\site-packages\xsdata\formats\dataclass\serializers\xml.py", line 55, in render
self.write(output, obj, ns_map)
File "env38.win\lib\site-packages\xsdata\formats\dataclass\serializers\xml.py", line 70, in write
handler.write(events)
File "env38.win\lib\site-packages\xsdata\formats\dataclass\serializers\writers\lxml.py", line 18, in write
super().write(events)
File "env38.win\lib\site-packages\xsdata\formats\dataclass\serializers\mixins.py", line 82, in write
self.end_tag(*args)
File "env38.win\lib\site-packages\xsdata\formats\dataclass\serializers\mixins.py", line 170, in end_tag
self.flush_start(True)
File "env38.win\lib\site-packages\xsdata\formats\dataclass\serializers\mixins.py", line 206, in flush_start
self.handler.startElementNS(self.pending_tag, None, self.attrs)
File "src\lxml\sax.py", line 111, in lxml.sax.ElementTreeContentHandler.startElementNS
File "src\lxml\etree.pyx", line 3022, in lxml.etree.Element
File "src\lxml\apihelpers.pxi", line 131, in lxml.etree._makeElement
File "src\lxml\apihelpers.pxi", line 118, in lxml.etree._makeElement
File "src\lxml\apihelpers.pxi", line 215, in lxml.etree._setNodeNamespaces
File "src\lxml\apihelpers.pxi", line 1755, in lxml.etree._uriValidOrRaise
ValueError: Invalid namespace URI '{'
Tested with versions 20.11.1 and 20.12
The text was updated successfully, but these errors were encountered:
If an attribute value looks like a qname, but isn't, serializing breaks.
Example:
When running the above script, lxml throws a
ValueError
exception:Tested with versions 20.11.1 and 20.12
The text was updated successfully, but these errors were encountered: