Uh oh!
There was an error while loading. Please reload this page.
gh-132983: _zstd: use Py_UNREACHABLE in _zstd_load_impl - #137320
Conversation
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM as well.
@emmatyping Would you like to use your new green button?
ZeroIntensity
commented
Aug 4, 2025
Hm, how are you envisioning that? The whole point of |
AA-Turner
commented
Aug 4, 2025
I'm not a fan of needing logic like this, and it would be nice to exhaustively test that we never hit it, but I haven't had a good idea, no. A |
AA-Turner
commented
Aug 4, 2025
Anyway, the compression path already uses A |
Uh oh!
There was an error while loading. Please reload this page.
Thanks @Rogdham for the PR, and @AA-Turner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…honGH-137320) (cherry picked from commit 57eab1b) Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
GH-137360 is a backport of this pull request to the 3.14 branch. |
…`` (pythonGH-137320) (python#137360) Co-authored-by: Rogdham <3994389+Rogdham@users.noreply.github.com>
There are 2 functions called
_zstd_load_impl: one for compression and one for decompression.In these functions, the
typevariable is supposed to represent the dict type. Due to the way the function is called, the dict type is always one ofDICT_TYPE_DIGESTED/DICT_TYPE_UNDIGESTED/DICT_TYPE_PREFIX. However, the implementations differs in the unreachable case:Py_UNREACHABLESystemErrorexceptionThis PR harmonizes the two implementations by using
Py_UNREACHABLE.