mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Issue #17582: xml.etree.ElementTree nows preserves whitespaces in attributes
(Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
This commit is contained in:
parent
4b73676c3d
commit
076366c2a5
3 changed files with 22 additions and 0 deletions
|
@ -405,6 +405,14 @@ class ElementTreeTest(unittest.TestCase):
|
|||
self.assertEqual(ET.tostring(elem),
|
||||
b'<test testa="testval" testb="test1" testc="test2">aa</test>')
|
||||
|
||||
elem = ET.Element('test')
|
||||
elem.set('a', '\r')
|
||||
elem.set('b', '\r\n')
|
||||
elem.set('c', '\t\n\r ')
|
||||
elem.set('d', '\n\n')
|
||||
self.assertEqual(ET.tostring(elem),
|
||||
b'<test a=" " b=" " c="	 " d=" " />')
|
||||
|
||||
def test_makeelement(self):
|
||||
# Test makeelement handling.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue