Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_next("* * 31 2 *") will raise ValueError after a long time. #34

Closed
binzeehale opened this issue Oct 15, 2014 · 1 comment
Closed

Comments

@binzeehale
Copy link

croniter will not raise erorr , but it will be error when i call get_next.
The most important: this crontab string will cause a long loop before the error happened.

@josegonzalez
Copy link
Contributor

josegonzalez commented Jul 27, 2016

Interestingly, on the latest master, this returns an exception about failing to find the previous date...

$ python src/croniter/tests/test_croniter.py
............................E.
======================================================================
ERROR: test_bug34 (__main__.CroniterTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "src/croniter/tests/test_croniter.py", line 394, in test_bug34
    n1 = itr.get_next(datetime)
  File "/Users/jose/Apps/seatgeek/oss/croniter/src/croniter/croniter.py", line 142, in get_next
    return self._get_next(ret_type or self._ret_type, is_prev=False)
  File "/Users/jose/Apps/seatgeek/oss/croniter/src/croniter/croniter.py", line 228, in _get_next
    result = self._calc(self.cur, expanded, is_prev)
  File "/Users/jose/Apps/seatgeek/oss/croniter/src/croniter/croniter.py", line 366, in _calc
    raise Exception("failed to find prev date")
Exception: failed to find prev date

----------------------------------------------------------------------
Ran 30 tests in 0.037s

FAILED (errors=1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants