I am using python-dateutil for parsing a date from a string:
import dateutil.parser
print dateutil.parser.parse('some null string', fuzzy=True).date()
2012-10-18
print dateutil.parser.parse('some 31 Oct 2012 string', fuzzy=True).date()
2012-10-31
What I am expecting is for dateutil.parser.parse('some null string', fuzzy=True).date()
to throw an exception, but it's returning the current date. Can someone show me how I can avoid getting the current date, if no date is found in the provided string?
Thanks in advance.
fuzzy
, you'll never get an exception... – Keystone