From 8b818f92c6a6a3c04c2343716f0806d73b207497 Mon Sep 17 00:00:00 2001 From: Damien Ayers Date: Wed, 10 Sep 2025 17:17:36 +1000 Subject: [PATCH] Fix TypeError in ext.coverage logging If there are any missing modules when using the coverage builder, a TypeError is thrown instead of a warning message being printed. The warning message needs a %s in the message to match the list of missing modules provided as a string. --- CHANGES.rst | 2 ++ sphinx/ext/coverage.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 64f94e14ec3..fee14bfb19d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -118,6 +118,8 @@ Bugs fixed for objects documented as ``:py:data:`` to be hyperlinked in function signatures. * #13858: doctest: doctest blocks are now correctly added to a group defined by the configuration variable ``doctest_test_doctest_blocks``. +* #13885: Coverage builder: Fix TypeError when warning about missing modules. + Patch by Damien Ayers. Testing diff --git a/sphinx/ext/coverage.py b/sphinx/ext/coverage.py index 5c5a8d51ab3..cd83bcbaec1 100644 --- a/sphinx/ext/coverage.py +++ b/sphinx/ext/coverage.py @@ -156,7 +156,7 @@ def _determine_py_coverage_modules( logger.warning( __( 'the following modules are specified in coverage_modules ' - 'but were not documented' + 'but were not documented: %s' ), ', '.join(missing_modules), )