[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: Also see the later fix in issue 39011, where the EOL normalisation in attribute text was removed again. This change was applied in Py3.9. -- ___ Python tracker

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2019-11-20 Thread Emiliano Heyns
Emiliano Heyns added the comment: I don't see newlines currently preserved in attributes: elem = ET.parse(StringIO('')).getroot() print(ET.tostring(elem)) -- components: -XML nosy: +Emiliano Heyns versions: -Python 3.4, Python 3.5, Python 3.6

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2016-09-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Done. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2016-09-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0a5596315cf0 by Raymond Hettinger in branch '3.5': Issue #17582: xml.etree.ElementTree nows preserves whitespaces in attributes https://hg.python.org/cpython/rev/0a5596315cf0 -- nosy: +python-dev ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2016-09-12 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: skrah -> rhettinger ___ Python tracker ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2016-09-12 Thread Stefan Behnel
Stefan Behnel added the comment: Raymond, you might have meant me when assigning the ticket and not Stefan Krah, but since I'm actually not a core dev, I can't commit the patch myself. See my last comment, though, I reviewed the patch and it should get committed. --

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2016-09-11 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> skrah nosy: +skrah ___ Python tracker ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2016-09-11 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2016-09-11 Thread Kesara Rathnayake
Changes by Kesara Rathnayake : -- versions: +Python 3.6, Python 3.7 ___ Python tracker ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2015-09-06 Thread Stefan Behnel
Stefan Behnel added the comment: Patch and test look correct. They fix a bug that produces incorrect output, so I vote for backporting them. Most code won't see the difference as whitespace control characters are rare in attribute values. And code that uses them will benefit from correctness.

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2015-09-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: Stefan, can you opine on the patches and whether they should be backported? -- ___ Python tracker ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2015-09-03 Thread Duane Griffin
Duane Griffin added the comment: Here is a patch with a unit test for the new escaping functionality. I believe it covers all the new cases. Additional code is not required for cElementTree as the serialisation code is all Python. -- nosy: +duaneg Added file:

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2015-04-14 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17582 ___ ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2015-04-11 Thread Benjamin Peterson
Benjamin Peterson added the comment: The patch seems reason, though it needs a test. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17582 ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-14 Thread Colton Leekley-Winslow
Colton Leekley-Winslow added the comment: Here is a patch. Please note that in your example \r is replaced by \n per 2.11: http://www.w3.org/TR/REC-xml/#sec-line-ends Also, the patch is only for ElementTree, I will investigate cElementTree but no promises. -- keywords: +patch nosy:

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-14 Thread Colton Leekley-Winslow
Colton Leekley-Winslow added the comment: I sort of realized, does this mean lxml.etree would now be the offender, for not following 2.11 and leaving the \r as-is? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17582

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-13 Thread Daniele Varrazzo
Daniele Varrazzo added the comment: No, I cannot. I take the fact there has been no answer for more than 18 months as an acknowledgement that the issue is not deemed important by Python maintainers: it's not important for me either. I'm not a heavy xml user: just knowing that the Python XML

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- keywords: +easy stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17582 ___

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-05 Thread Stefan Behnel
Stefan Behnel added the comment: Proper escaping should be added to the _escape_attrib() function into /xml/etree/ElementTree.py (and equivalent for cElementTree). Agreed. Can you provide a patch? -- versions: -Python 2.7 ___ Python tracker

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-01 Thread Mark Lawrence
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: +eli.bendersky, scoder type: - behavior versions: +Python 3.4, Python 3.5 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17582

[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2013-03-30 Thread Daniele Varrazzo
New submission from Daniele Varrazzo: XML defines the following chars as whitespace [1]:: S ::= (#x20 | #x9 | #xD | #xA)+ However the chars are not properly escaped into attributes, so they are converted into spaces as per attribute-value normalization [2] data = '\x09\x0a\x0d\x20'