[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 02/14] docs/sphinx/depfile.py: Handle env.doc2path() returning a P
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 02/14] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str |
Date: |
Mon, 29 Jul 2024 17:27:02 +0200 |
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
- [PULL 00/14] Docs / testing patches for 2024-07-29, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 02/14] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str,
Philippe Mathieu-Daudé <=
- [PULL 01/14] docs: add test for firmware.json QAPI, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 03/14] python: Install pycotap in our venv if necessary, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 04/14] tests/functional: Add base classes for the upcoming pytest-based tests, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 05/14] tests/Makefile.include: Increase the level of indentation in the help text, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 06/14] tests/functional: Prepare the meson build system for the functional tests, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 08/14] tests/functional: Convert avocado tests that just need a small adjustment, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 07/14] tests/functional: Convert simple avocado tests into standalone python tests, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 09/14] tests/functional: Convert the x86_cpu_model_versions test, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 10/14] tests/functional: Convert the riscv_opensbi avocado test into a standalone test, Philippe Mathieu-Daudé, 2024/07/29
- [PULL 11/14] gitlab-ci: Add "check-functional" to the build tests, Philippe Mathieu-Daudé, 2024/07/29