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

2020-04-12 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 5fd8123dfdf6df0a9c29363c8327ccfa0c1d41ac by mefistotelis in branch 'master': bpo-39011: Preserve line endings within ElementTree attributes (GH-18468) https://github.com/python/cpython/commit/5fd8123dfdf6df0a9c29363c8327ccfa0c1d41ac --

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

2020-04-12 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2020-02-11 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +17838 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18468 ___ Python tracker ___

[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

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

2020-02-10 Thread Reece Johnson
Reece Johnson added the comment: Hope it is fixed now. -- nosy: +nows ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2020-02-10 Thread Stefan Behnel
Stefan Behnel added the comment: Your patch looks good to me. Could you please add (or adapt) the tests and then create a PR from it? You also need to write a NEWS entry for this change, and it also seems worth an entry in the "What's new" document. https://devguide.python.org/committing/

[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(chr(i),

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

2019-12-23 Thread Stefan Behnel
Stefan Behnel added the comment: I think we did it wrong in issue 17582. Parser behaviour is not a reason why the *serialisation* should modify the content. Luckily, fixing this does not impact the C14N serialisation (which aims to guarantee byte identical serialisation), but it changes the

[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 not apply to the behavior

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

2019-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See https://www.w3.org/TR/REC-xml/#sec-line-ends. -- nosy: +serhiy.storchaka ___ Python tracker ___

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

2019-12-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[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 getting what I put there - "\r".