Hi,
Does anyone think this needs to be posted to the bug tracker?

lxml seems to identify superscripts as an integer but then throws an exception.

Thanks

Alex


from lxml import objectify
xml = """
<types>
<mysuperscript>²²²²²²²²²²</mysuperscript>
</types>
"""
doc = objectify.fromstring(xml)
print(objectify.dump(doc))


Traceback (most recent call last):
  File “**********.py", line 11, in <module>
    print(objectify.dump(doc))
          ^^^^^^^^^^^^^^^^^^^
  File "src/lxml/objectify.pyx", line 1521, in lxml.objectify.dump
  File "src/lxml/objectify.pyx", line 1549, in lxml.objectify._dump
  File "src/lxml/objectify.pyx", line 1526, in lxml.objectify._dump
  File "src/lxml/objectify.pyx", line 646, in 
lxml.objectify.NumberElement.__repr__
  File "src/lxml/objectify.pyx", line 946, in lxml.objectify._parseNumber
ValueError: invalid literal for int() with base 10: '²²²²²²²²²²'
_______________________________________________
lxml - The Python XML Toolkit mailing list -- lxml@python.org
To unsubscribe send an email to lxml-le...@python.org
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: arch...@mail-archive.com

Reply via email to