mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #16913: Fix Element.itertext()'s handling of text with XML entities.
Patch by Serhiy Storchaka
This commit is contained in:
commit
bb48151c8c
2 changed files with 18 additions and 3 deletions
|
@ -1904,6 +1904,10 @@ class ElementIterTest(unittest.TestCase):
|
|||
tree = ET.ElementTree(None)
|
||||
self.assertRaises(AttributeError, tree.iter)
|
||||
|
||||
# Issue #16913
|
||||
doc = ET.XML("<root>a&<sub>b&</sub>c&</root>")
|
||||
self.assertEqual(''.join(doc.itertext()), 'a&b&c&')
|
||||
|
||||
def test_corners(self):
|
||||
# single root, no subelements
|
||||
a = ET.Element('a')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue