mirror of
https://github.com/mvt-project/mvt.git
synced 2026-10-10 01:43:59 +02:00
dumpsys prints the settings change history without a year, so
_resolve_timestamp() parsed the value with strptime("%m-%d ...") and only
then replaced the year. strptime() parses a value without a year in 1900,
which has no 29 February, so every change made on a leap day raised
ValueError and lost its timestamp, dropping it from the timeline and from
the alert of a dangerous setting.
Parse the value together with a year instead, starting from the year the
section was dumped and going back until the date exists and is not later
than the dump. Eight years always reach a leap year.
This also removes the DeprecationWarning Python 3.13 raises for parsing a
day of month without a year (python/cpython#70647).