* [PATCH] docs: extensions: don't use deprecated ErrorString, SafeString
@ 2025-09-25 9:45 Daniel Garcia Moreno
2025-09-25 16:33 ` Jonathan Corbet
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Garcia Moreno @ 2025-09-25 9:45 UTC (permalink / raw)
To: linux-doc; +Cc: 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
https://sourceforge.net/p/docutils/code/HEAD/tree/tags/docutils-0.21.2/docutils/utils/error_reporting.py
Signed-off-by: Daniel Garcia Moreno <daniel.garcia@suse.com>
---
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(-)
diff --git a/Documentation/sphinx/kernel_feat.py b/Documentation/sphinx/kernel_feat.py
index e3a51867f27b..82600e045fe6 100644
--- a/Documentation/sphinx/kernel_feat.py
+++ b/Documentation/sphinx/kernel_feat.py
@@ -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'
diff --git a/Documentation/sphinx/kernel_include.py b/Documentation/sphinx/kernel_include.py
index 1e566e87ebcd..42945b1779eb 100755
--- a/Documentation/sphinx/kernel_include.py
+++ b/Documentation/sphinx/kernel_include.py
@@ -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)
diff --git a/Documentation/sphinx/maintainers_include.py b/Documentation/sphinx/maintainers_include.py
index d31cff867436..9414bdf7bfc0 100755
--- a/Documentation/sphinx/maintainers_include.py
+++ b/Documentation/sphinx/maintainers_include.py
@@ -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 []
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: extensions: don't use deprecated ErrorString, SafeString
2025-09-25 9:45 [PATCH] docs: extensions: don't use deprecated ErrorString, SafeString Daniel Garcia Moreno
@ 2025-09-25 16:33 ` Jonathan Corbet
2025-09-26 5:55 ` daniel.garcia
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Corbet @ 2025-09-25 16:33 UTC (permalink / raw)
To: Daniel Garcia Moreno, linux-doc; +Cc: Daniel Garcia Moreno
Daniel Garcia Moreno <daniel.garcia@suse.com> writes:
> 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
>
> https://sourceforge.net/p/docutils/code/HEAD/tree/tags/docutils-0.21.2/docutils/utils/error_reporting.py
>
> Signed-off-by: Daniel Garcia Moreno <daniel.garcia@suse.com>
> ---
> 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/87ldmnv2pi.fsf@trenco.lwn.net/
Thanks,
jon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: extensions: don't use deprecated ErrorString, SafeString
2025-09-25 16:33 ` Jonathan Corbet
@ 2025-09-26 5:55 ` daniel.garcia
2025-09-26 6:16 ` Jonathan Corbet
0 siblings, 1 reply; 4+ messages in thread
From: daniel.garcia @ 2025-09-26 5:55 UTC (permalink / raw)
To: Jonathan Corbet, linux-doc
On jue, 2025-09-25 at 10:33 -0600, Jonathan Corbet wrote:
> Daniel Garcia Moreno <daniel.garcia@suse.com> writes:
>
> > 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
> >
> > https://sourceforge.net/p/docutils/code/HEAD/tree/tags/docutils-0.21.2/docutils/utils/error_reporting.py
> >
> > Signed-off-by: Daniel Garcia Moreno <daniel.garcia@suse.com>
> > ---
> > 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/87ldmnv2pi.fsf@trenco.lwn.net/
>
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] docs: extensions: don't use deprecated ErrorString, SafeString
2025-09-26 5:55 ` daniel.garcia
@ 2025-09-26 6:16 ` Jonathan Corbet
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Corbet @ 2025-09-26 6:16 UTC (permalink / raw)
To: daniel.garcia, linux-doc
daniel.garcia@suse.com 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-09-26 6:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-25 9:45 [PATCH] docs: extensions: don't use deprecated ErrorString, SafeString Daniel Garcia Moreno
2025-09-25 16:33 ` Jonathan Corbet
2025-09-26 5:55 ` daniel.garcia
2025-09-26 6:16 ` Jonathan Corbet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).