Index: howto/webservers.rst
===================================================================
--- howto/webservers.rst (revision 84293)
+++ howto/webservers.rst (working copy)
@@ -293,7 +293,7 @@
# -*- coding: UTF-8 -*-
import sys, os
- from cgi import escape
+ from html import escape
from flup.server.fcgi import WSGIServer
def app(environ, start_response):
Index: library/markup.rst
===================================================================
--- library/markup.rst (revision 84293)
+++ library/markup.rst (working copy)
@@ -20,6 +20,7 @@
.. toctree::
+ html.rst
html.parser.rst
html.entities.rst
pyexpat.rst
Index: library/html.rst
===================================================================
--- library/html.rst (revision 0)
+++ library/html.rst (revision 0)
@@ -0,0 +1,20 @@
+:mod:`html` --- HyperText Markup Language support
+=================================================
+
+.. module:: html
+ :synopsis: Helpers for manipulating HTML.
+
+This module defines a number of utilities to manipulate HTML.
+
+.. function:: escape(s, quote=False)
+
+ Convert the characters ``'&'``, ``'<'`` and ``'>'`` in string *s* to HTML-safe
+ sequences. Use this if you need to display text that might contain such
+ characters in HTML. If the optional flag *quote* is true, the quotation mark
+ character (``"``) is also translated; this helps for inclusion in an HTML
+ attribute value delimited by double quotes, as in ````. Note
+ that single quotes are never translated.
+
+ If the value to be quoted might include single- or double-quote characters,
+ or both, consider using the :func:`~xml.sax.saxutils.quoteattr` function in the
+ :mod:`xml.sax.saxutils` module instead.
Property changes on: library/html.rst
___________________________________________________________________
Added: svn:eol-style
+ native
Index: library/cgi.rst
===================================================================
--- library/cgi.rst (revision 84293)
+++ library/cgi.rst (working copy)
@@ -321,18 +321,10 @@
.. function:: escape(s, quote=False)
- Convert the characters ``'&'``, ``'<'`` and ``'>'`` in string *s* to HTML-safe
- sequences. Use this if you need to display text that might contain such
- characters in HTML. If the optional flag *quote* is true, the quotation mark
- character (``"``) is also translated; this helps for inclusion in an HTML
- attribute value delimited by double quotes, as in ````. Note
- that single quotes are never translated.
+ This function is deprecated in this module. Use :func:`html.escape`
+ instead. It is maintained here only for backward compatibility.
- If the value to be quoted might include single- or double-quote characters,
- or both, consider using the :func:`~xml.sax.saxutils.quoteattr` function in the
- :mod:`xml.sax.saxutils` module instead.
-
.. _cgi-security:
Caring about security