diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-01-10 14:27:53 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-01-10 14:27:53 (GMT) |
commit | e6174ca85e293039c464e06bf3a656300347b562 (patch) | |
tree | f78ed07b81f69ea07374c3199bdf6556683704eb /Lib | |
parent | 458c0d5a776746267f432e6860050af367fb5431 (diff) | |
download | cpython-e6174ca85e293039c464e06bf3a656300347b562.zip cpython-e6174ca85e293039c464e06bf3a656300347b562.tar.gz cpython-e6174ca85e293039c464e06bf3a656300347b562.tar.bz2 |
Issue #16913: Fix Element.itertext()'s handling of text with XML entities.
Patch by Serhiy Storchaka
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_xml_etree.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 9746934..68dd1cc 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -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') |