"Das U-Boot" Source Tree
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: kdoc: handle the obsolescensce of docutils.ErrorString()

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 <zhixu.liu@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Upstream: https://git.kernel.org/linus/00d95fcc4dee66dfb6980de6f2973b32f973a1eb
[j.ne: Adapted from Linux to U-Boot]
Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

authored by

J. Neuschäfer and committed by
Heinrich Schuchardt
b9d88490 ba8ca796

+13 -5
+3 -1
doc/sphinx/kernel_abi.py
··· 44 44 from docutils import nodes, statemachine 45 45 from docutils.statemachine import ViewList 46 46 from docutils.parsers.rst import directives, Directive 47 - from docutils.utils.error_reporting import ErrorString 47 + 48 + def ErrorString(exc): # Shamelessly stolen from docutils 49 + return f'{exc.__class__.__name}: {exc}' 48 50 49 51 # 50 52 # AutodocReporter is only good up to Sphinx 1.7
+3 -1
doc/sphinx/kernel_feat.py
··· 41 41 from docutils import nodes, statemachine 42 42 from docutils.statemachine import ViewList 43 43 from docutils.parsers.rst import directives, Directive 44 - from docutils.utils.error_reporting import ErrorString 44 + 45 + def ErrorString(exc): # Shamelessly stolen from docutils 46 + return f'{exc.__class__.__name}: {exc}' 45 47 46 48 # 47 49 # AutodocReporter is only good up to Sphinx 1.7
+4 -2
doc/sphinx/kernel_include.py
··· 34 34 import os.path 35 35 36 36 from docutils import io, nodes, statemachine 37 - from docutils.utils.error_reporting import SafeString, ErrorString 38 37 from docutils.parsers.rst import directives 39 38 from docutils.parsers.rst.directives.body import CodeBlock, NumberLines 40 39 from docutils.parsers.rst.directives.misc import Include 40 + 41 + def ErrorString(exc): # Shamelessly stolen from docutils 42 + return f'{exc.__class__.__name}: {exc}' 41 43 42 44 __version__ = '1.0' 43 45 ··· 109 111 raise self.severe('Problems with "%s" directive path:\n' 110 112 'Cannot encode input file path "%s" ' 111 113 '(wrong locale?).' % 112 - (self.name, SafeString(path))) 114 + (self.name, path)) 113 115 except IOError as error: 114 116 raise self.severe('Problems with "%s" directive path:\n%s.' % 115 117 (self.name, ErrorString(error)))
+3 -1
doc/sphinx/maintainers_include.py
··· 22 22 import os.path 23 23 24 24 from docutils import statemachine 25 - from docutils.utils.error_reporting import ErrorString 26 25 from docutils.parsers.rst import Directive 27 26 from docutils.parsers.rst.directives.misc import Include 27 + 28 + def ErrorString(exc): # Shamelessly stolen from docutils 29 + return f'{exc.__class__.__name}: {exc}' 28 30 29 31 __version__ = '1.0' 30 32