The Wayback Machine - https://web.archive.org/web/20220426171503/https://github.com/RustPython/RustPython/issues/3430
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

etree.XML raises TypeError on valid XML #3430

Open
alexprengere opened this issue Nov 8, 2021 · 1 comment
Open

etree.XML raises TypeError on valid XML #3430

alexprengere opened this issue Nov 8, 2021 · 1 comment

Comments

@alexprengere
Copy link

@alexprengere alexprengere commented Nov 8, 2021

etree.XML does not look like it is working.

>>>>> import xml.etree.ElementTree as etree
>>>>> etree.XML("<root></root>")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/.../RustPython/vm/pylib-crate/Lib/xml/etree/ElementTree.py", line 1319, in XML
    parser = XMLParser(target=TreeBuilder())
  File "/home/.../RustPython/vm/pylib-crate/Lib/xml/etree/ElementTree.py", line 1508, in __init__
    parser = expat.ParserCreate(encoding, "}")
TypeError: Expected type 'str', not 'NoneType'

This code runs fine on CPython and PyPy.

@DimitrisJim
Copy link
Member

@DimitrisJim DimitrisJim commented Nov 8, 2021

Yup, expat.rs is still quite bare-bones (the args, even if parsed correctly, aren't currently used).

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

No branches or pull requests

2 participants