[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2019-04-27 Thread Stefan Behnel
Stefan Behnel added the comment: This is a tricky decision. lxml, for example, validates user input, but that's because it has to process it anyway and does it along the way directly on input (and very efficiently in C code). ET, on the other hand, is rather lenient about what it allows user

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2018-11-07 Thread Ben Spiller
Change by Ben Spiller : -- nosy: +Ben Spiller ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2018-10-19 Thread Ben Spiller
Ben Spiller added the comment: To help anyone else struggling with this bug, based on https://lsimons.wordpress.com/2011/03/17/stripping-illegal-characters-out-of-xml-in-python/ the best workaround I've currently found is to define this: def escape_xml_illegal_chars(unicodeString, replaceWit

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2018-09-10 Thread Ben Spiller
Ben Spiller added the comment: Hi it's been a few years now since this was reported and it's still a problem, any chance of a fix for this? The API gives the impression that if you pass python strings to the XML API then the library will generate valid XML. It takes care of the charset/encod

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2016-01-15 Thread Martin Panter
Martin Panter added the comment: Issue 12129 is open about this sort of problem with xml.dom (which would also apply to minidom I think). If someone wants to suggest a clarification for the Element Tree documentation, that might work. But I tend to agree about not bogging down the implementati

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2014-12-12 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2014-02-03 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2013-09-02 Thread Eli Bendersky
Changes by Eli Bendersky : -- nosy: +eli.bendersky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2012-07-21 Thread Florent Xicluna
Changes by Florent Xicluna : -- assignee: effbot -> components: +XML versions: +Python 3.4 -Python 2.7, Python 3.2 ___ Python tracker ___

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2011-04-08 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2010-07-26 Thread Mark Lawrence
Mark Lawrence added the comment: In msg89685 it's stated that this behaviour is deliberate for ET. Could somebody please comment on the minidom aspects. -- nosy: +BreamoreBoy ___ Python tracker __

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2010-03-16 Thread Vetoshkin Nikita
Vetoshkin Nikita added the comment: What about this example? >>> from xml.dom import minidom >>> doc = minidom.Document() >>> el = doc.createElement("Test") >>> el.setAttribute("with space", "False") >>> doc.appendChild(el) >>> >>> #nahhh ... minidom.parseString(doc.toxml()) Traceback (most rec

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-11-24 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: Here is a regexp I use to clean up text (note, that I don't touch "compatibility characters" that are also not recommended in XML; some other developers remove them too): # http://www.w3.org/TR/REC-xml/#NT-Char # Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] |

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-11-24 Thread Andy
Andy added the comment: I'm also of the opinion that this would be a valuable feature to have. I think it's a reasonable expectation that an XML library produces valid XML. It's particularly strange that ET would output XML that it can't itself read. Surely the job of making the input valid fall

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-06-25 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: Every blog engine I've even seen so far pass through comments from untrusted users to RSS/Atom feeds without proper validation causing broken XML in feeds. Sure, this is a bug in web applications, but DOM manipulation packages should prevent from creation bro

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-06-24 Thread Fredrik Lundh
Fredrik Lundh added the comment: For ET, that's very much on purpose. Validating data provided by every single application would kill performance for all of them, even if only a small minority would ever try to serialize data that cannot be represented in XML. -- __

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-02-06 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> effbot nosy: +effbot ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-02-06 Thread Denis S. Otkidach
New submission from Denis S. Otkidach : ElementTree and minidom allow creation of not well-formed XML, that can't be parsed: >>> from xml.etree import ElementTree >>> element = ElementTree.Element('element') >>> element.text = u'\0' >>> xml = ElementTree.tostring(element, encoding='utf-8') >>> E