Skip to content

gh-146169: correctly handle re-entrant parsing calls in Expat handlers - #146566

Merged
JelleZijlstra merged 8 commits into
python:mainfrom
picnixz:fix/expat/parse-recursive-146169
Oct 23, 2026
Merged

JelleZijlstra merged 8 commits into
python:mainfrom
picnixz:fix/expat/parse-recursive-146169

Conversation

@picnixz

@picnixz picnixz commented Mar 28, 2026 •

Copy link
Copy Markdown
Member

Comment thread Misc/NEWS.d/next/Library/2026-03-28-10-27-46.gh-issue-146169.RBF1xp.rst Outdated
@picnixz

picnixz commented Mar 28, 2026 •

Copy link
Copy Markdown
Member Author

@hartwork I'd like your feedback here to know whether there are other places that I need to consider. I will work on the encoding issue described in the GH issue afterwards unless they are interconnected. TiA!

@picnixz picnixz added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Mar 28, 2026

@hartwork hartwork left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hartwork I'd like your feedback here to know whether there are other places that I need to consider. I will work on the encoding issue described in the GH issue afterwards unless they are interconnected. TiA!

@picnixz they seem interconnected, yes. Here's what I found:

Comment thread Lib/test/test_pyexpat.py Outdated
Comment thread Lib/test/test_pyexpat.py Outdated
Comment thread Modules/pyexpat.c Outdated
@picnixz

picnixz commented Apr 11, 2026

Copy link
Copy Markdown
Member Author

For the encoding issue, I will actually do it in a separate PR. It's not really a re-entrancy call issue, but rather an issue where you call XML_Parse() first and then you recall it later with a different string and hence have a different possible encoding.

@picnixz
picnixz requested a review from hartwork April 11, 2026 13:48
Comment thread Misc/NEWS.d/next/Library/2026-03-28-10-27-46.gh-issue-146169.RBF1xp.rst Outdated
Comment thread Misc/NEWS.d/next/Library/2026-03-28-10-27-46.gh-issue-146169.RBF1xp.rst Outdated
Comment thread Lib/test/test_pyexpat.py Outdated
@picnixz
picnixz requested a review from hartwork April 12, 2026 16:00

@hartwork hartwork left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@picnixz probably good to merge by now(, I lack permissions to approve).

@picnixz

picnixz commented Apr 12, 2026

Copy link
Copy Markdown
Member Author

Thanks! I've left my dev session so I'll merge it tomorrow. Thanks for the review! I'll also address the encoding issue separately

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 18, 2026
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.15 bugs and security fixes label May 30, 2026
@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label Jun 3, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Sep 5, 2026
@JelleZijlstra
JelleZijlstra enabled auto-merge (squash) October 22, 2026 23:25
@JelleZijlstra
JelleZijlstra merged commit dfd2c7c into python:main Oct 23, 2026
57 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @picnixz for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

GH-160410 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 23, 2026
@bedevere-app

bedevere-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

GH-160411 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 23, 2026
@bedevere-app

bedevere-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

GH-160412 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants