[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5fd1b5cd-ea6c-44a1-9cb5-8f692d32ec99@infradead.org>
Date: Sun, 24 Sep 2023 11:47:37 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Claudio Cambra <developer@...udiocambra.com>,
skhan@...uxfoundation.org, ivan.orlov0322@...il.com,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org,
Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Jonathan Corbet <corbet@....net>
Subject: Re: [PATCH] docs: Fix Sphinx 8 warning caused by paths represented
with strings
Hi,
On 9/24/23 11:40, Claudio Cambra wrote:
> 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 <developer@...udiocambra.com>
> ---
> Documentation/sphinx/kerneldoc.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
> index 9395892c7ba3..e2c835e10dba 100644
> --- a/Documentation/sphinx/kerneldoc.py
> +++ b/Documentation/sphinx/kerneldoc.py
> @@ -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 linux-doc@...r.kernel.org mailing list,
with the Documentation maintainer copied on the patch.
We also have this similar patch to consider:
https://lore.kernel.org/linux-doc/20230910040811.53046-1-erer1243@gmail.com/
Thanks.
--
~Randy
Powered by blists - more mailing lists