| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
_validate_cron_component checked for /, - and , in a fixed order, so a
stepped range like "1-5/2" (valid cron) was rejected, as was any
comma-list whose items used ranges or steps. Split each field on ","
first, then parse each item as an optional base ("*", a number or a
range) followed by an optional step.
| Back | FazBrowse Home | New Git URL |
cron() rejects a step applied to a range, e.g. 1-5/2, which is valid cron (every 2nd value from 1 to 5). It also rejects any comma-list whose items use a range or step, e.g. 15,45 6-18/3 * * *.
_validate_cron_component looked for /, - and , in a fixed order. For 1-5/2 it split on / first, so the base became "1-5", which is neither * nor a decimal, and the item was refused. A field like 6-18/3 never reached the range branch at all. The test file already noted this:
# "5-10/2 * * * *", # this is valid, but not supported yetThis splits each field on , first, then parses each item as an optional base (*, a number, or an n-m range) followed by an optional /step. Behaviour is unchanged for every currently-passing case: */61 (step wider than the range) still passes, */0 and reversed ranges like 30-20 still fail, and out-of-range list members like 0,6,12,24 in the hours field still fail.
Uncommented the noted 5-10/2 case and added 1-30/2 and 15,45 6-18/3 to the valid tests. The 3 new cases fail on master and pass here; the full test_cron.py passes (29).