From 47b6d41357fe3a6a4e7b3509f55d41e624977b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Sat, 7 Feb 2026 12:09:51 +0100 Subject: [PATCH 1/2] fix: pin a minimal dateparser version to prevent warnings A bunch of warning such as this one are fired during the handling of Wiktionary dumps: https://github.com/scrapinghub/dateparser/issues/1246 Moving to the [v1.3.0](https://github.com/scrapinghub/dateparser/releases/tag/v1.3.0) fixes them. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index abaf696a..9d4648b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ classifiers = [ ] requires-python = ">=3.10" dependencies = [ - "dateparser", + "dateparser>=1.3.0", "lupa", "lxml", "mediawiki_langcodes", From 4a02bf203afb13da71dd5a3caad108f1b5fd544f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Sat, 7 Feb 2026 12:14:40 +0100 Subject: [PATCH 2/2] fix: ruff --- src/wikitextprocessor/parserfns.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/wikitextprocessor/parserfns.py b/src/wikitextprocessor/parserfns.py index eb759c38..96b5349b 100644 --- a/src/wikitextprocessor/parserfns.py +++ b/src/wikitextprocessor/parserfns.py @@ -1108,9 +1108,11 @@ def month_num_days(ctx: "Wtp", t: datetime) -> int: ] = { "Y": "%Y", "y": "%y", - "L": lambda ctx, t: 1 - if (t.year % 4 == 0 and (t.year % 100 != 0 or t.year % 400 == 0)) - else 0, + "L": lambda ctx, t: ( + 1 + if (t.year % 4 == 0 and (t.year % 100 != 0 or t.year % 400 == 0)) + else 0 + ), "o": "%G", "n": lambda ctx, t: t.month, "m": "%m", @@ -1120,8 +1122,8 @@ def month_num_days(ctx: "Wtp", t: datetime) -> int: "j": lambda ctx, t: t.day, "d": "%d", "z": lambda ctx, t: ( - t - datetime(year=t.year, month=1, day=1, tzinfo=t.tzinfo) - ).days, + (t - datetime(year=t.year, month=1, day=1, tzinfo=t.tzinfo)).days + ), "W": "%V", "N": "%u", "w": "%w",