[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.

This commit is contained in:
Andrew M. Kuchling 2006-06-09 13:15:57 +00:00
parent 7dbb1ff77d
commit 91c64a05d2
2 changed files with 7 additions and 2 deletions

View file

@ -175,11 +175,14 @@ def test_xmlgen_attr_escape():
gen.endElement("e")
gen.startElement("e", {"a": "'\""})
gen.endElement("e")
gen.startElement("e", {"a": "\n\r\t"})
gen.endElement("e")
gen.endElement("doc")
gen.endDocument()
return result.getvalue() == start \
+ "<doc a='\"'><e a=\"'\"></e><e a=\"'&quot;\"></e></doc>"
return result.getvalue() == start + ("<doc a='\"'><e a=\"'\"></e>"
"<e a=\"'&quot;\"></e>"
"<e a=\"&#10;&#13;&#9;\"></e></doc>")
def test_xmlgen_ignorable():
result = StringIO()