docs: extensions: don't use deprecated ErrorString, SafeString
Subsystems (2)
PATCH 1/1 docs: extensions: don't use deprecated ErrorString, SafeString
This patch replaces the usage of deprecated docutils ErrorString and SafeString.
docutils.utils.error_reporting module was removed in the lastest release 0.22. In the previous release the usage of ErrorString and SafeString was deprecated and the recomendation is to replace the usage with:
Replacements:
| SafeString -> str
| ErrorString -> docutils.io.error_string()
| ErrorOutput -> docutils.io.ErrorOutput--- Documentation/sphinx/kernel_feat.py | 1 - Documentation/sphinx/kernel_include.py | 8 ++++---- Documentation/sphinx/maintainers_include.py | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-)
Documentation/sphinx/kernel_feat.py +0 -1
@@ -40,7 +40,6 @@ import sys from docutils import nodes, statemachine from docutils.statemachine import ViewList from docutils.parsers.rst import directives, Directive -from docutils.utils.error_reporting import ErrorString from sphinx.util.docutils import switch_source_input __version__ = '1.0'
Documentation/sphinx/kernel_include.py +4 -4
@@ -35,7 +35,7 @@ import os.path from docutils import io, nodes, statemachine -from docutils.utils.error_reporting import SafeString, ErrorString +from docutils.io import error_string from docutils.parsers.rst import directives from docutils.parsers.rst.directives.body import CodeBlock, NumberLines from docutils.parsers.rst.directives.misc import Include
@@ -112,10 +112,10 @@ class KernelInclude(Include): raise self.severe('Problems with "%s" directive path:\n' 'Cannot encode input file path "%s" ' '(wrong locale?).' % - (self.name, SafeString(path))) + (self.name, str(path))) except IOError as error: raise self.severe('Problems with "%s" directive path:\n%s.' % - (self.name, ErrorString(error))) + (self.name, error_string(error))) startline = self.options.get('start-line', None) endline = self.options.get('end-line', None) try:
@@ -126,7 +126,7 @@ class KernelInclude(Include): rawtext = include_file.read() except UnicodeError as error: raise self.severe('Problem with "%s" directive:\n%s' % - (self.name, ErrorString(error))) + (self.name, error_string(error))) # start-after/end-before: no restrictions on newlines in match-text, # and no restrictions on matching inside lines vs. line boundaries after_text = self.options.get('start-after', None)
Documentation/sphinx/maintainers_include.py +2 -2
@@ -22,7 +22,7 @@ import re import os.path from docutils import statemachine -from docutils.utils.error_reporting import ErrorString +from docutils.io import error_string from docutils.parsers.rst import Directive from docutils.parsers.rst.directives.misc import Include
@@ -190,6 +190,6 @@ class MaintainersInclude(Include): lines = self.parse_maintainers(path) except IOError as error: raise self.severe('Problems with "%s" directive path:\n%s.' % - (self.name, ErrorString(error))) + (self.name, error_string(error))) return []
Signature · 1 line
2.51.0
Jonathan Corbet
maintainerQuoted 12 lines · Daniel Garcia Moreno
This patch replaces the usage of deprecated docutils ErrorString and SafeString.
docutils.utils.error_reporting module was removed in the lastest release 0.22. In the previous release the usage of ErrorString and SafeString was deprecated and the recomendation is to replace the usage with:
Replacements: | SafeString -> str | ErrorString -> docutils.io.error_string() | ErrorOutput -> docutils.io.ErrorOutput
Quoted 8 lines
Signed-off-by Daniel Garcia Moreno <[email protected]>--- Documentation/sphinx/kernel_feat.py | 1 - Documentation/sphinx/kernel_include.py | 8 ++++---- Documentation/sphinx/maintainers_include.py | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-)
A couple of things that are good to do when sending kernel patches:
- Check linux-next first
- CC the maintainer
This one has already been dealt with:
https://lore.kernel.org/all/[email protected]/
Thanks,
jon
Quoted 24 lines · Jonathan Corbet
Quoted 13 lines · Daniel Garcia Moreno
This patch replaces the usage of deprecated docutils ErrorString and SafeString.
docutils.utils.error_reporting module was removed in the lastest release
0.22. In the previous release the usage of ErrorString and SafeString was deprecated and the recomendation is to replace the usage with:Replacements:
| SafeString -> str | ErrorString -> docutils.io.error_string() | ErrorOutput -> docutils.io.ErrorOutputQuoted 8 lines
Signed-off-by Daniel Garcia Moreno <[email protected]>---
Documentation/sphinx/kernel_feat.py | 1 - Documentation/sphinx/kernel_include.py | 8 ++++----Documentation/sphinx/maintainers_include.py| 4 ++--3 files changed, 6 insertions(+), 7 deletions(-)
Quoted 9 lines
A couple of things that are good to do when sending kernel patches:
- Check linux-next first
- CC the maintainerThis one has already been dealt with:
Okay, sorry for the noise. I looked for this patch in the mailing list archive but looks like I didn't look too far.
And of course, I should have checked the linux-next repo. I will check more carefully next time to do not spent time trying to solve something already fixed.
Regards.
Jonathan Corbet
maintainerQuoted 6 lines · [email protected] writes:
Okay, sorry for the noise. I looked for this patch in the mailing list archive but looks like I didn't look too far.
And of course, I should have checked the linux-next repo. I will check more carefully next time to do not spent time trying to solve something already fixed.
No worries - thanks for working to make our documentation better!
jon