Description
Feature or enhancement
Proposal:
Hello CPython team! 👋
Expat 2.6.0 introduced a new function XML_SetReparseDeferralEnabled
that currently neither xml.parsers.expat.XMLParserType
of pyexpat nor xml.etree.ElementTree.XMLParser
of ElementTree give access to it, so when some Python-based library or application finds themselves in a situation where toggling reparse deferral is beneficial or needed for their scenario in the future, they will not be able to do so with ease or at all.
Please note that this is a sibling ticket to #90949 in some sense and implementations could be combined or done in one go, potentially.
Also please note that…
- for
xml.etree.ElementTree.XMLParser
a new methoddef flush(self):
could be a reasonable API addition based on the idea gh-115133: test_xml_etree.py: Fix for Expat >=2.6.0 with reparse deferral (fixes #115133) #115138 (comment) ; - the same seems to apply to
xml.sax.xmlreader.IncrementalParser
.
I cannot provide a pull request on the topic economically myself unfortunately, but I am happy to support any related efforts (including voice calls on the topic as needed). Thanks in advance!
Best, Sebastian
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
- gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) #115623
- [3.12] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) #116248
- [3.11] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) #116268
- [3.10] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) #116270
- [3.9] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) #116272
- [3.8] gh-115398: Expose Expat >=2.6.0 reparse deferral API (CVE-2023-52425) (GH-115623) #116275
- gh-115398: Suggest use of
hasattr
with checking for 3.13 Expat API availability #116278 - gh-115398: Increment PyExpat_CAPI_MAGIC for SetReparseDeferralEnabled addition #116301
- gh-115398: Revert
PyExpat_CAPI_MAGIC
version bump #116411