[X] I have checked that my issue does not already have a solution in the FAQ
[X] I have searched the existing issues and didn't find my bug already reported there
[X] I have checked that my bug is still present in the latest release
Version
4.0.0a4
What happened?
Time with UTC timezone will be always not equal to other time.
from datetime import time
from zoneinfo import ZoneInfo
utctime = time(0, 0, tzinfo=ZoneInfo('UTC'))
a = time(0, 0)
b = time(0, 0, tzinfo=ZoneInfo("Asia/Shanghai"))
c = time(0, 0, tzinfo=ZoneInfo("Asia/Tokyo"))
print(a == utctime) # False
print(a == b == c) # True
Things to check first
[X] I have checked that my issue does not already have a solution in the FAQ
[X] I have searched the existing issues and didn't find my bug already reported there
[X] I have checked that my bug is still present in the latest release
Version
4.0.0a4
What happened?
Time with UTC timezone will be always not equal to other time.
So the condition here will always be
False
https://github.com/agronholm/apscheduler/blob/3e42a1bd73da947634ea94724e5221a43ad7ce0c/src/apscheduler/triggers/calendarinterval.py#L121
It should be call
.timetz()
to get the time part.How can we reproduce the bug?