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
Dates equality check fails when a date is folded and the other is not #115845
In the example I have two dates in the Europe/Rome format, representing 2:00 AM on a day with DST change. One of the dates is folded, the other is not.
The two dates are different, as the isoformat() print shows, and they represent a different moment in time (one is 00:00 UTC, the other one is 01:00 UTC). However, the assert fails:
Not folded date: 2023-10-29T02:00:00+02:00
The folded date: 2023-10-29T02:00:00+01:00
Traceback (most recent call last):
File "/Users/alerinaldi/prova.py", line 10, in <module>
assert folded != not_folded
^^^^^^^^^^^^^^^^^^^^
AssertionError
Of course, this also applies to other situations where dates are compared: I discovered the issue while memoizing the result of a function based on dates using a dict.
Yeah totally. #116035 has been opened after this one but it's far more complete and professionally reported. It also links this issue so it's still referenced if someone needs context.
Activity
TooPercentMilk commentedon Apr 3, 2024
I'm a beginner contributor and would like to work on this issue. How should I go about this?
erlend-aasland commentedon Apr 3, 2024
Please see the discussion in #116035. Perhaps we should close this as a duplicate.
ale-rinaldi commentedon Apr 8, 2024
Yeah totally. #116035 has been opened after this one but it's far more complete and professionally reported. It also links this issue so it's still referenced if someone needs context.
I close this one.