qemu/docs/sphinx
Peter Maydell 701202a5a4 docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str
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>
(cherry picked from commit 48e5b5f994)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-08-02 10:27:13 +03:00
..
dbusdoc.py docs/sphinx: add sphinx modules to include D-Bus documentation 2021-12-21 10:50:21 +04:00
dbusdomain.py docs/sphinx: add sphinx modules to include D-Bus documentation 2021-12-21 10:50:21 +04:00
dbusparser.py docs/sphinx: add sphinx modules to include D-Bus documentation 2021-12-21 10:50:21 +04:00
depfile.py docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str 2024-08-02 10:27:13 +03:00
fakedbusdoc.py docs/sphinx: fix compatibility with sphinx < 1.8 2022-01-05 11:10:13 +01:00
hxtool.py docs/sphinx/hxtool.py: Remove STEXI/ETEXI support 2020-03-12 11:14:06 +00:00
kerneldoc.py Revert "docs: temporarily disable the kernel-doc extension" 2020-12-10 12:15:25 -05:00
kernellog.py docs: import Linux kernel-doc script and extension 2019-12-17 19:36:32 +01:00
qapidoc.py qapidoc: introduce QAPISchemaIfCond.docgen() 2021-08-26 13:53:56 +02:00
qmp_lexer.py sphinx: add qmp_lexer 2019-07-10 15:08:06 -04:00