-
-
Notifications
You must be signed in to change notification settings - Fork 32k
The error message for odd-length input to bytes.fromhex
is cryptic
#127740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Kodiologist are you working on it ? |
Nope, it's up for grabs right now. |
Thanks 🙏. I am taking it then |
Marking this one as a feature rather than a bug since changing exception messages may break CI (python/mypy#17849) and users may rely on exception messages. |
Users may, but users shouldn't ;-). We don't want to change error messages unnecessarily; however, if the error message is bad, it should get fixed. To misquote Spock, the needs of many people reading error messages outweigh the needs of the few who overspecify their tests. Bad error messages are a major source of user frustration. |
I'm not against changing the error message but I honestly think we don't need to backport it to 3.12 and 3.13 (personally I wouldn't be against the backports but I learned the hard way that changing error messages in bug fix releases could cause un-necessary additional work =/). |
…e error message to ValueError: fromhex() arg must be of even length
…r message to ValueError: fromhex() arg must be of even length (#127756)
Thanks for fixing this, like Raymond says, better error messages are very valuable cfbolz chose not to backport the PR, which seems fine to me. After all, the worse error message was around for 18 years old. So closing the issue, but if someone feels strongly about backport, please mention so |
…e error message to ValueError: fromhex() arg must be of even length (python#127756)
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
I suggest:
ValueError: fromhex() arg must be of even length
.CPython versions tested on:
3.12, CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: