stchris/untangle

class is a reserved word, consider using _class to replace class

Closed this issue · 2 comments

<?xml version="1.0"?>
<root>
    <class>Moc</class>>
</root>
doc = untangle.parse("test.xml")
print(doc.root.class)

#     print(doc.root.class)
#                      ^
# SyntaxError: invalid syntax

class is a reserved word, consider using _class to replace class

Agreed, ran into this issue where an element is named None.

Edit:
Realized you can use getattr(o, "None") in the meantime, though will try to make a PR for this issue when I get the chance.

Similar issue: #42 . Was fixed with #43