[Python-checkins] gh-71616: Add note to warn against general translation of saxutils.escape() (#93450)

nanjekyejoannah webhook-mailer at python.org
Tue Oct 11 05:27:58 EDT 2022


https://github.com/python/cpython/commit/f0a680007f345a46bcd187b952a929c7068c1da8
commit: f0a680007f345a46bcd187b952a929c7068c1da8
branch: main
author: Stanley <46876382+slateny at users.noreply.github.com>
committer: nanjekyejoannah <33177550+nanjekyejoannah at users.noreply.github.com>
date: 2022-10-11T05:27:49-04:00
summary:

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

files:
M Doc/library/xml.sax.utils.rst

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={})
 



More information about the Python-checkins mailing list