[issue39011] ElementTree attributes replace "\r" with "\n"

2020-02-11 Thread mefistotelis
mefistotelis added the comment: I'm on it. Test update attached. -- Added file: https://bugs.python.org/file48890/0002-bpo-39011-Test-white-space-preservation-in-attribs.patch ___ Python tracker <https://bugs.python.org/is

[issue39011] ElementTree attributes replace "\r" with "\n"

2020-02-09 Thread mefistotelis
mefistotelis added the comment: Patch attached. I was thinking about one for() instead, but didn't wanted to introduce too large changes.. Let me know if you would prefer something like: for i in (9,10,13,): if chr(i) not in text: continue text = text.replace(

[issue39011] ElementTree attributes replace "\r" with "\n"

2019-12-10 Thread mefistotelis
mefistotelis added the comment: Disclaimer: I'm not at all an expert in XML specs. The linked spec chapter, "End-of-Line Handling", says all line endings should behave like they were converted to "\n" _before_ parsing. This means: 1. This part of spec does

[issue39011] ElementTree attributes replace "\r" with "\n"

2019-12-09 Thread mefistotelis
New submission from mefistotelis : TLDR: If I place "\r" in an Element attribute, it is handled and idiomized to " " in the XML file. But wait - \r is not really code 10, right? Real description: If I create ElementTree and read it just after creation, I'm gettin