From b9d88490bb819e83ed966b397dc1daff4e9765a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Thu, 1 Jan 2026 15:31:06 +0100 Subject: docs: kdoc: handle the obsolescensce of docutils.ErrorString() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ErrorString() and SafeString() docutils functions were helpers meant to ease the handling of encodings during the Python 3 transition. There is no real need for them after Python 3.6, and docutils 0.22 removes them, breaking the docs build Handle this by just injecting our own one-liner version of ErrorString(), and removing the sole SafeString() call entirely. Reported-by: Zhixu Liu Signed-off-by: Jonathan Corbet Upstream: https://git.kernel.org/linus/00d95fcc4dee66dfb6980de6f2973b32f973a1eb [j.ne: Adapted from Linux to U-Boot] Signed-off-by: J. Neuschäfer Reviewed-by: Heinrich Schuchardt --- doc/sphinx/kernel_feat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/sphinx/kernel_feat.py') diff --git a/doc/sphinx/kernel_feat.py b/doc/sphinx/kernel_feat.py index 2fee04f1ded..cca48f6f1a4 100644 --- a/doc/sphinx/kernel_feat.py +++ b/doc/sphinx/kernel_feat.py @@ -41,7 +41,9 @@ from os import path from docutils import nodes, statemachine from docutils.statemachine import ViewList from docutils.parsers.rst import directives, Directive -from docutils.utils.error_reporting import ErrorString + +def ErrorString(exc): # Shamelessly stolen from docutils + return f'{exc.__class__.__name}: {exc}' # # AutodocReporter is only good up to Sphinx 1.7 -- cgit v1.2.3