Skip to content

fix: accept day-of-week 7 (Sunday) in the seconds and year cron forms - #263

Open
nikolauspschuetz wants to merge 1 commit into
pallets-eco:mainfrom
nikolauspschuetz:fix-dow7-second-year-forms
Open

fix: accept day-of-week 7 (Sunday) in the seconds and year cron forms#263
nikolauspschuetz wants to merge 1 commit into
pallets-eco:mainfrom
nikolauspschuetz:fix-dow7-second-year-forms

Conversation

@nikolauspschuetz

Copy link
Copy Markdown

7 is a standard alias for Sunday (0), and croniter accepts it in the classic 5-field form. value_alias skipped the 7 -> 0 conversion in the 6-field (seconds) and 7-field (year) forms, so 7 was rejected there as out of range:

>>> croniter.is_valid("0 0 * * 7")      # 5-field
True
>>> croniter.is_valid("0 0 * * 7 0")    # 6-field
False
>>> croniter.is_valid("0 0 * * 7 0 *")  # 7-field
False

The guard is there to keep rejecting 0 as a day/month in those forms; day-of-week was swept into it. Dropping day-of-week from the two branches makes 7 -> Sunday work in every form while leaving the month/day 0 rejection unchanged. Regression test added; full suite green.

@nikolauspschuetz
nikolauspschuetz force-pushed the fix-dow7-second-year-forms branch from f4e895c to ee823d6 Compare August 16, 2026 16:11
@nikolauspschuetz
nikolauspschuetz marked this pull request as ready for review August 23, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant