Skip to content

Commit cbe0c12

Browse files
committed
Change security warning to note about intended usage
1 parent 4b4c15a commit cbe0c12

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Doc/library/xml.sax.utils.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ or as base classes.
7171
content: if ``False`` (the default) they are emitted as a pair of start/end
7272
tags, if set to ``True`` they are emitted as a single self-closed tag.
7373

74-
.. warning::
75-
:class:`!XMLGenerator` does not validate element or
76-
attribute names. Callers must ensure that names passed to APIs conform
77-
to `XML name rules <https://www.w3.org/TR/xml/#NT-Name>`__ if passing
78-
untrusted input. Character data and attribute values are escaped,
79-
but not validated.
74+
.. note::
75+
:class:`!XMLGenerator` is only intended to be used as a ``handler``
76+
with SAX parser functions from the :mod:`!xml.sax` module. Using XMLGenerator
77+
on untrusted user inputs is not the intended use.
8078

8179
.. versionchanged:: 3.2
8280
Added the *short_empty_elements* parameter.

0 commit comments

Comments
 (0)