agronholm / agronholm/apscheduler

CronTrigger runs into infinite loop at daylight savings time boundary

Aperta
#1,021 13 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Python
Stelle
7.6k
Fork
783
Merge medio
4g 8h
PR unite (30g)
5

Descrizione

### Things to check first

- [x] I have checked that my issue does not already have a solution in the [FAQ](https://apscheduler.readthedocs.io/en/master/faq.html)

- [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

3.11.0

### What happened?

Similar bug as https://github.com/agronholm/apscheduler/issues/980 which was fixed on master, this is on v3.11. I [commented](https://github.com/agronholm/apscheduler/issues/980#issuecomment-2499977654) this in that issue, but am now creating a separate issue since that issue was closed.

### How can we reproduce the bug?

```
from zoneinfo import ZoneInfo
from datetime import datetime

from apscheduler.triggers.cron import CronTrigger

tz = ZoneInfo("Europe/Helsinki")
trigger = CronTrigger(minute=30, timezone=tz)
dt = datetime(2017, 10, 29, 3, 45, tzinfo=tz, fold=1)

dt = trigger.get_next_fire_time(dt, dt)
# dt = datetime.datetime(2017, 10, 29, 3, 30, fold=1, tzinfo=zoneinfo.ZoneInfo(key='Europe/Helsinki'))

dt = trigger.get_next_fire_time(dt, dt)
# dt = datetime.datetime(2017, 10, 29, 3, 30, fold=1, tzinfo=zoneinfo.ZoneInfo(key='Europe/Helsinki'))
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.