Skip to content
48 changes: 44 additions & 4 deletions Doc/library/pyexpat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ XMLParser Objects
Calling ``SetReparseDeferralEnabled(True)`` allows re-enabling reparse
deferral.

Note that :meth:`SetReparseDeferralEnabled` has been backported to some
prior releases of CPython as a security fix. Check for availability of
:meth:`SetReparseDeferralEnabled` using :func:`hasattr` if used in code
running across a variety of Python versions.
.. note::

:meth:`SetReparseDeferralEnabled`
has been backported to some prior releases of CPython as a security fix.
Check for availability of
:meth:`SetReparseDeferralEnabled`
using :func:`hasattr` if used in code running across a variety of Python
versions.

.. versionadded:: 3.13

Expand Down Expand Up @@ -262,6 +266,15 @@ against some common XML vulnerabilities.
Activation thresholds below 4 MiB are known to break support for DITA 1.3
payload and are hence not recommended.

.. note::

:meth:`SetBillionLaughsAttackProtectionActivationThreshold`
has been backported to some prior releases of CPython as a security fix.
Check for availability of
:meth:`SetBillionLaughsAttackProtectionActivationThreshold`
using :func:`hasattr` if used in code running across a variety of Python
versions.

.. versionadded:: next

.. method:: xmlparser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor, /)
Expand Down Expand Up @@ -294,6 +307,15 @@ against some common XML vulnerabilities.
that can be adjusted by :meth:`.SetBillionLaughsAttackProtectionActivationThreshold`
is exceeded.

.. note::

:meth:`SetBillionLaughsAttackProtectionMaximumAmplification`
has been backported to some prior releases of CPython as a security fix.
Check for availability of
:meth:`SetBillionLaughsAttackProtectionMaximumAmplification`
using :func:`hasattr` if used in code running across a variety of Python
versions.

.. versionadded:: next

.. method:: xmlparser.SetAllocTrackerActivationThreshold(threshold, /)
Expand All @@ -309,6 +331,15 @@ against some common XML vulnerabilities.
The corresponding :attr:`~ExpatError.lineno` and :attr:`~ExpatError.offset`
should not be used as they may have no special meaning.

.. note::

:meth:`SetAllocTrackerActivationThreshold`
has been backported to some prior releases of CPython as a security fix.
Check for availability of
:meth:`SetAllocTrackerActivationThreshold`
using :func:`hasattr` if used in code running across a variety of Python
versions.

.. versionadded:: next

.. method:: xmlparser.SetAllocTrackerMaximumAmplification(max_factor, /)
Expand Down Expand Up @@ -340,6 +371,15 @@ against some common XML vulnerabilities.
that can be adjusted by :meth:`.SetAllocTrackerActivationThreshold`
is exceeded.

.. note::

:meth:`SetAllocTrackerMaximumAmplification`
has been backported to some prior releases of CPython as a security fix.
Check for availability of
:meth:`SetAllocTrackerMaximumAmplification`
using :func:`hasattr` if used in code running across a variety of Python
versions.

.. versionadded:: next


Expand Down
24 changes: 16 additions & 8 deletions Doc/library/xml.etree.elementtree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1398,10 +1398,14 @@ XMLParser Objects
Disabling reparse deferral has security consequences; please see
:meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` for details.

Note that :meth:`flush` has been backported to some prior releases of
CPython as a security fix. Check for availability of :meth:`flush`
using :func:`hasattr` if used in code running across a variety of Python
versions.
.. note::

:meth:`flush`
has been backported to some prior releases of CPython as a security
fix. Check for availability of
:meth:`flush`
using :func:`hasattr` if used in code running across a variety of
Python versions.

.. versionadded:: 3.13

Expand Down Expand Up @@ -1476,10 +1480,14 @@ XMLPullParser Objects
Disabling reparse deferral has security consequences; please see
:meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` for details.

Note that :meth:`flush` has been backported to some prior releases of
CPython as a security fix. Check for availability of :meth:`flush`
using :func:`hasattr` if used in code running across a variety of Python
versions.
.. note::

:meth:`flush`
has been backported to some prior releases of CPython as a security
fix. Check for availability of
:meth:`flush`
using :func:`hasattr` if used in code running across a variety of
Python versions.

.. versionadded:: 3.13

Expand Down
Loading