Upgrade to release 1.5.1:
Security fixes:
- Prevent quadratic regex matching on long whitespace runs in the
Jalali calendar (GHSA-rq5p-ww4m-666c)
- Prevent quadratic parsing in search_dates() on a long run of
skipped words after a number (GHSA-c83m-fh72-x3jp)
- Prevent unbounded recursion and quadratic parsing in
search_dates() on many quantities written in words
(GHSA-8hqv-h88c-f367)
- Prevent quadratic time in search_dates() on a long text whose
words and Unicode-normalized words differ in number
(GHSA-wr9g-q4w6-fp42)
- Prevent quadratic parsing in parse() on a long run of separators
followed by skipped words (GHSA-5g92-f88x-gwj5)
New features:
- Support "less than a minute ago" in Russian, which was not parse
Fixes:
- search_dates() looks for the words of a quantity written in words
among at most 16 words, so a longer quantity can give a different
result
- search_dates() yields at most eight dates from a run of more than
eight quantities written in words, where it yielded all of them
before
- Keep a full stop that belongs to a date inside the date in
search_dates(), so "Sept. 5, 2020" is no longer split at the full
stop
- Use the reference date's year when a custom format has no year,
so PREFER_DAY_OF_MONTH="last" returns February 29 in a leap year
instead of February 28, and skip invalid leap days instead of
raising ValueError; with PREFER_DAY_OF_MONTH or
PREFER_MONTH_OF_YEAR set to "current", the day or month of
RELATIVE_BASE is used when it is set
- Leave out a time span that does not fit in the years 1 to 9999,
instead of raising ValueError in search_dates() with
RETURN_TIME_SPAN, so the other dates of the text are kept
- Treat digits that the regular expression module matches but int()
rejects as not a number, instead of raising ValueError in parse()
and search_dates()
- Do not raise KeyError for a month or weekday name in date_formats
that is spelled with a letter the regular expression module
equates with a letter of the name when ignoring case, such as the
long s for "s"; the date is read as that name
- Stop the Vietnamese year simplification from eating the month
name "năm", so a month name such as "Tháng năm" (May) followed by
a year parses
- Fix parsing time-only strings such as "3pm" when RELATIVE_BASE is
timezone-aware, which returned None
Cleanups and internal improvements:
- Stop a test from depending on the current year
- Move the pytest and coverage settings into pyproject.toml, which
requires pytest 9 or later for the tests
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>