From 4fa06bfd39aca721a3e2ce46041dc26743e56b8a Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 7 May 2026 17:36:09 +0100 Subject: [PATCH 1/5] Fixes for 3.16 bump --- Doc/whatsnew/3.16.rst | 7 +++- Include/internal/pycore_magic_number.h | 5 ++- Lib/sysconfig/__init__.py | 38 ------------------- ...-05-07-17-35-47.gh-issue-149499.G2ER-R.rst | 3 ++ PC/launcher.c | 1 + configure | 26 ++++++------- 6 files changed, 26 insertions(+), 54 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index 5931586d5a1d9c..aed9b8cd0d5757 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -109,7 +109,12 @@ Removed module_name ----------- -* TODO +* :mod:`sysconfig`: + + * The :func:`!sysconfig.expand_makefile_vars` function + which has been deprecated since Python 3.14. + Use the ``vars`` argument of :func:`sysconfig.get_paths` instead. + .. Add removals above alphabetically, not here at the end. diff --git a/Include/internal/pycore_magic_number.h b/Include/internal/pycore_magic_number.h index 177938e3cdb5eb..0f1af8ba338865 100644 --- a/Include/internal/pycore_magic_number.h +++ b/Include/internal/pycore_magic_number.h @@ -297,9 +297,10 @@ Known values: Python 3.15a8 3664 (Fix __qualname__ for __annotate__ functions) Python 3.15a8 3665 (Add FOR_ITER_VIRTUAL and GET_ITER specializations) Python 3.15b1 3666 (Add SEND_VIRTUAL and SEND_ASYNC_GEN specializations) + Python 3.16a0 3700 (Initial version) - Python 3.16 will start with 3700 + Python 3.17 will start with 3750 Please don't copy-paste the same pre-release tag for new entries above!!! You should always use the *upcoming* tag. For example, if 3.12a6 came out @@ -310,7 +311,7 @@ PC/launcher.c must also be updated. */ -#define PYC_MAGIC_NUMBER 3666 +#define PYC_MAGIC_NUMBER 3700 /* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes (little-endian) and then appending b'\r\n'. */ #define PYC_MAGIC_NUMBER_TOKEN \ diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py index 47415adce04c2c..298256a5b23a9c 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -753,41 +753,3 @@ def get_python_version(): def _get_python_version_abi(): return _PY_VERSION_SHORT + get_config_var("abi_thread") - - -def expand_makefile_vars(s, vars): - """Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in - 'string' according to 'vars' (a dictionary mapping variable names to - values). Variables not present in 'vars' are silently expanded to the - empty string. The variable values in 'vars' should not contain further - variable expansions; if 'vars' is the output of 'parse_makefile()', - you're fine. Returns a variable-expanded version of 's'. - """ - - import warnings - warnings.warn( - 'sysconfig.expand_makefile_vars is deprecated and will be removed in ' - 'Python 3.16. Use sysconfig.get_paths(vars=...) instead.', - DeprecationWarning, - stacklevel=2, - ) - - import re - - _findvar1_rx = r"\$\(([A-Za-z][A-Za-z0-9_]*)\)" - _findvar2_rx = r"\${([A-Za-z][A-Za-z0-9_]*)}" - - # This algorithm does multiple expansion, so if vars['foo'] contains - # "${bar}", it will expand ${foo} to ${bar}, and then expand - # ${bar}... and so forth. This is fine as long as 'vars' comes from - # 'parse_makefile()', which takes care of such expansions eagerly, - # according to make's variable expansion semantics. - - while True: - m = re.search(_findvar1_rx, s) or re.search(_findvar2_rx, s) - if m: - (beg, end) = m.span() - s = s[0:beg] + vars.get(m.group(1)) + s[end:] - else: - break - return s diff --git a/Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst b/Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst new file mode 100644 index 00000000000000..796d39f5ba05bf --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-05-07-17-35-47.gh-issue-149499.G2ER-R.rst @@ -0,0 +1,3 @@ +Removed the :func:`!sysconfig.expand_makefile_vars` function which has been +deprecated since Python 3.14. Use the ``vars`` argument of +:func:`sysconfig.get_paths` instead. diff --git a/PC/launcher.c b/PC/launcher.c index fed5e156b92cb3..5667fc851aa590 100644 --- a/PC/launcher.c +++ b/PC/launcher.c @@ -1273,6 +1273,7 @@ static PYC_MAGIC magic_values[] = { { 3550, 3599, L"3.13" }, { 3600, 3649, L"3.14" }, { 3650, 3699, L"3.15" }, + { 3700, 3749, L"3.16" }, { 0 } }; diff --git a/configure b/configure index cff7dfbfba8b9a..ecdd6095669ddc 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.72 for python 3.15. +# Generated by GNU Autoconf 2.72 for python 3.16. # # Report bugs to . # @@ -604,8 +604,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='python' PACKAGE_TARNAME='python' -PACKAGE_VERSION='3.15' -PACKAGE_STRING='python 3.15' +PACKAGE_VERSION='3.16' +PACKAGE_STRING='python 3.16' PACKAGE_BUGREPORT='https://github.com/python/cpython/issues/' PACKAGE_URL='' @@ -1750,7 +1750,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -'configure' configures python 3.15 to adapt to many kinds of systems. +'configure' configures python 3.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1816,7 +1816,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of python 3.15:";; + short | recursive ) echo "Configuration of python 3.16:";; esac cat <<\_ACEOF @@ -1875,9 +1875,9 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-build-python=python3.15 + --with-build-python=python3.16 path to build python binary for cross compiling - (default: _bootstrap_python or python3.15) + (default: _bootstrap_python or python3.16) --with-pkg-config=[yes|no|check] use pkg-config to detect build options (default is check) @@ -2133,7 +2133,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -python configure 3.15 +python configure 3.16 generated by GNU Autoconf 2.72 Copyright (C) 2023 Free Software Foundation, Inc. @@ -2811,7 +2811,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by python $as_me 3.15, which was +It was created by python $as_me 3.16, which was generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -3846,7 +3846,7 @@ fi -for ac_prog in python$PACKAGE_VERSION python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 python3 python +for ac_prog in python$PACKAGE_VERSION python3.16 python3.15 python3.14 python3.13 python3.12 python3.11 python3.10 python3 python do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -3922,7 +3922,7 @@ rm confdefs.h mv confdefs.h.new confdefs.h -VERSION=3.15 +VERSION=3.16 # Version number of Python's own shared library file. @@ -35911,7 +35911,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by python $as_me 3.15, which was +This file was extended by python $as_me 3.16, which was generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -35975,7 +35975,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -python config.status 3.15 +python config.status 3.16 configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" From 4705ad7b08f4766f07ba863573f857c52ab6d459 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 7 May 2026 17:41:06 +0100 Subject: [PATCH 2/5] Fix Windows --- PC/pyconfig.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 72a475777b7ad0..2381ed3772b109 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -330,21 +330,21 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ the linking is explicitly handled */ # if defined(Py_GIL_DISABLED) # if defined(Py_DEBUG) -# pragma comment(lib,"python315t_d.lib") +# pragma comment(lib,"python316t_d.lib") # elif defined(Py_LIMITED_API) || defined(Py_TARGET_ABI3T) # pragma comment(lib,"python3t.lib") # else -# pragma comment(lib,"python315t.lib") +# pragma comment(lib,"python316t.lib") # endif /* Py_DEBUG */ # else /* Py_GIL_DISABLED */ # if defined(Py_DEBUG) -# pragma comment(lib,"python315_d.lib") +# pragma comment(lib,"python316_d.lib") # elif defined(Py_TARGET_ABI3T) # pragma comment(lib,"python3t.lib") # elif defined(Py_LIMITED_API) # pragma comment(lib,"python3.lib") # else -# pragma comment(lib,"python315.lib") +# pragma comment(lib,"python316.lib") # endif /* Py_DEBUG */ # endif /* Py_GIL_DISABLED */ # endif /* _MSC_VER && !Py_NO_LINK_LIB */ From 4e2c9d4818fee2d7f9b6d3182908259e61d70430 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Thu, 7 May 2026 18:00:54 +0100 Subject: [PATCH 3/5] Fix doc --- Doc/whatsnew/3.16.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index aed9b8cd0d5757..90cf9568d2839f 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -115,6 +115,7 @@ module_name which has been deprecated since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` instead. + .. Add removals above alphabetically, not here at the end. @@ -161,4 +162,3 @@ Deprecated C APIs Removed C APIs -------------- - From b18ef5f4b52085f0c1c0c23c2cd35df6dac47983 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Thu, 7 May 2026 13:33:51 -0500 Subject: [PATCH 4/5] Fix doc format Co-Authored-By: Zachary Ware --- Doc/whatsnew/3.16.rst | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index 90cf9568d2839f..4460913341dec4 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -106,15 +106,12 @@ module_name Removed ======= -module_name ------------ - -* :mod:`sysconfig`: - - * The :func:`!sysconfig.expand_makefile_vars` function - which has been deprecated since Python 3.14. - Use the ``vars`` argument of :func:`sysconfig.get_paths` instead. +sysconfig +--------- +* The :func:`!sysconfig.expand_makefile_vars` function +which has been deprecated since Python 3.14. +Use the ``vars`` argument of :func:`sysconfig.get_paths` instead. .. Add removals above alphabetically, not here at the end. From 1f8c7ddbd5b8dfabfdd6b2b4a79516e8e77cf06b Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Thu, 7 May 2026 13:38:08 -0500 Subject: [PATCH 5/5] fixup! Fix doc format --- Doc/whatsnew/3.16.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index 4460913341dec4..cc88a694608233 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -110,8 +110,8 @@ sysconfig --------- * The :func:`!sysconfig.expand_makefile_vars` function -which has been deprecated since Python 3.14. -Use the ``vars`` argument of :func:`sysconfig.get_paths` instead. + which has been deprecated since Python 3.14. + Use the ``vars`` argument of :func:`sysconfig.get_paths` instead. .. Add removals above alphabetically, not here at the end.