summaryrefslogtreecommitdiffstats
path: root/Lib/cgi.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2005-08-02 02:50:25 (GMT)
committerSkip Montanaro <skip@pobox.com>2005-08-02 02:50:25 (GMT)
commit97b2fa229c219652b83fb22670f1b6af4d3a18c3 (patch)
tree845fa08f4aeb3cfa34e76cc01a1b795f49a3b913 /Lib/cgi.py
parent0d6615fd29063bdaccb13e1fbae542fb666d8728 (diff)
downloadcpython-97b2fa229c219652b83fb22670f1b6af4d3a18c3.zip
cpython-97b2fa229c219652b83fb22670f1b6af4d3a18c3.tar.gz
cpython-97b2fa229c219652b83fb22670f1b6af4d3a18c3.tar.bz2
Bring cgi.escape docstring slightly more in line with the library ref
manual. Closes #1243553.
Diffstat (limited to 'Lib/cgi.py')
-rwxr-xr-xLib/cgi.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 1a99868..eb96303 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -1041,7 +1041,9 @@ environment as well. Here are some common variable names:
# =========
def escape(s, quote=None):
- """Replace special characters '&', '<' and '>' by SGML entities."""
+ '''Replace special characters "&", "<" and ">" to HTML-safe sequences.
+ If the optional flag quote is true, the quotation mark character (")
+ is also translated.'''
s = s.replace("&", "&amp;") # Must be done first!
s = s.replace("<", "&lt;")
s = s.replace(">", "&gt;")