qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] docs/sphinx/depfile.py: Handle env.doc2path() returning a Pa


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str
Date: Mon, 29 Jul 2024 15:36:25 +0200
User-agent: Mozilla Thunderbird

On 29/7/24 14:05, Peter Maydell wrote:
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>
---
  docs/sphinx/depfile.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]