summaryrefslogtreecommitdiffstats
path: root/Lib/xml/sax
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-10-28 17:46:59 (GMT)
committerFred Drake <fdrake@acm.org>2002-10-28 17:46:59 (GMT)
commit407fea5197cc684a4941d3b47b018c1a80314223 (patch)
treebd79fae4a4d11c3bb6b42958bf968115f58e9cb8 /Lib/xml/sax
parentf55222d98fd08c469a447ee18c2922b763794fa2 (diff)
downloadcpython-407fea5197cc684a4941d3b47b018c1a80314223.zip
cpython-407fea5197cc684a4941d3b47b018c1a80314223.tar.gz
cpython-407fea5197cc684a4941d3b47b018c1a80314223.tar.bz2
Really do replacement of &amp; last to avoid bad interactions between &amp;
replacement and replacements based on the entities parameter.
Diffstat (limited to 'Lib/xml/sax')
-rw-r--r--Lib/xml/sax/saxutils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py
index 049e09c..035715c 100644
--- a/Lib/xml/sax/saxutils.py
+++ b/Lib/xml/sax/saxutils.py
@@ -43,10 +43,10 @@ def unescape(data, entities={}):
"""
data = data.replace("&lt;", "<")
data = data.replace("&gt;", ">")
- # must do ampersand last
- data = data.replace("&amp;", "&")
if entities:
data = __dict_replace(data, entities)
+ # must do ampersand last
+ data = data.replace("&amp;", "&")
return data
def quoteattr(data, entities={}):