]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-71616: Add note to warn against general translation of saxutils.escape() (#93450)
authorStanley <46876382+slateny@users.noreply.github.com>
Tue, 11 Oct 2022 09:27:49 +0000 (02:27 -0700)
committerGitHub <noreply@github.com>
Tue, 11 Oct 2022 09:27:49 +0000 (05:27 -0400)
* Add note to warn against general translation of saxutils.escape()

* Use more direct wording

Doc/library/xml.sax.utils.rst

index e46fefdf997510d3455dff1e0864931ef2e52518..ab4606bcf9fe6ca85160ad4fb29351ad6799b70c 100644 (file)
@@ -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={})