From patchwork Mon Jul 29 12:05:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 815018 Delivered-To: patch@linaro.org Received: by 2002:adf:b359:0:b0:367:895a:4699 with SMTP id k25csp1245375wrd; Mon, 29 Jul 2024 05:36:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV2axcK8kUS07JHdyYYH6Bq2UYSNAWPw8/w2kw0RBsEVyFcb6i84gGnuijwkRehAbvZmesnRqEttv6ey/ZggKJ4 X-Google-Smtp-Source: AGHT+IFdXwJBZvvu1gi0lYmRuxesivUTv/DzBDoX2/VkFf8UOT3h2A+UgrjiHbuLOqqH2mIkgZbl X-Received: by 2002:a05:622a:15d1:b0:447:f514:f2c6 with SMTP id d75a77b69052e-45004f49a29mr87304061cf.53.1722256573679; Mon, 29 Jul 2024 05:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722256573; cv=none; d=google.com; s=arc-20160816; b=IX8zQRBlWqDKwyEL4KO8EAKGEeyrvjA5uQ13H2bvjWiP0EUhoVeyEw0PGM2VoDh5X8 wx87SFP+SA+SSATfAje175A6Wb7fSF19IvNENU+IfjI6bxRWSMmRjNCzaRNFiur9rqKz VHtUSpJMTEB/9x4eNJZl4N2k2dREhGDYQrGUqBiN9KMzy5uvwkq7FpoPI410BoBtIOWD COO8p52HW/xRRkWg8QmumXvLRrBuXxxGcf6Dt4cTnSvj9Pdq2kBi/BZynyMKOpDhkDNo XMmYS3j/nmWGfHPAXSYxPYAOy4KFLm/rqnhBOGogduzNPXjC8ZMfGaLYj6LhY0tpfWv3 zqIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=v4OnXxLy+/uIGAva9okgt0HNd9KDzrdWo3Q0gkIoVtM=; fh=4xAfBzvxKOYFspxNRC3/4UvygTzcuWGleT8IdldeQc0=; b=xTYTM2EeQsvfYlo9rjr06fCfaOUqkZSgOu5p5B4yDzUVR57Q0F+888kW5IU4kmp7Go 7v2yWmwkUr18cVg9oKH/aYObmfpyo8N5Xm1HtrFIHX5lLMLNVKwdD4QXExka9zsG0rZe XhTS3FutHvSldXSCHa6UnozxjP6mesdLikrv/iVGx15quvSYajcmdnn2czfNKpqHGhNO ilytL2WkfUFme1I6YD0WmcguQ/TZuvwuHnqS7okUeKcax3wOPK8pNIPqQQV868p3z5eZ D1W5rSUQTl7DPpOxRmQ45vjcHMx928EDfWNkAbhhv6lAk+wzsm+iXfJ/PcNaHG9S9jc+ 4pOQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l447vCDe; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-44fe853a59csi103047491cf.763.2024.07.29.05.36.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jul 2024 05:36: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; dkim=pass header.i=@linaro.org header.s=google header.b=l447vCDe; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYP8H-0002AX-Bc; Mon, 29 Jul 2024 08:05:41 -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 1sYP8F-0002A1-T0 for qemu-devel@nongnu.org; Mon, 29 Jul 2024 08:05:40 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sYP8D-0005J3-JN for qemu-devel@nongnu.org; Mon, 29 Jul 2024 08:05:39 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4266dc7591fso14541935e9.0 for ; Mon, 29 Jul 2024 05:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722254735; x=1722859535; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=v4OnXxLy+/uIGAva9okgt0HNd9KDzrdWo3Q0gkIoVtM=; b=l447vCDeIxIEwtFVEsTnswPIUH3gt//J4R1iGhoDi/PM8shLt3XwlXrWnYCbquvyjy V8lUOfpVeQAFoEJHFotQ2wgVrkHEHP+8hL1ndIYVKncLY7JrNf1ThhaLVif4U8Obj+RI c55ARpxs6SzSwdiTsMBgZuBj5jJwRA2wrewUqIQA4hDTbjHl3/knFFEUnlWPdW/zTbTr vOefjE/miDuyXZVV/PC7Xf/PeA2kfYhhsETvG6z/TnJXhZ+ujGKSwV75YnMymJb790vY 9PWCLOufZqGZsqmPidHWz6lFbfi4F4w7HZDn51TV+2M4ZAvc/ziBjXFh2V/m4J35fjuv lvTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722254735; x=1722859535; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v4OnXxLy+/uIGAva9okgt0HNd9KDzrdWo3Q0gkIoVtM=; b=odgEjcDu5eJItpX6o6sv9X4cMuyZB9AucJ8m0SDTIMYi8wp7Cd/Cb05eF24aHMvj70 4AEtmhpASNBZcFmtLWw6ROdAMLkVt120bsVdtNCc1rVPS3YlQ06SCPhsmFDwq5wNZpKT 2v6jPiMWQHW+berSg2L51NMAJKwZHH89o+HMuRKVEDjY8YLJvA8rRqJ6VcBObhiMxoMz LUvOPk33KVq95Gc7nYd4RJWRjUeWAzuw12XOkbtHiUsZHZPfi8+Mbk7URsPsVl8VM5ox VBZ+eA+0wlLRCJwFW/71a9qszSD5ZtV3AMoDGcWptjlbNLB+QzWWaDJtss5unJfHsAfS WwDQ== X-Gm-Message-State: AOJu0YzClKFw/dLLRY1gfLgGmhIv+YItgxL0bXIS2HYi0qDyCOnjY5GJ 3tn/xlCHH1fWla+hBTY16ZO76EEGANtZecCTm6WydlDHk+tJukHGIlkGi0Xp8jLnmDfJRrg6OLm 5 X-Received: by 2002:a05:600c:1f8f:b0:427:ffa4:32d0 with SMTP id 5b1f17b1804b1-42811dd6ae7mr47189575e9.28.1722254735352; Mon, 29 Jul 2024 05:05:35 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428197f2597sm52968245e9.24.2024.07.29.05.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 05:05:35 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Paolo Bonzini Subject: [PATCH] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str Date: Mon, 29 Jul 2024 13:05:33 +0100 Message-Id: <20240729120533.2486427-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 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é --- 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 afdcbcec6e7..e74be6af98b 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():