qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-stable@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 2/6] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str
Date: Wed, 31 Jul 2024 00:19:53 +0200	[thread overview]
Message-ID: <20240730221957.34533-3-philmd@linaro.org> (raw)
In-Reply-To: <20240730221957.34533-1-philmd@linaro.org>

From: Peter Maydell <peter.maydell@linaro.org>

In newer versions of Sphinx the env.doc2path() API is going to change
to return a Path object rather than a str. This was originally visible
in Sphinx 8.0.0rc1, but has been rolled back for the final 8.0.0
release. However it will probably emit a deprecation warning and is
likely to change for good in 9.0:
  https://github.com/sphinx-doc/sphinx/issues/12686

Our use in depfile.py assumes a str, and if it is passed a Path
it will fall over:
 Handler <function write_depfile at 0x77a1775ff560> for event 'build-finished' threw an exception (exception: unsupported operand type(s) for +: 'PosixPath' and 'str')

Wrapping the env.doc2path() call in str() will coerce a Path object
to the str we expect, and have no effect in older Sphinx versions
that do return a str.

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2458
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240729120533.2486427-1-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 docs/sphinx/depfile.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/sphinx/depfile.py b/docs/sphinx/depfile.py
index afdcbcec6e..e74be6af98 100644
--- a/docs/sphinx/depfile.py
+++ b/docs/sphinx/depfile.py
@@ -19,7 +19,7 @@
 
 def get_infiles(env):
     for x in env.found_docs:
-        yield env.doc2path(x)
+        yield str(env.doc2path(x))
         yield from ((os.path.join(env.srcdir, dep)
                     for dep in env.dependencies[x]))
     for mod in sys.modules.values():
-- 
2.45.2



  parent reply	other threads:[~2024-07-30 22:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 22:19 [PULL 0/6] Docs testing patches Philippe Mathieu-Daudé
2024-07-30 22:19 ` [PULL 1/6] docs: add test for firmware.json QAPI Philippe Mathieu-Daudé
2024-07-30 22:19 ` Philippe Mathieu-Daudé [this message]
2024-07-30 22:19 ` [PULL 3/6] tests/avocado: mips: fallback to HTTP given certificate expiration Philippe Mathieu-Daudé
2024-07-30 22:19 ` [PULL 4/6] tests/avocado: mips: add hint for fetchasset plugin Philippe Mathieu-Daudé
2024-07-30 22:19 ` [PULL 5/6] tests/avocado: test_arm_emcraft_sf2: handle RW requirements for asset Philippe Mathieu-Daudé
2024-07-30 22:19 ` [PULL 6/6] osdep.h: Clean up no-longer-needed back-compat for macOS 10 Philippe Mathieu-Daudé
2024-07-31  6:17 ` [PULL 0/6] Docs testing patches Richard Henderson

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=20240730221957.34533-3-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.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;
as well as URLs for NNTP newsgroup(s).