docs: Fix Sphinx 8 warning caused by paths represented with strings
Subsystems (2)
PATCH 1/1 docs: Fix Sphinx 8 warning caused by paths represented with strings
Running "make htmldocs" generates several lines of this warning:
Documentation/sphinx/kerneldoc.py:141: RemovedInSphinx80Warning: Sphinx 8 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
doc = (env.srcdir + "/" + env.docname + ":" + str(self.lineno))
Making "doc" an fspath type and creating a new variable with the appended colon and lineno fixes this warning.
--- Documentation/sphinx/kerneldoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/sphinx/kerneldoc.py +2 -1
@@ -138,7 +138,8 @@ class KernelDocDirective(Directive): lineoffset = int(match.group(1)) - 1 # we must eat our comments since the upset the markup else: - doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno) + doc = os.path.join(env.srcdir, env.docname) + doc_with_line = (doc + ":" + str(self.lineno)) result.append(line, doc + ": " + filename, lineoffset) lineoffset += 1
Signature · 1 line
2.42.0
Randy Dunlap
reviewerHi,
Quoted 18 lines · Claudio Cambra
Running "make htmldocs" generates several lines of this warning:
Documentation/sphinx/kerneldoc.py:141: RemovedInSphinx80Warning: Sphinx 8 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
doc = (env.srcdir + "/" + env.docname + ":" + str(self.lineno))Making "doc" an fspath type and creating a new variable with the appended colon and lineno fixes this warning.
Signed-off-by Claudio Cambra <[email protected]>--- Documentation/sphinx/kerneldoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Documentation/sphinx/kerneldoc.py +0
-0
Documentation/sphinx/kerneldoc.py class KernelDocDirective(Directive): · line 145
Quoted 9 lines
Documentation/sphinx/kerneldoc.py +2
-1@@ -138,7 +138,8 @@ class KernelDocDirective(Directive): lineoffset = int(match.group(1)) - 1 # we must eat our comments since the upset the markup else: - doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno) + doc = os.path.join(env.srcdir, env.docname) + doc_with_line = (doc + ":" + str(self.lineno)) result.append(line, doc + ": " + filename, lineoffset) lineoffset += 1
This patch should be sent to the [email protected] mailing list, with the Documentation maintainer copied on the patch.
We also have this similar patch to consider:
https://lore.kernel.org/linux-doc/[email protected]/
Thanks.
Signature · 1 line
~Randy
Hi,
Quoted 33 lines · Randy Dunlap
Hi,
Quoted 18 lines · Claudio Cambra
Running "make htmldocs" generates several lines of this warning:
Documentation/sphinx/kerneldoc.py:141: RemovedInSphinx80Warning: Sphinx 8 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
doc = (env.srcdir + "/" + env.docname + ":" + str(self.lineno))Making "doc" an fspath type and creating a new variable with the appended colon and lineno fixes this warning.
Signed-off-by Claudio Cambra <[email protected]>--- Documentation/sphinx/kerneldoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Documentation/sphinx/kerneldoc.py +0
-0Documentation/sphinx/kerneldoc.py class KernelDocDirective(Directive): · line 145
Quoted 9 lines
Documentation/sphinx/kerneldoc.py +2
-1@@ -138,7 +138,8 @@ class KernelDocDirective(Directive): lineoffset = int(match.group(1)) - 1 # we must eat our comments since the upset the markup else: - doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno) + doc = os.path.join(env.srcdir, env.docname) + doc_with_line = (doc + ":" + str(self.lineno)) result.append(line, doc + ": " + filename, lineoffset) lineoffset += 1This patch should be sent to the [email protected] mailing list, with the Documentation maintainer copied on the patch.
Quoted 4 lines
We also have this similar patch to consider:
https://lore.kernel.org/linux-doc/[email protected]/Thanks.
Thanks Randy, will keep in mind for future patches
Cheers,
Claudio
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Jonathan Corbet
maintainerQuoted 34 lines · Randy Dunlap
Hi,
Quoted 18 lines · Claudio Cambra
Running "make htmldocs" generates several lines of this warning:
Documentation/sphinx/kerneldoc.py:141: RemovedInSphinx80Warning: Sphinx 8 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
doc = (env.srcdir + "/" + env.docname + ":" + str(self.lineno))Making "doc" an fspath type and creating a new variable with the appended colon and lineno fixes this warning.
Signed-off-by Claudio Cambra <[email protected]>--- Documentation/sphinx/kerneldoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Documentation/sphinx/kerneldoc.py +0
-0Documentation/sphinx/kerneldoc.py class KernelDocDirective(Directive): · line 145
Quoted 9 lines
Documentation/sphinx/kerneldoc.py +2
-1@@ -138,7 +138,8 @@ class KernelDocDirective(Directive): lineoffset = int(match.group(1)) - 1 # we must eat our comments since the upset the markup else: - doc = env.srcdir + "/" + env.docname + ":" + str(self.lineno) + doc = os.path.join(env.srcdir, env.docname) + doc_with_line = (doc + ":" + str(self.lineno)) result.append(line, doc + ": " + filename, lineoffset) lineoffset += 1This patch should be sent to the [email protected] mailing list, with the Documentation maintainer copied on the patch.
Quoted 2 lines
We also have this similar patch to consider:
https://lore.kernel.org/linux-doc/[email protected]/
I have, in fact, applied that other patch.
Thanks,
jon
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees