From patchwork Fri Sep 6 05:16:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 825896 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp637622wrb; Thu, 5 Sep 2024 22:19:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXUQfGFRP+h/gPFPp5jo5wcSr3gZII9xJBfyyZh39c2SAE5YIBHUxmZXpfWMbYQOuNeXFpxHA==@linaro.org X-Google-Smtp-Source: AGHT+IEjMbvX7G1cXcaq+7J54Vlb3VwA4R1ENxP1m/gfKen1WMVLGiHaVVkZgjGh64pLFCVhbRsY X-Received: by 2002:a05:6102:3a06:b0:49b:dbf9:7b3d with SMTP id ada2fe7eead31-49bde1cfefemr1804535137.16.1725599948460; Thu, 05 Sep 2024 22:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725599948; cv=none; d=google.com; s=arc-20240605; b=lXLYst0kQgstjyHjYg3umPbjf5CxbETlBWQ8sQ1CGODXsgxghmbE98qRvFiAnuchqK Ji5JZtsLr6HCVMLOWACJv6U8jrbyuqWsdfwbI/5Ac0J06BnEX61aJR7axaSzCyRD1No9 tYqTrlJJ3bkGKLRYzTHNRtG/hW3EMl3IOdTcv8YaJ47Oiwux6vu68sOBGcSkeNf57NJW sj0uwoSsPa/KvTpzZl/iKirS8P+MTOWxVVmhiY9mE4X6zf7l3SaZyv+BjYPZcRrqV0Z5 ZIts2x8DFhA97BHw+Kgu1FkCXdk1Ars2luI1THl2KUFruohElcCGHDDgfVZRozL1pk4T koCg== 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=BIexAjveFDJfjGbckGA88I7jJKPOCZnAKX6RZ0ocaCmBUHsx2s9kEuEN2z4F7lAUOQ 1WjcXNL6TBbe0S+lfSp5jlj4KOacihNq4JLzTUrKPtrBIOKGeORbVg7c+j/FS/2GjvZm 6oNnRJIkMiF4z5W4IZe6uniU6ttPtOdNTu1dDJ6TTY5wqF2AfXjY0F2QcDlFCdzW/q51 hAwIIf0piJ85wllxVSM7SJKdPLm7XJ1yA8zTkHzqy4XRo2LTIU1cfLNAyxOfaodqgAVU KzZxo9bRO+o3y/kI+8CJEE5ue2H/8Kc+T/6/L8y4rv8+phWON72eiS/dSc3NdQgKEMrB hLAw==; 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 af79cd13be357-7a98f03c413si351415685a.772.2024.09.05.22.19.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Sep 2024 22:19:08 -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 1smRML-0008K5-I5; Fri, 06 Sep 2024 01:18:13 -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 1smRMJ-00087k-GB; Fri, 06 Sep 2024 01:18:11 -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 1smRMH-000840-IO; Fri, 06 Sep 2024 01:18:11 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 63FEB8C127; Fri, 6 Sep 2024 08:15:17 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 1494A13336D; Fri, 6 Sep 2024 08:16:35 +0300 (MSK) Received: (nullmailer pid 10442 invoked by uid 1000); Fri, 06 Sep 2024 05:16:33 -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-7.2.14 19/40] docs/sphinx/depfile.py: Handle env.doc2path() returning a Path not a str Date: Fri, 6 Sep 2024 08:16:07 +0300 Message-Id: <20240906051633.10288-19-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():