Uh oh!
There was an error while loading. Please reload this page.
gh-150599: Prevent bz2 decompressor reuse after errors - #150600
Conversation
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Why reraise the same error again and again? Why not close the decomressor, set eof and raise EOFError? Or set other flag and raise ValueError or RuntimeError?
StanFromIreland
commented
May 30, 2026
Serhiy, FYI this is the fix for: https://github.com/python/cpython/security/advisories/GHSA-mv83-7xc2-cc7v
Setting |
serhiy-storchaka
commented
May 30, 2026
You are not supposed to use decompressor after failure. Raising a ValueError or a RuntimeError with specific error message ("decompressor is dead, don't use it") will make it clear. |
StanFromIreland
commented
May 30, 2026
It is clear, I'm still leaning towards providing the root cause being more helpful. Greg and Emma, what do you think is better here? |
serhiy-storchaka
commented
May 30, 2026
You already got the initial error first time. There is no precedence of keeping the original error and raising it on recurring requests. |
StanFromIreland
commented
Jun 3, 2026
Ok, we also raise a Lines 267 to 268 in 494f2e3 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thanks @StanFromIreland for the PR, and @emmatyping for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11, 3.12, 3.13, 3.14, 3.15. |
Sorry, @StanFromIreland and @emmatyping, I could not cleanly backport this to |
Sorry, @StanFromIreland and @emmatyping, I could not cleanly backport this to |
GH-151045 is a backport of this pull request to the 3.15 branch. |
Sorry, @StanFromIreland and @emmatyping, I could not cleanly backport this to |
Sorry, @StanFromIreland and @emmatyping, I could not cleanly backport this to |
Sorry, @StanFromIreland and @emmatyping, I could not cleanly backport this to |
GH-151054 is a backport of this pull request to the 3.14 branch. |
StanFromIreland
commented
Jun 7, 2026
The others should hopefully come cleanly from #151054. |
GH-151055 is a backport of this pull request to the 3.13 branch. |
GH-151057 is a backport of this pull request to the 3.12 branch. |
GH-151132 is a backport of this pull request to the 3.11 branch. |
GH-151133 is a backport of this pull request to the 3.10 branch. |
Uh oh!
There was an error while loading. Please reload this page.