From: Stanley <46876382+slateny@users.noreply.github.com> Date: Tue, 11 Oct 2022 09:27:49 +0000 (-0700) Subject: gh-71616: Add note to warn against general translation of saxutils.escape() (#93450) X-Git-Tag: v3.12.0a1~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0a680007f345a46bcd187b952a929c7068c1da8;p=thirdparty%2FPython%2Fcpython.git gh-71616: Add note to warn against general translation of saxutils.escape() (#93450) * Add note to warn against general translation of saxutils.escape() * Use more direct wording --- diff --git a/Doc/library/xml.sax.utils.rst b/Doc/library/xml.sax.utils.rst index e46fefdf9975..ab4606bcf9fe 100644 --- a/Doc/library/xml.sax.utils.rst +++ b/Doc/library/xml.sax.utils.rst @@ -25,6 +25,11 @@ or as base classes. replaced with its corresponding value. The characters ``'&'``, ``'<'`` and ``'>'`` are always escaped, even if *entities* is provided. + .. note:: + + This function should only be used to escape characters that + can't be used directly in XML. Do not use this function as a general + string translation function. .. function:: unescape(data, entities={})