Skip to content

Commit

Permalink
docs/sphinx: Explicitly convert Sphinx paths to str
Browse files Browse the repository at this point in the history
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>
Tested-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20230910040811.53046-1-erer1243@gmail.com
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
  • Loading branch information
erer1243 authored and xypron committed Jan 17, 2024
1 parent 60971e6 commit f520982
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/sphinx/kerneldoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def run(self):
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

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/kfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,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,
Expand Down

0 comments on commit f520982

Please sign in to comment.