We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It looks like
timefhuman/timefhuman/categorize.py
Line 119 in e3bace6
is crashing if monday is 4 days away from the 31st day of the month.
monday
[ins] In [3]: import timefhuman [ins] In [4]: timefhuman.timefhuman('october 27th') --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-4-ed924c5d5f0d> in <module> ----> 1 timefhuman.timefhuman('october 27th') ~/.local/lib/python3.8/site-packages/timefhuman/main.py in timefhuman(string, now, raw) 56 now = datetime.datetime.now() 57 ---> 58 tokens = timefhuman_tokens(string, now) 59 60 if raw: ~/.local/lib/python3.8/site-packages/timefhuman/main.py in timefhuman_tokens(string, now) 73 """Convert string into timefhuman parsed, imputed, combined tokens""" 74 tokens = tokenize(string) ---> 75 tokens = categorize(tokens, now) 76 tokens = build_tree(tokens, now) 77 return tokens ~/.local/lib/python3.8/site-packages/timefhuman/categorize.py in categorize(tokens, now) 30 tokens = convert_words_to_numbers(tokens) 31 tokens = convert_day_of_week(tokens, now) ---> 32 tokens = convert_relative_days_ranges(tokens, now) 33 tokens = convert_time_of_day(tokens) 34 tokens = maybe_substitute_hour_minute(tokens) ~/.local/lib/python3.8/site-packages/timefhuman/categorize.py in convert_relative_days_ranges(tokens, now) 117 (("yesterday",), DayToken.from_datetime(now - datetime.timedelta(1))), 118 (("weekend",), DayRange(saturday, saturday + 1)), --> 119 (("weekdays",), DayRange(monday, monday + 4))): 120 for keyword in keywords: 121 tokens = [replacement if token == keyword else token \ ~/.local/lib/python3.8/site-packages/timefhuman/data.py in __add__(self, other) 179 """ 180 assert isinstance(other, int) --> 181 return DayToken(self.month, self.day + other, self.year) 182 183 def __radd__(self, other): ~/.local/lib/python3.8/site-packages/timefhuman/data.py in __init__(self, month, day, year) 135 136 assert month is None or 1 <= month <= 12 --> 137 assert day is None or 1 <= day <= 31 138 139 def combine(self, time): AssertionError: [ins] In [5]: %debug > /home/dominik/.local/lib/python3.8/site-packages/timefhuman/data.py(137)__init__() 135 136 assert month is None or 1 <= month <= 12 --> 137 assert day is None or 1 <= day <= 31 138 139 def combine(self, time): ipdb> day 34 ipdb> up > /home/dominik/.local/lib/python3.8/site-packages/timefhuman/data.py(181)__add__() 179 """ 180 assert isinstance(other, int) --> 181 return DayToken(self.month, self.day + other, self.year) 182 183 def __radd__(self, other): ipdb> self.day 30 ipdb> other 4 ipdb> l 176 >>> d1 = DayToken(3, 2, None) 177 >>> d1 + 3 178 3/5 179 """ 180 assert isinstance(other, int) --> 181 return DayToken(self.month, self.day + other, self.year) 182 183 def __radd__(self, other): 184 """ 185 >>> d1 = DayToken(3, 2, None) 186 >>> 3 + d1 ipdb> up > /home/dominik/.local/lib/python3.8/site-packages/timefhuman/categorize.py(119)convert_relative_days_ranges() 117 (("yesterday",), DayToken.from_datetime(now - datetime.timedelta(1))), 118 (("weekend",), DayRange(saturday, saturday + 1)), --> 119 (("weekdays",), DayRange(monday, monday + 4))): 120 for keyword in keywords: 121 tokens = [replacement if token == keyword else token \ ipdb> monday 3/30/2020 ipdb> monday + 4 *** AssertionError ipdb> monday + 1 3/31/2020 ipdb> monday + 2 *** AssertionError
Originally posted by @StanczakDominik in #17 (comment)
The text was updated successfully, but these errors were encountered:
I'd also suggest a cron job test on Travis to find these issues :D
Sorry, something went wrong.
Oh wow oops thanks @StanczakDominik One test should probably just run timefhuman on every day of some particular month.
A monthly cron job may not be a bad idea...
No branches or pull requests
It looks like
timefhuman/timefhuman/categorize.py
Line 119 in e3bace6
is crashing if
monday
is 4 days away from the 31st day of the month.Ipython debug log
Originally posted by @StanczakDominik in #17 (comment)
The text was updated successfully, but these errors were encountered: