gh-90949: expose Expat API to tune exponential expansion protections#139368
Conversation
picnixz
left a comment
There was a problem hiding this comment.
I've updated the PR from the web UI but I'll do the rest tomorrow.
hartwork
left a comment
There was a problem hiding this comment.
@picnixz I like this new version! 👍
One question: There were changes in here to the previous related news file. This is what it reads on main today:
# cat Misc/NEWS.d/next/Library/2025-09-22-14-40-11.gh-issue-90949.UM35nb.rst
Add :meth:`~xml.parsers.expat.xmlparser.SetAllocTrackerActivationThreshold`
and :meth:`~xml.parsers.expat.xmlparser.SetAllocTrackerMaximumAmplification`
to :ref:`xmlparser <xmlparser-objects>` objects to prevent use of
disproportional amounts of dynamic memory from within an Expat parser.
Patch by Bénédikt Tran.From what we discussed here, this should probably says things about tuning also?
Should you or me create a follow-up pull request to adjust that after this?
|
I'll amend the NEWS as part of this PR. |
|
Since this is built on top of many other PRs, I'll just wait for the others to be backported first. |
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Sorry, @picnixz, I could not cleanly backport this to |
|
Sorry, @picnixz, I could not cleanly backport this to |
|
Sorry, @picnixz, I could not cleanly backport this to |
|
Sorry, @picnixz, I could not cleanly backport this to |
|
Sorry, @picnixz, I could not cleanly backport this to |
|
@StanFromIreland I see that the backports here totally failed and then it passed under my radar. Could you backport this PR (and any other PRs that need to be backported with it, including docs changes) to 3.14 so that you're no more blocked? I'm sorry to dump my work on you but I won't be available otherwise for that today :( |
|
It's fine, I've put it on my list, I'll get to it soon-ish. |
This is built on top of #139366.
cc @hartwork
📚 Documentation preview 📚: https://cpython-previews--139368.org.readthedocs.build/