* [PATCH 1/1] doc: replace docutils.utils.error_reporting
@ 2026-01-01 14:28 Heinrich Schuchardt
2026-01-01 14:38 ` J. Neuschäfer
0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2026-01-01 14:28 UTC (permalink / raw)
To: Tom Rini; +Cc: u-boot, Heinrich Schuchardt
Docutils has dropped reprunicode(), ErrorString() and SafeString() in newer
revisions. This stops us from using a current docutils, e.g. 0.22.4.
Use the same definition of ErrorString() as Linux v6.18.
Drop reprunicode() conversion.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
doc/sphinx/kernel_abi.py | 4 +++-
doc/sphinx/kernel_feat.py | 4 +++-
doc/sphinx/kernel_include.py | 8 ++++----
doc/sphinx/maintainers_include.py | 4 +++-
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/doc/sphinx/kernel_abi.py b/doc/sphinx/kernel_abi.py
index 32c50e496b5..9a33eb35f46 100644
--- a/doc/sphinx/kernel_abi.py
+++ b/doc/sphinx/kernel_abi.py
@@ -44,7 +44,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):
+ return f'{exc.__class__.__name}: {exc}'
#
# AutodocReporter is only good up to Sphinx 1.7
diff --git a/doc/sphinx/kernel_feat.py b/doc/sphinx/kernel_feat.py
index 2fee04f1ded..2c47513f7ec 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):
+ return f'{exc.__class__.__name}: {exc}'
#
# AutodocReporter is only good up to Sphinx 1.7
diff --git a/doc/sphinx/kernel_include.py b/doc/sphinx/kernel_include.py
index f523aa68a36..10ff8e60a91 100755
--- a/doc/sphinx/kernel_include.py
+++ b/doc/sphinx/kernel_include.py
@@ -34,11 +34,13 @@ u"""
import os.path
from docutils import io, nodes, statemachine
-from docutils.utils.error_reporting import SafeString, ErrorString
from docutils.parsers.rst import directives
from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
from docutils.parsers.rst.directives.misc import Include
+def ErrorString(exc):
+ return f'{exc.__class__.__name}: {exc}'
+
__version__ = '1.0'
# ==============================================================================
@@ -94,7 +96,6 @@ class KernelInclude(Include):
# HINT: this is the only line I had to change / commented out:
#path = utils.relative_path(None, path)
- path = nodes.reprunicode(path)
encoding = self.options.get(
'encoding', self.state.document.settings.input_encoding)
e_handler=self.state.document.settings.input_encoding_error_handler
@@ -108,8 +109,7 @@ class KernelInclude(Include):
except UnicodeEncodeError as error:
raise self.severe('Problems with "%s" directive path:\n'
'Cannot encode input file path "%s" '
- '(wrong locale?).' %
- (self.name, SafeString(path)))
+ '(wrong locale?).' % (self.name, path))
except IOError as error:
raise self.severe('Problems with "%s" directive path:\n%s.' %
(self.name, ErrorString(error)))
diff --git a/doc/sphinx/maintainers_include.py b/doc/sphinx/maintainers_include.py
index 13557d3d3c2..38c974ae4f9 100755
--- a/doc/sphinx/maintainers_include.py
+++ b/doc/sphinx/maintainers_include.py
@@ -22,10 +22,12 @@ import re
import os.path
from docutils import statemachine
-from docutils.utils.error_reporting import ErrorString
from docutils.parsers.rst import Directive
from docutils.parsers.rst.directives.misc import Include
+def ErrorString(exc):
+ return f'{exc.__class__.__name}: {exc}'
+
__version__ = '1.0'
def setup(app):
--
2.51.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH 1/1] doc: replace docutils.utils.error_reporting
2026-01-01 14:28 [PATCH 1/1] doc: replace docutils.utils.error_reporting Heinrich Schuchardt
@ 2026-01-01 14:38 ` J. Neuschäfer
0 siblings, 0 replies; 2+ messages in thread
From: J. Neuschäfer @ 2026-01-01 14:38 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: Tom Rini, u-boot
On Thu, Jan 01, 2026 at 03:28:53PM +0100, Heinrich Schuchardt wrote:
> Docutils has dropped reprunicode(), ErrorString() and SafeString() in newer
> revisions. This stops us from using a current docutils, e.g. 0.22.4.
>
> Use the same definition of ErrorString() as Linux v6.18.
> Drop reprunicode() conversion.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
I didn't see this patch and sent an equivalent one at the same time.
This one works too.
Tested-by: J. Neuschäfer <j.ne@posteo.net>
Thanks!
> doc/sphinx/kernel_abi.py | 4 +++-
> doc/sphinx/kernel_feat.py | 4 +++-
> doc/sphinx/kernel_include.py | 8 ++++----
> doc/sphinx/maintainers_include.py | 4 +++-
> 4 files changed, 13 insertions(+), 7 deletions(-)
[...]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-01 14:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-01 14:28 [PATCH 1/1] doc: replace docutils.utils.error_reporting Heinrich Schuchardt
2026-01-01 14:38 ` J. Neuschäfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox