[issue33303] ElementTree Comment text isn't escaped

2019-05-12 Thread Stefan Behnel
Stefan Behnel added the comment: I'm really sorry again, but I only consulted the XML spec on this now (and also the way libxml2 does it), and I found that XML comment text actually does not get escaped. It's not character data, and, in fact, "--" is not even allowed at all inside of comments

[issue33303] ElementTree Comment text isn't escaped

2019-05-12 Thread Jeffrey Kintscher
Jeffrey Kintscher added the comment: I backed-out the Processing Instruction changes. -- ___ Python tracker ___ ___ Python-bugs-lis

[issue33303] ElementTree Comment text isn't escaped

2019-05-10 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, sorry, I was wrong here. I looked it up and also checked the behaviour of other libraries: the data content of PIs is application specific and must not be escaped, at all. It's not XML character data. Sorry for the confusion and the extra work on your si

[issue33303] ElementTree Comment text isn't escaped

2019-05-10 Thread Jeffrey Kintscher
Jeffrey Kintscher added the comment: Which characters would you escape in a processing instruction? The XML spec says not to escape '<' and '&', but doesn't say what should be escaped. It seems to me that escaping '?' when followed by '>' should be sufficient since the character sequence "?>

[issue33303] ElementTree Comment text isn't escaped

2019-05-09 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- keywords: +patch pull_requests: +13137 stage: needs patch -> patch review ___ Python tracker ___ __

[issue33303] ElementTree Comment text isn't escaped

2019-05-09 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- nosy: +websurfer5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue33303] ElementTree Comment text isn't escaped

2019-04-27 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, comment text should be escaped internally like all other text, not by the user. The same applies to processing instructions. This suggests that it's probably also untested currently. Could you provide a PR for that changes both and adds tests? -

[issue33303] ElementTree Comment text isn't escaped

2018-04-20 Thread Terry J. Reedy
Change by Terry J. Reedy : -- versions: -Python 3.4, Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue33303] ElementTree Comment text isn't escaped

2018-04-17 Thread John Burnett
New submission from John Burnett : The _serialize_xml function in ElementTree.py doesn't escape Comment.text values when writing output. This means the following code: import sys import xml.etree.ElementTree elem = xml.etree.ElementTree.Comment() elem.text = 'hi --> bye' tr