| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Standard cron syntax allows weekday values 0–7, where both 0 and 7 mean Sunday (documented in crontab(5) and implemented by vixie-cron, cronie, fcron, and most Unix cron daemons). The validator was enforcing a max of 6, rejecting valid expressions like `* * * * 7`, `0 0 * * 0-7`, and `0 0 * * 0,7`. Change the weekday upper bound from 6 to 7 and add three test cases that were previously (incorrectly) rejected.
There was a problem hiding this comment.
This is correct per the Vixie-cron convention where day-of-week accepts 0–7 with both 0 and 7 meaning Sunday. I tested the branch: * * * * 7, 0-7 and 0,7 are accepted, while 8 and the reversed 7-0 are still rejected — all as expected.
One coordination note: this touches cron.py, which my open PR #482 also modifies (it rewrites _validate_cron_component to support stepped ranges like 1-5/2). The two are compatible — my range check accepts end == max_val, so 0-7 still validates once max is 7 — but they'll want a coordinated merge to avoid a conflict.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Bug
validators.cron() rejects valid cron expressions that use 7 for the day-of-week field. 7 is a well-documented alias for Sunday (the same as 0), supported by all major cron implementations (vixie-cron, cronie, fcron, and crontab(5)).
Root cause
In src/validators/cron.py, the weekdays component is validated with max_val=6:
Fix
Change the upper bound from 6 to 7. DOW 8 continues to be rejected (the existing test for '0 12 * * 8' still passes).
Tests
Three new cases added to test_returns_true_on_valid_cron:
All 29 cron tests pass; the 17 pre-existing ETH address failures are unrelated.