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
{{ message }}
Repository navigation
ElementTree.Element and cElementTree.Element have slightly different repr #50479
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2010-03-11.14:59:13.377>created_at=<Date2009-06-07.14:08:15.277>labels= ['expert-XML', 'type-bug']
title='ElementTree.Element and cElementTree.Element have slightly different repr'updated_at=<Date2010-03-11.14:59:13.375>user='https://bugs.python.org/NeilMuller'
ElementTree and cElementTree give slightly different results for
repr(Element):
>>> import xml.etree.ElementTree asET
>>> import xml.etree.cElementTree as cET
>>> repr(ET.ElementTree('tag'))
'<Element tag at b7cf506c>'
>>> repr(cET.ElementTree('tag')
"<Element 'tag' at 0xb7c266f8>"
The quoting around the tag name is missing from ElementTree.
This inconsistency seems pointless.
Attached patch changes ElementTree to match cElementTree behaviour, and
adds a test.
Activity
NeilMuller commentedon Jun 7, 2009
ElementTree and cElementTree give slightly different results for
repr(Element):
The quoting around the tag name is missing from ElementTree.
This inconsistency seems pointless.
Attached patch changes ElementTree to match cElementTree behaviour, and
adds a test.
NeilMuller commentedon Jun 7, 2009
Same issue affects python 3k - the patch applies there cleanly as well.
florentx commentedon Feb 16, 2010
Fixed with upstream. See bpo-6472.
florentx commentedon Mar 11, 2010
Fixed in trunk with bpo-6472.