GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [3.14] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368) by StanFromIreland · Pull Request #150496 · python/cpython Conversation
|
Documentation build overview
393 files changed ·
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| self.assert_root_parser_failure(setter, 123.45) | ||
|
|
||
|
|
||
| @unittest.skipIf(expat.version_info < (2, 4, 0), "requires Expat >= 2.4.0") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think we had a recent issue where this check was not sufficient and tests needed to be disabled in another way using hasattr() checks. Can you check how it's currently done on main please?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's identical on main?
cpython/Lib/test/test_pyexpat.py
Lines 1265 to 1266 in d8ff4f8
| @unittest.skipIf(expat.version_info < (2, 4, 0), "requires Expat >= 2.4.0") | |
| class ExpansionProtectionTest(AttackProtectionTestBase, unittest.TestCase): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ah indeed, but the problem was for the other API:
@unittest.skipIf(not hasattr(expat.XMLParserType,
"SetAllocTrackerMaximumAmplification"),
"requires Python compiled with Expat >= 2.7.2")
So I think the version check for billion laughs is also wrong and should be changed to the same as for SetAllocTrackerMaximumAmplification. But let's address this separately later in a follow-up PR (so as to ease backports)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
LGTM but I'd appreciate if @hartwork could have a quick glance just for wordings. I hope every backport has been merged properly (if we are matching against 3.15 then it should good). It's just that I remember that the work was split across multiple PRs... |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@StanFromIreland I have just had a quick look through the lense of… # diff -u1 <(git diff 666112376d574c7802646ee1df6244062671cd61{^,}) <(git diff upstream-readonly/3.14...StanFromIreland/backport-6661123-3.14) | ydiff …and I see:
Are these intended or accidental? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think I updated these at some points but I don't remember in which direction. I would say: pick the style that we currently have on main, it doesn't matter. I just don't want to have docs that are different across versions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@picnixz +1 from me for being in line with |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| capi->SetAllocTrackerActivationThreshold = NULL; | ||
| capi->SetAllocTrackerMaximumAmplification = NULL; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
the else is the wrong here actually, it's SetBillionLaughsAttackProtectionActivationThreshold
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's the same on main:
Lines 2548 to 2554 in 9fdbade
| #if XML_COMBINED_VERSION >= 20400 | |
| capi->SetBillionLaughsAttackProtectionActivationThreshold = XML_SetBillionLaughsAttackProtectionActivationThreshold; | |
| capi->SetBillionLaughsAttackProtectionMaximumAmplification = XML_SetBillionLaughsAttackProtectionMaximumAmplification; | |
| #else | |
| capi->SetAllocTrackerActivationThreshold = NULL; | |
| capi->SetAllocTrackerMaximumAmplification = NULL; | |
| #endif |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I wrote #151147 for main/3.15, for here:
| capi->SetAllocTrackerActivationThreshold = NULL; | |
| capi->SetAllocTrackerMaximumAmplification = NULL; | |
| capi->SetBillionLaughsAttackProtectionActivationThreshold = NULL; | |
| capi->SetBillionLaughsAttackProtectionMaximumAmplification = NULL; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oh!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Now I think we're good. If docs need to be amended we'll do it but C should be ok.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Fuzzer failures are unrelated ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @StanFromIreland, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-151151 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.