Skip to content

GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime#144740

Merged
vstinner merged 2 commits intopython:mainfrom
hroncok:expat-skipif
Mar 4, 2026
Merged

GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime#144740
vstinner merged 2 commits intopython:mainfrom
hroncok:expat-skipif

Conversation

@hroncok
Copy link
Contributor

@hroncok hroncok commented Feb 12, 2026

@hroncok
Copy link
Contributor Author

hroncok commented Feb 12, 2026

I'm yet to actually test this by the described reproducer.

@hroncok
Copy link
Contributor Author

hroncok commented Feb 12, 2026

I'm yet to actually test this by the described reproducer.

It works.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. It makes sense to check for .SetAllocTrackerMaximumAmplification attribute (method) instead of relying on the expat version.

@picnixz: Do you want to double check this change?

@vstinner vstinner added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Mar 4, 2026
Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

I think SetBillionLaughsAttackProtectionActivationThreshold also suffers from that so the test guarding for expat 2.4 should also be guarded. I don't remember whether 3.13 was the release that included that one or if it was something that was already there for a long time. You can address that in a follow-up PR though.

@vstinner vstinner merged commit 45e9343 into python:main Mar 4, 2026
55 checks passed
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @hroncok and @vstinner, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 45e9343d7eed1d9e784e731cc9af853fa8649e59 3.14

@miss-islington-app
Copy link

Sorry, @hroncok and @vstinner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 45e9343d7eed1d9e784e731cc9af853fa8649e59 3.13

vstinner pushed a commit to vstinner/cpython that referenced this pull request Mar 4, 2026
…t compile-time version, not runtime (python#144740)

(cherry picked from commit 45e9343)
@bedevere-app
Copy link

bedevere-app bot commented Mar 4, 2026

GH-145494 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 Mar 4, 2026
@vstinner vstinner removed the needs backport to 3.13 bugs and security fixes label Mar 4, 2026
@vstinner
Copy link
Member

vstinner commented Mar 4, 2026

Merged. Thanks for the fix @hroncok.

@hroncok hroncok deleted the expat-skipif branch March 4, 2026 13:04
vstinner added a commit that referenced this pull request Mar 4, 2026
…at compile-time version, not runtime (#144740) (#145494)

GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (#144740)

(cherry picked from commit 45e9343)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 4, 2026
…on expat compile-time version, not runtime (pythonGH-144740) (pythonGH-145494)

pythonGH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (pythonGH-144740)

(cherry picked from commit 45e9343)
(cherry picked from commit bcc2dd8)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
vstinner added a commit that referenced this pull request Mar 4, 2026
…at compile-time version, not runtime (GH-144740) (GH-145494) (#145510)

[3.14] GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740) (GH-145494)

GH-144739: Skip test_pyexpat.MemoryProtectionTest based on expat compile-time version, not runtime (GH-144740)

(cherry picked from commit 45e9343)
(cherry picked from commit bcc2dd8)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
@hroncok
Copy link
Contributor Author

hroncok commented Mar 4, 2026

I think SetBillionLaughsAttackProtectionActivationThreshold also suffers from that so the test guarding for expat 2.4 should also be guarded. I don't remember whether 3.13 was the release that included that one or if it was something that was already there for a long time. You can address that in a follow-up PR though.

FTR I don't have an environment with epxat that old, so I won't be driving that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants