From 65620beb078ab101f4a49732c7b623f975a16ca5 Mon Sep 17 00:00:00 2001 From: Manoel Brunnen Date: Fri, 15 Aug 2025 10:43:15 +0200 Subject: [PATCH] fix log_warning call with missing arguments Fixed TypeError in warnings.py where log_warning was called with only 2 arguments instead of the required 4 positional arguments (logger, message, subtype, location). This was causing crashes when processing invalid warning filters in Sphinx 8.x. The fix ensures compatibility with the updated log_warning function signature introduced for Sphinx 8.x compatibility. --- sphinx_needs/warnings.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sphinx_needs/warnings.py b/sphinx_needs/warnings.py index f7ea2910a..86af459d0 100644 --- a/sphinx_needs/warnings.py +++ b/sphinx_needs/warnings.py @@ -77,7 +77,13 @@ def process_warnings(app: Sphinx, exception: Exception | None) -> None: if warning_filter(need, logger): result.append(need) else: - log_warning(logger, f"Unknown needs warnings filter {warning_filter}!") + result = [] + log_warning( + logger, + f"Unknown needs warnings filter {warning_filter}!", + "warnings", + None, + ) if len(result) == 0: logger.info(f"{warning_name}: passed")