gh-109798: Normalize _datetime and datetime error messages#127345
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
1d65305 to
9da0dfc
Compare
November 29, 2024 12:31
|
BTW, please do not force-push; it makes reviewing harder. Moreover, all commits are squashed upon merge anyway, so there's no need for the PR/branch to be cluttered with amendment commits. See also the devguide. |
Sorry, something went wrong.
|
@erlend-aasland sorry, i got it. |
Sorry, something went wrong.
datetimeCo-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
ZeroIntensity
left a comment
There was a problem hiding this comment.
Some nitpicks, and two notes:
- I'm happy with doing this, but we do need to be aware that this is a slight breaking change for anybody relying on the exception messages. They shouldn't be doing that, but we need to be aware of it anyway.
- It's fine right now, but
PyErr_Formatwith%Rcan have unintended side effects if the__repr__of the passed object is evil. Again, not a problem here as far as I can tell, but it's definitely worth noting.
Sorry, something went wrong.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
ZeroIntensity
left a comment
There was a problem hiding this comment.
Now, how far fetched is it to ask for some assertRaisesRegex tests 😄
Sorry, something went wrong.
|
@ZeroIntensity i added tests ✅ , |
Sorry, something went wrong.
ZeroIntensity
left a comment
There was a problem hiding this comment.
Getting close to ready :)
Sorry, something went wrong.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
@erlend-aasland could you merge it? (if you have time :-) |
Sorry, something went wrong.
|
FYI, most of the core devs are done for the holidays. You'll have to wait until after the new year probably. |
Sorry, something went wrong.
pganssle
left a comment
There was a problem hiding this comment.
I strongly suspect that this is going to break people who are testing against exact error messages, but that's really not part of our public API, so that is fine.
Sorry, something went wrong.
I only updated the messages, I fixed everything I found.
From these errors:
i made this one error:
and I made the same message template for the fields
year,month,day,hour,minute,second,microsecondandfoldbecause I decided that it was worth leaving the field that was received in the output and at the same time using one string instead of tuple.with the rest of the error messages it's easier, I just reduced them to one type