dateparser
dateparser copied to clipboard
DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
dateparser 1.2.0 on Python 3.13 / Linux:
$ python3 -q -Wall
>>> from dateparser import parse
>>> parse("2024-11-27")
.../lib/python3.13/site-packages/dateparser/utils/strptime.py:94: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
obj = datetime(*__strptime(date_string, format)[:-3])
.../lib/python3.13/site-packages/dateparser/utils/strptime.py:94: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
obj = datetime(*__strptime(date_string, format)[:-3])
datetime.datetime(2024, 11, 27, 0, 0)
I came here looking for a solution to this, but it still hasn't been merged unfortunately.
Can anyone check that https://github.com/scrapinghub/dateparser/pull/1288 works for you?