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

Possible OverflowError from dateutil is ignored. #100

Open
Dunes opened this issue Feb 1, 2019 · 3 comments
Open

Possible OverflowError from dateutil is ignored. #100

Dunes opened this issue Feb 1, 2019 · 3 comments

Comments

@Dunes
Copy link

Dunes commented Feb 1, 2019

See https://stackoverflow.com/questions/54465029/overflowerror-when-trying-to-convert-generators-to-lists/54478879#54478879

Steps to reproduce:

>>> list(datefinder.find_dates("2019/02/01 is a date and 466990103060049 is not"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/datefinder/__init__.py", line 31, in find_dates
    as_dt = self.parse_date_string(date_string, captures)
  File "/usr/local/lib/python3.5/dist-packages/datefinder/__init__.py", line 101, in parse_date_string
    as_dt = parser.parse(date_string, default=self.base_date)
  File "/usr/local/lib/python3.5/dist-packages/dateutil/parser.py", line 1182, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/dateutil/parser.py", line 578, in parse
    if cday > monthrange(cyear, cmonth)[1]:
  File "/usr/lib/python3.5/calendar.py", line 121, in monthrange
    day1 = weekday(year, month, 1)
  File "/usr/lib/python3.5/calendar.py", line 113, in weekday
    return datetime.date(year, month, day).weekday()
OverflowError: signed integer is greater than maximum

Expected result:

[datetime.datetime(2019, 2, 1, 0, 0)]

It should be noted that dateutil.parser.parse is documented as throwing this error, and so this is something datefinder should be expected to handle.

@danielsnider
Copy link

Same problem for me.

1 similar comment
@diannamcallister
Copy link
Contributor

Same problem for me.

@danielsnider
Copy link

danielsnider commented May 28, 2019 via email

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