From 64cd3388944b16d1dd2b86aad0e994fe75655c60 Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 24 Oct 2023 17:09:00 +0100 Subject: [PATCH] Merge bitcoin/bitcoin#28211: Bump python minimum supported version to 3.9 fa25e8b0a1610553014c786428f146ef9c694678 doc: Recommend lint image build on every call (MarcoFalke) faf70c1f330a92612cf381d32c791e9ba445d3f2 Bump python minimum version to 3.9 (MarcoFalke) fa8996b930886da712c09ffe4b58016b36c2ae5b ci: Bump i686_multiprocess.sh to latest Ubuntu LTS (MarcoFalke) Pull request description: All supported operating systems ship with python 3.9 (or later), so bumping the minimum should not cause any issues. A bump will allow new code to use new python 3.9 features. For reference: * https://packages.debian.org/bullseye/python3 * https://packages.ubuntu.com/focal/python3.9 * FreeBSD 12/13 also ships with 3.9 * CentOS-like 8/9 also ships with 3.9 (and 3.11) * OpenSuse Leap also ships with 3.9 (and 3.11) https://software.opensuse.org/package/python311-base This is for Bitcoin Core 27.0 in 2024 (next year), not the soon upcoming 26.0 next month. ACKs for top commit: Sjors: ACK fa25e8b0a1610553014c786428f146ef9c694678 jamesob: ACK fa25e8b0a1610553014c786428f146ef9c694678 ([`jamesob/ackr/28211.1.MarcoFalke.bump_python_minimum_supp`](https://github.com/jamesob/bitcoin/tree/ackr/28211.1.MarcoFalke.bump_python_minimum_supp)) Tree-SHA512: 86c9f6ac4b5ba94a62ee6a6062dd48a8295d8611a39cdb5829f4f0dbc77aaa1a51edccc7a99275bf699143ad3a6fe826de426d413e5a465e3b0e82b86d10c32e --- .python-version | 2 +- configure.ac | 4 ++-- test/functional/test_framework/util.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.python-version b/.python-version index eee6392d5c..2739029233 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.8.16 +3.9.17 diff --git a/configure.ac b/configure.ac index 6338f6380a..58b9f62e95 100644 --- a/configure.ac +++ b/configure.ac @@ -106,8 +106,8 @@ AC_PATH_TOOL(STRIP, strip) AC_PATH_TOOL(GCOV, gcov) AC_PATH_TOOL(LLVM_COV, llvm-cov) AC_PATH_PROG(LCOV, lcov) -dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md -AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python]) +dnl The minimum supported version is specified in .python-version and should be used if available, see doc/dependencies.md +AC_PATH_PROGS([PYTHON], [python3.9 python3.10 python3.11 python3.12 python3 python]) AC_PATH_PROG(GENHTML, genhtml) AC_PATH_PROG([GIT], [git]) AC_PATH_PROG(CCACHE,ccache) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 791861c947..e6e38d9dca 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -275,10 +275,10 @@ def sha256sum_file(filename): d = f.read(4096) return h.digest() -# TODO: Remove and use random.randbytes(n) instead, available in Python 3.9 +# TODO: Remove and use random.randbytes(n) directly def random_bytes(n): """Return a random bytes object of length n.""" - return bytes(random.getrandbits(8) for i in range(n)) + return random.randbytes(n) # RPC/P2P connection constants and functions ############################################