Struggling on why lxml.objectify.parse is failing when I use a file IO but not a string IO.
The following code works:
with open(logPath,'r', encoding='utf-8') as f:
xml = f.read()
root = objectify.fromstring(xml)
print(root.tag)
The following code fails with error:
AttributeError: 'lxml.etree._ElementTree' object has no attribute 'tag'
with open(pelogPath,'r', encoding='utf-8') as f:
#xml = f.read()
root = objectify.parse(f)
print(root.tag)