-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
datetime error message is different between _pydatetime.py and _datetimemodule.c #109798
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
@mattip So, you suggest to leave the option as in the I can send a PR |
I don't really have an opinion which error message is better, only that they be the same. |
Ok, I will leave error message as in the c implementation Firstly, it is better to output a string (not tuple), and in the python implementation, the second value in tuple is redundant. |
I also add more inconsistency in the error messages that I found in the code 1. Errors about date and time have inconsistent messages, for example problem with
|
Updates error messages in datetime and makes them consistent between Python and C. --------- Co-authored-by: Erlend E. Aasland <[email protected]> Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Paul Ganssle <[email protected]>
PR was merged, issue is complete :-) It seems there was no plan to back port which is for the best for backwards compatibility. |
Thanks! |
Bug report
Bug description:
The error message differs between the two implementations of datetime. This came up when testing PyPy, which uses the pure-python datetime implementation. xref conda-forge/rtoml-feedstock#1 (comment)
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
_datetime
anddatetime
error messages #127345The text was updated successfully, but these errors were encountered: