From nobody Tue Oct 7 14:57:05 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3CCB2C3247; Wed, 9 Jul 2025 13:52:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752069141; cv=none; b=OKb1SWzdB8GJbmqGEs64Yn1cZeaOefCVF+oKyeHhARnNr9LWNB3vBVGXUVD9O9sxWSKi3tkV33XmLsLjRT6WZt4z6kO9vyOE44nAdcCQNofrdR/7ZBuJ2lDIqfuTQoI2uXD1hWPs1mexRRoqo+fFVstdEfNRmnSg5VOiNxAf2k0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752069141; c=relaxed/simple; bh=QZ8qIGEhIaRkTGuQPr4EFUzjS7Cqh7Eui7qNYAGIDWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nUDf/sq/I3/VmeWVdI8kOiTEm4rQwS4U39XvDbnhUwVUJejZ6ICNLZXg3LN2bd1xaD7doIe5yvHLrJ2BhuI+WtvdbbmNMDSnV1AxEENkv0LCscjuQNmQe+OVUETjtqFaajT5F9zX/Y1sTe3ZSRZ86kHckw8eQx5jgyMifFsc5vg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QSegm2pR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QSegm2pR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95C7BC4CEF1; Wed, 9 Jul 2025 13:52:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752069140; bh=QZ8qIGEhIaRkTGuQPr4EFUzjS7Cqh7Eui7qNYAGIDWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSegm2pRG/HBr/JlZJO44ixqZ+wo6FTzjGrLPlRFscaxJVGff3BZ2ZyEccFoLF/pi 0X7tzrTZZP2TPzXdcU7zGCI7mo/jwIbHz13ajFLPyv4Cv0nsQH1gQtYsdIz2wqf/8W 0dnIl8vFYQ8PHy2f4UwI9rIJojP2/4LUP8WETp3CKAYr1fPcu7WO9k0uQiGPwvdQ/e RlATIe8RTSFSvrBtX1YL5z5catcKgHSp5zVYGtEfsUGq5y4Gq0jUuM1vm9am5h7/nz yN29Zw3ncQajmNncxYMaLh5vo57kWXD9IKvL7AYGpVSUol+tAAX0b6KCBSPhs0zXg9 u3o4Eyd67AvQg== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uZVDd-00000000ECI-0z4V; Wed, 09 Jul 2025 15:52:17 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Akira Yokosawa" , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v2 04/39] scripts: sphinx-pre-install: Make it compatible with Python 3.6 Date: Wed, 9 Jul 2025 15:51:36 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" The minimal version requirements we have is 3.9. Yet, the script which detects it is this one. So, let's try supporting an old version here, as we may want to suggest to upgrade Python version to build the docs. Signed-off-by: Mauro Carvalho Chehab --- scripts/sphinx-pre-install.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/sphinx-pre-install.py b/scripts/sphinx-pre-install.py index dcee2181b72f..71d86b230b22 100755 --- a/scripts/sphinx-pre-install.py +++ b/scripts/sphinx-pre-install.py @@ -115,7 +115,8 @@ class SphinxDependencyChecker: def find_python_no_venv(): # FIXME: does it makes sense now that this script is in Python? =20 - result =3D subprocess.run(["pwd"], capture_output=3DTrue, text=3DT= rue) + result =3D SphinxDependencyChecker.run(["pwd"], capture_output=3DT= rue, + text=3DTrue) cur_dir =3D result.stdout.strip() =20 python_names =3D ["python3", "python"] @@ -135,12 +136,23 @@ class SphinxDependencyChecker: def run(*args, **kwargs): """Excecute a command, hiding its output by default""" =20 - if not kwargs.get('capture_output', False): + capture_output =3D kwargs.pop('capture_output', False) + + if capture_output: + if 'stdout' not in kwargs: + kwargs['stdout'] =3D subprocess.PIPE + if 'stderr' not in kwargs: + kwargs['stderr'] =3D subprocess.PIPE + else: if 'stdout' not in kwargs: kwargs['stdout'] =3D subprocess.DEVNULL if 'stderr' not in kwargs: kwargs['stderr'] =3D subprocess.DEVNULL =20 + # Don't break with older Python versions + if 'text' in kwargs and sys.version_info < (3, 7): + kwargs['universal_newlines'] =3D kwargs.pop('text') + return subprocess.run(*args, **kwargs) =20 # --=20 2.49.0