Skip to content

Commit 220f3e2

Browse files
committed
reoder docs
1 parent 0c03735 commit 220f3e2

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

Doc/library/pyexpat.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,20 @@ XMLParser Objects
234234
:class:`xmlparser` objects have the following methods to mitigate some
235235
common XML vulnerabilities.
236236

237+
.. method:: xmlparser.SetAllocTrackerActivationThreshold(threshold, /)
238+
239+
Sets the number of allocated bytes of dynamic memory needed to activate
240+
protection against disproportionate use of RAM.
241+
242+
By default, parser objects have an allocation activation threshold of 64 MiB,
243+
or equivalently 67,108,864 bytes.
244+
245+
An :exc:`ExpatError` is raised if this method is called on a non-root parser.
246+
The corresponding :attr:`~ExpatError.lineno` and :attr:`~ExpatError.offset`
247+
should not be used as they may have no special meaning.
248+
249+
.. versionadded:: next
250+
237251
.. method:: xmlparser.SetAllocTrackerMaximumAmplification(max_factor, /)
238252

239253
Sets the maximum amplification factor between direct input and bytes
@@ -264,20 +278,6 @@ common XML vulnerabilities.
264278

265279
.. versionadded:: next
266280

267-
.. method:: xmlparser.SetAllocTrackerActivationThreshold(threshold, /)
268-
269-
Sets the number of allocated bytes of dynamic memory needed to activate
270-
protection against disproportionate use of RAM.
271-
272-
By default, parser objects have an allocation activation threshold of 64 MiB,
273-
or equivalently 67,108,864 bytes.
274-
275-
An :exc:`ExpatError` is raised if this method is called on a non-root parser.
276-
The corresponding :attr:`~ExpatError.lineno` and :attr:`~ExpatError.offset`
277-
should not be used as they may have no special meaning.
278-
279-
.. versionadded:: next
280-
281281

282282
:class:`xmlparser` objects have the following attributes:
283283

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ unittest
543543
xml.parsers.expat
544544
-----------------
545545

546-
* Add :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerMaximumAmplification`
547-
and :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerActivationThreshold`
546+
* Add :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerActivationThreshold`
547+
and :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerMaximumAmplification`
548548
to :ref:`xmlparser <xmlparser-objects>` objects to prevent use of
549549
disproportional amounts of dynamic memory from within an Expat parser.
550550
(Contributed by Bénédikt Tran in :gh:`90949`.)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Add :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerMaximumAmplification`
2-
and :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerActivationThreshold`
1+
Add :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerActivationThreshold`
2+
and :func:`~xml.parsers.expat.xmlparser.SetAllocTrackerMaximumAmplification`
33
to :ref:`xmlparser <xmlparser-objects>` objects to prevent use of
44
disproportional amounts of dynamic memory from within an Expat parser. Patch
55
by Bénédikt Tran.

0 commit comments

Comments
 (0)