linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] docs: Fix Sphinx 8 warning caused by paths represented with strings
       [not found] <20230924184057.91861-1-developer@claudiocambra.com>
@ 2023-09-24 18:47 ` Randy Dunlap
  2023-10-03 16:31   ` Jonathan Corbet
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2023-09-24 18:47 UTC (permalink / raw)
  To: Claudio Cambra, skhan, ivan.orlov0322, linux-kernel-mentees,
	linux-kernel, Linux Doc Mailing List, Jonathan Corbet

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@claudiocambra.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@vger.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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] docs: Fix Sphinx 8 warning caused by paths represented with strings
  2023-09-24 18:47 ` [PATCH] docs: Fix Sphinx 8 warning caused by paths represented with strings Randy Dunlap
@ 2023-10-03 16:31   ` Jonathan Corbet
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Corbet @ 2023-10-03 16:31 UTC (permalink / raw)
  To: Randy Dunlap, Claudio Cambra, skhan, ivan.orlov0322,
	linux-kernel-mentees, linux-kernel, Linux Doc Mailing List

Randy Dunlap <rdunlap@infradead.org> writes:

> 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@claudiocambra.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@vger.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/

I have, in fact, applied that other patch.

Thanks,

jon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-03 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230924184057.91861-1-developer@claudiocambra.com>
2023-09-24 18:47 ` [PATCH] docs: Fix Sphinx 8 warning caused by paths represented with strings Randy Dunlap
2023-10-03 16:31   ` 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).