Ned Deily added the comment:

While a bit confusing, I don't think this is a bug.  Note the definition of the 
"tail" attribute of an element:

"If the element is created from an XML file the attribute will contain any text 
found after the element’s end tag and before the next tag."

Unlike in root1 and root2 where 'TEXT' is before the end of element a and the 
start of element b (in root2), 'TEXT' in root3 follows the end tag of element b 
and so is associated with it as its tail attribute.

>>> root3
<Element 'a' at 0x1022ab188>
>>> root3[0]
<Element 'b' at 0x1022ab1d8>
>>> root3[0].tail
'TEXT'

https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.tail

----------
nosy: +ned.deily
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24072>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to