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
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=<Date2015-04-29.02:39:48.616>created_at=<Date2015-04-29.00:42:01.553>labels= ['type-bug', 'invalid']
title='xml.etree.ElementTree.Element does not catch text'updated_at=<Date2015-04-29.02:39:48.603>user='https://bugs.python.org/jlaurens'
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'
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: