Open rqvolkov opened 4 years ago
Same error here. Easily reproducible . Try with foo= "139/29 BP "
and fails.
Same error here. Easily reproducible. Try with Sept. 13, 1947
Would adding TypeError
as an exception in line 103 be a quick fix?
Same here. Not fixed yet
Hi
I started to use with great pleasure datefinder. In many case it's working nicely but sometimes it fails. In 131 cases over 5,018, it failed. In the attached .txt file (please rename it to .ipynb to make it work with Jupyter and run it).
It fails namely with the 1st, the 3d and 4th ones. Only the 2nd one is OK and should be the only one to be parsed and retrieved (datetime.datetime(500, 2, 25, 0, 0), '2,500') (datetime.datetime(2011, 5, 2, 0, 0), '05/02/2011') (datetime.datetime(1975, 2, 25, 0, 0), 'of 75') (datetime.datetime(2021, 5, 25, 0, 0), 'may')
I am not sure but maybe a variable should be reset or something else.
In the end I get a pretty long error message.
As a workaround, you can monkeypatch the DateFinder class.
import datefinder
class DateFinder(datefinder.DateFinder):
def parse_date_string(self, date_string, captures):
try:
return super().parse_date_string(date_string, captures)
except TypeError:
return
datefinder.DateFinder = DateFinder
python3.7, steps to reproduce: