agronholm / agronholm/apscheduler

CronTrigger runs into infinite loop at daylight savings time boundary

Abierto
#1,021 13 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
7.6k
Forks
783
Merge medio
4 d 8 h
PR fusionados (30 d)
5

Descripción

### 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'))
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.