You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve error message of compression.zstd.ZstdError #153621
When the underlying libzstd of compression.zstd encounters an error, compression.zstd only raises a vague "Unable to decompress Zstandard data: Data corruption detected" while libzstd is way more verbose about what actually went wrong, my proposal is to either raise a more descriptive error or expose the raw return code in ZstdError.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
It is a bit more delicate to change an API that was already decided by a PEP but adding an attribute to exceptions with the error code may be relevant.
Activity
picnixz commentedon Jul 12, 2026
It is a bit more delicate to change an API that was already decided by a PEP but adding an attribute to exceptions with the error code may be relevant.
cc @emmatyping
smiRaphi commentedon Jul 12, 2026
I'm not talking about changing the exception class name, just making the Message more descriptive
picnixz commentedon Jul 12, 2026
If it is just about the message it is fine! I did so for curses.
[-]Raise exact error in compression.zstd.ZstdError[/-][+]Improve error message of `compression.zstd.ZstdError`[/+]emmatyping commentedon Jul 13, 2026
Agreed it would be better to raise with a more descriptive message. @smiRaphi would you like to open a PR?
Add NEWS entry for pythongh-153621