From patchwork Fri Sep 6 11:12:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 825935 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp745995wrb; Fri, 6 Sep 2024 04:19:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXQT6zN4Ev8sNTVoOd6pMZEdccgRY6MF7C8wCFHvqBr50dGcg5FvQCBYwwbjZFkXrIxtCn7FA==@linaro.org X-Google-Smtp-Source: AGHT+IGlUr1V8WypV3X1j8vO8r9MWLWUxus1AOECFGjynd8DSrIOzqTUMp/ymGzErtqapzPST0dA X-Received: by 2002:a05:6902:2482:b0:e0b:b85b:b8c3 with SMTP id 3f1490d57ef6-e1d349f1a0fmr2632871276.39.1725621553445; Fri, 06 Sep 2024 04:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725621553; cv=none; d=google.com; s=arc-20240605; b=YzvISzq+UZgaJmWhPTdHsSnSJvK6bHTeDxFcWQvLFFSNkvxWMbJEp0oPKQje5H8MPF TaORgz7+KpJaIHIRSgBvG4ycMmMWhemibYJQFDq5Z7+IwHwhuRHiFBR2u27dQoJuar24 eVezJCNpUULrJx1PCWFMy6a3ORl+ePRsCBozSyN+9grmrYLHsvXLXQUDsxMYNcRS86vS QbKlVnqvm2xH+JiLTN4EA2f/ldspQ1/SUpIX1OrHUJH8D8Oml3roatfA0UMr+wvUJRVB FDdv+ZGji5rRkiOcUx6EKnbfMWSV4TPZNTf/ooHdETOpCIy0Li265A5AiXnQ6vyMMAoG LyNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=LxVt8Zqzx+mHsb5SPIqxofKuCv6ai9lg4miz52rF5Qk=; fh=He0A/96iGS/hdBTIvTFKPoE7yByjlEm52ubAJxr7bqo=; b=Mo5txhSaBY37yBZHx1zypDfRLLZQ6rCMoAEXKF7uSwLdBlPLnX16AEdG+UA8xRn1LD PT0HF7p28K8QNKoN3NP4C8gDzNgxoNAt8/DwVddjgo+5H8gqTJ7wWl01e7+kYIpBqC13 GQCn16cPV+YCUHF7f5+i7+7fyffC7XOPED7C+8FcpRrM/AbyORoGdVtWTn0ThLpgzWot 2R0mv6TL15FUfHljjWn9y/fmdg+Q6owdrP8chpexl5mx85nSRFZtTSoBwodS7qxkvKpv vyGpWPsfxfo+1vQbRy+py61VP03o2yqpl5RlitOxYJDVwRmZFs7UqiMLA7EOAs89W7xn B0MA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c5306a89ddsi511116d6.518.2024.09.06.04.19.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Sep 2024 04:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smWxr-0000fx-TW; Fri, 06 Sep 2024 07:17:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smWwL-00028l-Cx; Fri, 06 Sep 2024 07:15:45 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smWwJ-00081A-JO; Fri, 06 Sep 2024 07:15:45 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6F4D58C48D; Fri, 6 Sep 2024 14:12:08 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 7C17D1336F7; Fri, 6 Sep 2024 14:13:26 +0300 (MSK) Received: (nullmailer pid 353637 invoked by uid 1000); Fri, 06 Sep 2024 11:13:24 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-9.0.3 29/69] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str Date: Fri, 6 Sep 2024 14:12:38 +0300 Message-Id: <20240906111324.353230-29-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Maydell 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 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 Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240729120533.2486427-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé (cherry picked from commit 48e5b5f994bccf161dd88a67fdd819d4bfb400f1) Signed-off-by: Michael Tokarev 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():