Skip to content

Commit f0a6800

Browse files
authored
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
1 parent e0ae9dd commit f0a6800

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/xml.sax.utils.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ or as base classes.
2525
replaced with its corresponding value. The characters ``'&'``, ``'<'`` and
2626
``'>'`` are always escaped, even if *entities* is provided.
2727

28+
.. note::
29+
30+
This function should only be used to escape characters that
31+
can't be used directly in XML. Do not use this function as a general
32+
string translation function.
2833

2934
.. function:: unescape(data, entities={})
3035

0 commit comments

Comments
 (0)