mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Akira Yokosawa <akiyks@gmail.com>
To: Oliver Faso <erer1243@gmail.com>, Jonathan Corbet <corbet@lwn.net>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH] docs/sphinx: Explicitly convert Sphinx paths to str
Date: Wed, 27 Sep 2023 23:09:04 +0900	[thread overview]
Message-ID: <d976a572-0865-af16-333b-2bdea3e6c6c2@gmail.com> (raw)
In-Reply-To: <20230910040811.53046-1-erer1243@gmail.com>

Hi,

On Sun, 10 Sep 2023 00:08:06 -0400, Oliver Faso wrote:
> Sphinx 7.2+ is switching to using pathlib.Path
> instead of str to represent paths. This fixes the
> current deprecation warnings and eventual breakage.
> This conversion will be a no-op when using older
> Sphinx versions.
> 
> Signed-off-by: Oliver Faso <erer1243@gmail.com>

Belatedly tested against Sphinx versions 2.4.5, 4.2.0, 5.3.0,
and 7.2.6 (latest).

Tested-by: Akira Yokosawa <akiyks@gmail.com>

HTH, Akira

> ---
>  Documentation/sphinx/kerneldoc.py | 2 +-
>  Documentation/sphinx/kfigure.py   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
> index 9395892c7ba3..d26155990ec3 100644
> --- a/Documentation/sphinx/kerneldoc.py
> +++ b/Documentation/sphinx/kerneldoc.py
> @@ -138,7 +138,7 @@ 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 = str(env.srcdir) + "/" + env.docname + ":" + str(self.lineno)
>                      result.append(line, doc + ": " + filename, lineoffset)
>                      lineoffset += 1
>  
> diff --git a/Documentation/sphinx/kfigure.py b/Documentation/sphinx/kfigure.py
> index cefdbb7e7523..13e885bbd499 100644
> --- a/Documentation/sphinx/kfigure.py
> +++ b/Documentation/sphinx/kfigure.py
> @@ -309,7 +309,7 @@ def convert_image(img_node, translator, src_fname=None):
>      if dst_fname:
>          # the builder needs not to copy one more time, so pop it if exists.
>          translator.builder.images.pop(img_node['uri'], None)
> -        _name = dst_fname[len(translator.builder.outdir) + 1:]
> +        _name = dst_fname[len(str(translator.builder.outdir)) + 1:]
>  
>          if isNewer(dst_fname, src_fname):
>              kernellog.verbose(app,
> -- 
> 2.42.0
> 

  parent reply	other threads:[~2023-09-27 14:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-10  4:08 Oliver Faso
2023-09-10  4:18 ` Matthew Wilcox
2023-09-10  4:37   ` Oliver F
2023-09-27 14:09 ` Akira Yokosawa [this message]
2023-10-03 15:57 ` Jonathan Corbet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d976a572-0865-af16-333b-2bdea3e6c6c2@gmail.com \
    --to=akiyks@gmail.com \
    --cc=corbet@lwn.net \
    --cc=erer1243@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®