Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8ee0663

Browse filesBrowse files
committed
pythongh-115398: Suggest use of hasattr with checking for 3.13 Expat API availability (pythonGH-116278)
Suggest use of "hasattr" with checking for 3.13 Expat API availability (cherry picked from commit 73807eb)
1 parent 3614f0b commit 8ee0663
Copy full SHA for 8ee0663

File tree

Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed

‎Doc/library/pyexpat.rst

Copy file name to clipboardExpand all lines: Doc/library/pyexpat.rst
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ XMLParser Objects
217217
Calling ``SetReparseDeferralEnabled(True)`` allows re-enabling reparse
218218
deferral.
219219

220+
Note that :meth:`SetReparseDeferralEnabled` has been backported to some
221+
prior releases of CPython as a security fix. Check for availability of
222+
:meth:`SetReparseDeferralEnabled` using :func:`hasattr` if used in code
223+
running across a variety of Python versions.
224+
220225
.. versionadded:: 3.12.3
221226

222227
.. method:: xmlparser.GetReparseDeferralEnabled()

‎Doc/library/xml.etree.elementtree.rst

Copy file name to clipboardExpand all lines: Doc/library/xml.etree.elementtree.rst
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,11 @@ XMLParser Objects
13971397
Disabling reparse deferral has security consequences; please see
13981398
:meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` for details.
13991399

1400+
Note that :meth:`flush` has been backported to some prior releases of
1401+
CPython as a security fix. Check for availability of :meth:`flush`
1402+
using :func:`hasattr` if used in code running across a variety of Python
1403+
versions.
1404+
14001405
.. versionadded:: 3.12.3
14011406

14021407

@@ -1470,6 +1475,11 @@ XMLPullParser Objects
14701475
Disabling reparse deferral has security consequences; please see
14711476
:meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled` for details.
14721477

1478+
Note that :meth:`flush` has been backported to some prior releases of
1479+
CPython as a security fix. Check for availability of :meth:`flush`
1480+
using :func:`hasattr` if used in code running across a variety of Python
1481+
versions.
1482+
14731483
.. versionadded:: 3.12.3
14741484

14751485
.. method:: close()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.