summaryrefslogtreecommitdiffstats
path: root/Lib/xmlcore/sax/saxutils.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2006-06-09 13:15:57 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2006-06-09 13:15:57 (GMT)
commit91c64a05d2536cbe764cb94c3e24f021d34f7d9a (patch)
tree9c1a0c3d1ed0bafed826a80ef19c40c8c8ca9cb5 /Lib/xmlcore/sax/saxutils.py
parent7dbb1ff77dd1dc4d0dbaac97d762b7b60355ebea (diff)
downloadcpython-91c64a05d2536cbe764cb94c3e24f021d34f7d9a.zip
cpython-91c64a05d2536cbe764cb94c3e24f021d34f7d9a.tar.gz
cpython-91c64a05d2536cbe764cb94c3e24f021d34f7d9a.tar.bz2
[Bug #1472827] Make saxutils.XMLGenerator handle \r\n\t in attribute values by escaping them properly. 2.4 bugfix candidate.
Diffstat (limited to 'Lib/xmlcore/sax/saxutils.py')
-rw-r--r--Lib/xmlcore/sax/saxutils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/xmlcore/sax/saxutils.py b/Lib/xmlcore/sax/saxutils.py
index 582b008..a496519 100644
--- a/Lib/xmlcore/sax/saxutils.py
+++ b/Lib/xmlcore/sax/saxutils.py
@@ -68,6 +68,8 @@ def quoteattr(data, entities={}):
the optional entities parameter. The keys and values must all be
strings; each key will be replaced with its corresponding value.
"""
+ entities = entities.copy()
+ entities.update({'\n': '&#10;', '\r': '&#13;', '\t':'&#9;'})
data = escape(data, entities)
if '"' in data:
if "'" in data: