summaryrefslogtreecommitdiffstats
path: root/Doc/tools/sgmlconv/esis2sgml.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-01-14 17:06:09 (GMT)
committerFred Drake <fdrake@acm.org>1999-01-14 17:06:09 (GMT)
commit79ad1f19dc5d45251230798a93c74668e4675801 (patch)
tree2ada7f6a9469bd84ca1cef7e0a53df15b3808174 /Doc/tools/sgmlconv/esis2sgml.py
parent348fd06890a964e713e151526b0de5042c68574e (diff)
downloadcpython-79ad1f19dc5d45251230798a93c74668e4675801.zip
cpython-79ad1f19dc5d45251230798a93c74668e4675801.tar.gz
cpython-79ad1f19dc5d45251230798a93c74668e4675801.tar.bz2
Escape special characters on output.
Diffstat (limited to 'Doc/tools/sgmlconv/esis2sgml.py')
-rwxr-xr-xDoc/tools/sgmlconv/esis2sgml.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/tools/sgmlconv/esis2sgml.py b/Doc/tools/sgmlconv/esis2sgml.py
index 172e712..d6f3eb9 100755
--- a/Doc/tools/sgmlconv/esis2sgml.py
+++ b/Doc/tools/sgmlconv/esis2sgml.py
@@ -12,13 +12,15 @@ import esistools
import re
import string
+from xml.utils import escape
+
def format_attrs(attrs):
attrs = attrs.items()
attrs.sort()
s = ''
for name, value in attrs:
- s = '%s %s="%s"' % (s, name, value)
+ s = '%s %s="%s"' % (s, name, escape(value))
return s
@@ -39,7 +41,7 @@ def do_convert(ifp, ofp, xml=0):
data = data[:-1]
if type == "-":
data = esistools.decode(data)
- ofp.write(data)
+ ofp.write(escape(data))
if "\n" in data:
lastopened = None
knownempty = 0