parsedatetime
parsedatetime copied to clipboard
Bug: If *parse()* not found date returns now datetime
subj,
For example:
this code works only with Python 3. Python2 returns datetime.datetime.now()
if sys.version_info >= (3, 0):
target = datetime.datetime(2006, 9, 25, 23, 5).timetuple()
self.assertExpectedResult(self.cal.parse('25 сентября 2006 23:05'), (target, 3))
I want, if parse not found date returns None value
Needed for v2 - see Issue #121
I agree. It's important to return None instead of now, otherwise there is no way to check for errors. It also makes it way too easy to introduce bugs.
Just because several people have commented requesting the wrong thing, I feel morally obligated to say explicitly: don't return None. Do raise an exception. See http://stackoverflow.com/a/1313837/1464495 and http://programmers.stackexchange.com/a/220647/203750 if unsure. Thanks.
Will this be fixed on day ? This library is useless because of this !