From 0412f5117ab7c488c5c16deddf6f2aecf0ea850c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 23 Nov 2023 15:41:18 +0100 Subject: [PATCH 001/115] Sanitize the %files section - Don't bother listing %dirs and __pycache__ and *.py, list entire directories - Keep pure Python and extension modules separated - Sort things - Macronize the list of extension modules for -debug --- python3.13.spec | 447 ++++++++++++++++-------------------------------- 1 file changed, 146 insertions(+), 301 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 8ba1c0a..33e947d 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1193,30 +1193,52 @@ CheckPython optimized %license %{pylibdir}/LICENSE.txt -%dir %{pylibdir}/unittest/ -%dir %{pylibdir}/unittest/__pycache__/ -%{pylibdir}/unittest/*.py -%{pylibdir}/unittest/__pycache__/*%{bytecode_suffixes} +# Pure Python modules +%{pylibdir}/*.py +%dir %{pylibdir}/__pycache__/ +%{pylibdir}/__pycache__/*%{bytecode_suffixes} -%dir %{pylibdir}/asyncio/ -%dir %{pylibdir}/asyncio/__pycache__/ -%{pylibdir}/asyncio/*.py -%{pylibdir}/asyncio/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/__phello__/ +%{pylibdir}/asyncio/ +%{pylibdir}/collections/ +%{pylibdir}/concurrent/ +%{pylibdir}/ctypes/ +%{pylibdir}/curses/ +%{pylibdir}/dbm/ +%{pylibdir}/encodings/ +%{pylibdir}/html/ +%{pylibdir}/http/ +%{pylibdir}/importlib/ +%{pylibdir}/json/ +%{pylibdir}/logging/ +%{pylibdir}/multiprocessing/ +%{pylibdir}/pydoc_data/ +%{pylibdir}/re/ +%{pylibdir}/sqlite3/ +%{pylibdir}/sysconfig/ +%{pylibdir}/tomllib/ +%{pylibdir}/unittest/ +%{pylibdir}/urllib/ +%{pylibdir}/venv/ +%{pylibdir}/wsgiref/ +%{pylibdir}/xml/ +%{pylibdir}/xmlrpc/ +%{pylibdir}/zipfile/ +%{pylibdir}/zoneinfo/ -%dir %{pylibdir}/venv/ -%dir %{pylibdir}/venv/__pycache__/ -%{pylibdir}/venv/*.py -%{pylibdir}/venv/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/venv/scripts - -%{pylibdir}/wsgiref -%{pylibdir}/xmlrpc +# Handle the email module in detail to mark architecture.rst as %%doc +%dir %{pylibdir}/email/ +%dir %{pylibdir}/email/__pycache__/ +%{pylibdir}/email/*.py +%{pylibdir}/email/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/email/mime/ +%doc %{pylibdir}/email/architecture.rst +# Handle the ensurepip module in detail to not accidentally ship wheels %dir %{pylibdir}/ensurepip/ %dir %{pylibdir}/ensurepip/__pycache__/ %{pylibdir}/ensurepip/*.py %{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} - %if %{with rpmwheels} %exclude %{pylibdir}/ensurepip/_bundled %else @@ -1224,190 +1246,94 @@ CheckPython optimized %{pylibdir}/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl %endif -%dir %{pylibdir}/concurrent/ -%dir %{pylibdir}/concurrent/__pycache__/ -%{pylibdir}/concurrent/*.py -%{pylibdir}/concurrent/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/concurrent/futures/ -%dir %{pylibdir}/concurrent/futures/__pycache__/ -%{pylibdir}/concurrent/futures/*.py -%{pylibdir}/concurrent/futures/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/sysconfig/ -%dir %{pylibdir}/sysconfig/__pycache__/ -%{pylibdir}/sysconfig/*.py -%{pylibdir}/sysconfig/__pycache__/*%{bytecode_suffixes} - -%{pylibdir}/pydoc_data - -%{dynload_dir}/_blake2.%{SOABI_optimized}.so -%{dynload_dir}/_md5.%{SOABI_optimized}.so -%{dynload_dir}/_sha1.%{SOABI_optimized}.so -%{dynload_dir}/_sha2.%{SOABI_optimized}.so -%{dynload_dir}/_sha3.%{SOABI_optimized}.so - -%{dynload_dir}/_asyncio.%{SOABI_optimized}.so -%{dynload_dir}/_bisect.%{SOABI_optimized}.so -%{dynload_dir}/_bz2.%{SOABI_optimized}.so -%{dynload_dir}/_codecs_cn.%{SOABI_optimized}.so -%{dynload_dir}/_codecs_hk.%{SOABI_optimized}.so -%{dynload_dir}/_codecs_iso2022.%{SOABI_optimized}.so -%{dynload_dir}/_codecs_jp.%{SOABI_optimized}.so -%{dynload_dir}/_codecs_kr.%{SOABI_optimized}.so -%{dynload_dir}/_codecs_tw.%{SOABI_optimized}.so -%{dynload_dir}/_contextvars.%{SOABI_optimized}.so -%{dynload_dir}/_csv.%{SOABI_optimized}.so -%{dynload_dir}/_ctypes.%{SOABI_optimized}.so -%{dynload_dir}/_curses.%{SOABI_optimized}.so -%{dynload_dir}/_curses_panel.%{SOABI_optimized}.so -%{dynload_dir}/_dbm.%{SOABI_optimized}.so -%{dynload_dir}/_decimal.%{SOABI_optimized}.so -%{dynload_dir}/_elementtree.%{SOABI_optimized}.so -%if %{with gdbm} -%{dynload_dir}/_gdbm.%{SOABI_optimized}.so -%endif -%{dynload_dir}/_hashlib.%{SOABI_optimized}.so -%{dynload_dir}/_heapq.%{SOABI_optimized}.so -%{dynload_dir}/_json.%{SOABI_optimized}.so -%{dynload_dir}/_lsprof.%{SOABI_optimized}.so -%{dynload_dir}/_lzma.%{SOABI_optimized}.so -%{dynload_dir}/_multibytecodec.%{SOABI_optimized}.so -%{dynload_dir}/_multiprocessing.%{SOABI_optimized}.so -%{dynload_dir}/_opcode.%{SOABI_optimized}.so -%{dynload_dir}/_pickle.%{SOABI_optimized}.so -%{dynload_dir}/_posixsubprocess.%{SOABI_optimized}.so -%{dynload_dir}/_queue.%{SOABI_optimized}.so -%{dynload_dir}/_random.%{SOABI_optimized}.so -%{dynload_dir}/_socket.%{SOABI_optimized}.so -%{dynload_dir}/_sqlite3.%{SOABI_optimized}.so -%{dynload_dir}/_ssl.%{SOABI_optimized}.so -%{dynload_dir}/_statistics.%{SOABI_optimized}.so -%{dynload_dir}/_struct.%{SOABI_optimized}.so -%{dynload_dir}/array.%{SOABI_optimized}.so -%{dynload_dir}/binascii.%{SOABI_optimized}.so -%{dynload_dir}/cmath.%{SOABI_optimized}.so -%{dynload_dir}/_datetime.%{SOABI_optimized}.so -%{dynload_dir}/fcntl.%{SOABI_optimized}.so -%{dynload_dir}/grp.%{SOABI_optimized}.so -%{dynload_dir}/math.%{SOABI_optimized}.so -%{dynload_dir}/mmap.%{SOABI_optimized}.so -%{dynload_dir}/_posixshmem.%{SOABI_optimized}.so -%{dynload_dir}/pyexpat.%{SOABI_optimized}.so -%{dynload_dir}/readline.%{SOABI_optimized}.so -%{dynload_dir}/resource.%{SOABI_optimized}.so -%{dynload_dir}/select.%{SOABI_optimized}.so -%{dynload_dir}/syslog.%{SOABI_optimized}.so -%{dynload_dir}/termios.%{SOABI_optimized}.so -%{dynload_dir}/unicodedata.%{SOABI_optimized}.so -%{dynload_dir}/_uuid.%{SOABI_optimized}.so -%{dynload_dir}/xxlimited.%{SOABI_optimized}.so -%{dynload_dir}/xxlimited_35.%{SOABI_optimized}.so -%{dynload_dir}/_xxsubinterpreters.%{SOABI_optimized}.so -%{dynload_dir}/xxsubtype.%{SOABI_optimized}.so -%{dynload_dir}/zlib.%{SOABI_optimized}.so -%{dynload_dir}/_zoneinfo.%{SOABI_optimized}.so - -%dir %{pylibdir}/site-packages/ -%dir %{pylibdir}/site-packages/__pycache__/ -%{pylibdir}/site-packages/README.txt +# This will be in the tkinter package +%exclude %{pylibdir}/turtle.py +%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} +# This will be in the debug package %if %{with debug_build} %exclude %{pylibdir}/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}.py %exclude %{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}%{bytecode_suffixes} %endif -%{pylibdir}/*.py -%dir %{pylibdir}/__pycache__/ -%{pylibdir}/__pycache__/*%{bytecode_suffixes} +# Extension modules +# This is macronized for reuse in the -debug package +%define extension_modules() \ +%{dynload_dir}/_asyncio.%{1}.so\ +%{dynload_dir}/_bisect.%{1}.so\ +%{dynload_dir}/_blake2.%{1}.so\ +%{dynload_dir}/_bz2.%{1}.so\ +%{dynload_dir}/_codecs_cn.%{1}.so\ +%{dynload_dir}/_codecs_hk.%{1}.so\ +%{dynload_dir}/_codecs_iso2022.%{1}.so\ +%{dynload_dir}/_codecs_jp.%{1}.so\ +%{dynload_dir}/_codecs_kr.%{1}.so\ +%{dynload_dir}/_codecs_tw.%{1}.so\ +%{dynload_dir}/_contextvars.%{1}.so\ +%{dynload_dir}/_csv.%{1}.so\ +%{dynload_dir}/_ctypes.%{1}.so\ +%{dynload_dir}/_curses.%{1}.so\ +%{dynload_dir}/_curses_panel.%{1}.so\ +%{dynload_dir}/_datetime.%{1}.so\ +%{dynload_dir}/_dbm.%{1}.so\ +%if %{with gdbm}\ +%{dynload_dir}/_gdbm.%{1}.so\ +%endif\ +%{dynload_dir}/_decimal.%{1}.so\ +%{dynload_dir}/_elementtree.%{1}.so\ +%{dynload_dir}/_hashlib.%{1}.so\ +%{dynload_dir}/_heapq.%{1}.so\ +%{dynload_dir}/_json.%{1}.so\ +%{dynload_dir}/_lsprof.%{1}.so\ +%{dynload_dir}/_lzma.%{1}.so\ +%{dynload_dir}/_md5.%{1}.so\ +%{dynload_dir}/_multibytecodec.%{1}.so\ +%{dynload_dir}/_multiprocessing.%{1}.so\ +%{dynload_dir}/_opcode.%{1}.so\ +%{dynload_dir}/_pickle.%{1}.so\ +%{dynload_dir}/_posixshmem.%{1}.so\ +%{dynload_dir}/_posixsubprocess.%{1}.so\ +%{dynload_dir}/_queue.%{1}.so\ +%{dynload_dir}/_random.%{1}.so\ +%{dynload_dir}/_sha1.%{1}.so\ +%{dynload_dir}/_sha2.%{1}.so\ +%{dynload_dir}/_sha3.%{1}.so\ +%{dynload_dir}/_socket.%{1}.so\ +%{dynload_dir}/_sqlite3.%{1}.so\ +%{dynload_dir}/_ssl.%{1}.so\ +%{dynload_dir}/_statistics.%{1}.so\ +%{dynload_dir}/_struct.%{1}.so\ +%{dynload_dir}/_uuid.%{1}.so\ +%{dynload_dir}/_xxsubinterpreters.%{1}.so\ +%{dynload_dir}/_zoneinfo.%{1}.so\ +%{dynload_dir}/array.%{1}.so\ +%{dynload_dir}/binascii.%{1}.so\ +%{dynload_dir}/cmath.%{1}.so\ +%{dynload_dir}/fcntl.%{1}.so\ +%{dynload_dir}/grp.%{1}.so\ +%{dynload_dir}/math.%{1}.so\ +%{dynload_dir}/mmap.%{1}.so\ +%{dynload_dir}/pyexpat.%{1}.so\ +%{dynload_dir}/readline.%{1}.so\ +%{dynload_dir}/resource.%{1}.so\ +%{dynload_dir}/select.%{1}.so\ +%{dynload_dir}/syslog.%{1}.so\ +%{dynload_dir}/termios.%{1}.so\ +%{dynload_dir}/unicodedata.%{1}.so\ +%{dynload_dir}/xxlimited.%{1}.so\ +%{dynload_dir}/xxlimited_35.%{1}.so\ +%{dynload_dir}/xxsubtype.%{1}.so\ +%{dynload_dir}/zlib.%{1}.so -%dir %{pylibdir}/collections/ -%dir %{pylibdir}/collections/__pycache__/ -%{pylibdir}/collections/*.py -%{pylibdir}/collections/__pycache__/*%{bytecode_suffixes} +%extension_modules %{SOABI_optimized} -%dir %{pylibdir}/ctypes/ -%dir %{pylibdir}/ctypes/__pycache__/ -%{pylibdir}/ctypes/*.py -%{pylibdir}/ctypes/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/ctypes/macholib - -%{pylibdir}/curses - -%dir %{pylibdir}/dbm/ -%dir %{pylibdir}/dbm/__pycache__/ -%{pylibdir}/dbm/*.py -%{pylibdir}/dbm/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/email/ -%dir %{pylibdir}/email/__pycache__/ -%{pylibdir}/email/*.py -%{pylibdir}/email/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/email/mime -%doc %{pylibdir}/email/architecture.rst - -%{pylibdir}/encodings - -%{pylibdir}/html -%{pylibdir}/http - -%dir %{pylibdir}/importlib/ -%dir %{pylibdir}/importlib/__pycache__/ -%{pylibdir}/importlib/*.py -%{pylibdir}/importlib/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/importlib/metadata/ -%dir %{pylibdir}/importlib/metadata/__pycache__/ -%{pylibdir}/importlib/metadata/*.py -%{pylibdir}/importlib/metadata/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/importlib/resources/ -%dir %{pylibdir}/importlib/resources/__pycache__/ -%{pylibdir}/importlib/resources/*.py -%{pylibdir}/importlib/resources/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/json/ -%dir %{pylibdir}/json/__pycache__/ -%{pylibdir}/json/*.py -%{pylibdir}/json/__pycache__/*%{bytecode_suffixes} - -%{pylibdir}/logging -%{pylibdir}/multiprocessing - -%dir %{pylibdir}/re/ -%{pylibdir}/re/*.py -%{pylibdir}/re/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/sqlite3/ -%dir %{pylibdir}/sqlite3/__pycache__/ -%{pylibdir}/sqlite3/*.py -%{pylibdir}/sqlite3/__pycache__/*%{bytecode_suffixes} - -%dir %{pylibdir}/tomllib/ -%{pylibdir}/tomllib/*.py -%{pylibdir}/tomllib/__pycache__/*%{bytecode_suffixes} -%exclude %{pylibdir}/turtle.py -%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} - -%{pylibdir}/urllib -%{pylibdir}/xml - -%dir %{pylibdir}/zipfile/ -%{pylibdir}/zipfile/*.py -%{pylibdir}/zipfile/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/zipfile/_path/*.py -%{pylibdir}/zipfile/_path/__pycache__/*%{bytecode_suffixes} - -%{pylibdir}/zoneinfo - -%dir %{pylibdir}/__phello__ -%{pylibdir}/__phello__/__init__.py -%{pylibdir}/__phello__/spam.py -%{pylibdir}/__phello__/__pycache__/*%{bytecode_suffixes} +%dir %{pylibdir}/site-packages/ +%dir %{pylibdir}/site-packages/__pycache__/ +%{pylibdir}/site-packages/README.txt %if "%{_lib}" == "lib64" -%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever} -%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages +%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/ +%attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/ %attr(0755,root,root) %dir %{_prefix}/lib/python%{pybasever}/site-packages/__pycache__/ %endif @@ -1419,6 +1345,7 @@ CheckPython optimized %dir %{_includedir}/python%{LDVERSION_optimized}/ %{_includedir}/python%{LDVERSION_optimized}/%{_pyconfig_h} +# Finally, libpython %{_libdir}/%{py_INSTSONAME_optimized} %if %{with main_python} %{_libdir}/libpython3.so @@ -1487,25 +1414,31 @@ CheckPython optimized %files -n %{pkgname}-test -%{pylibdir}/test -%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so -%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so -%{dynload_dir}/_testcapi.%{SOABI_optimized}.so -%{dynload_dir}/_testclinic.%{SOABI_optimized}.so -%{dynload_dir}/_testclinic_limited.%{SOABI_optimized}.so -%{dynload_dir}/_testimportmultiple.%{SOABI_optimized}.so -%{dynload_dir}/_testinternalcapi.%{SOABI_optimized}.so -%{dynload_dir}/_testmultiphase.%{SOABI_optimized}.so -%{dynload_dir}/_testsinglephase.%{SOABI_optimized}.so -%{dynload_dir}/_xxinterpchannels.%{SOABI_optimized}.so -%{dynload_dir}/_xxtestfuzz.%{SOABI_optimized}.so +%{pylibdir}/test/ + +# Extension modules +# This is macronized for reuse in the -debug package +%define extension_modules_test() \ +%{dynload_dir}/_ctypes_test.%{1}.so\ +%{dynload_dir}/_testbuffer.%{1}.so\ +%{dynload_dir}/_testcapi.%{1}.so\ +%{dynload_dir}/_testclinic.%{1}.so\ +%{dynload_dir}/_testclinic_limited.%{1}.so\ +%{dynload_dir}/_testimportmultiple.%{1}.so\ +%{dynload_dir}/_testinternalcapi.%{1}.so\ +%{dynload_dir}/_testmultiphase.%{1}.so\ +%{dynload_dir}/_testsinglephase.%{1}.so\ +%{dynload_dir}/_xxinterpchannels.%{1}.so\ +%{dynload_dir}/_xxtestfuzz.%{1}.so + +%extension_modules_test %{SOABI_optimized} + # We don't bother splitting the debug build out into further subpackages: -# if you need it, you're probably a developer. +# if you need it, you're debugging and you probably don't mind having it all. # Hence the manifest is the combination of analogous files in the manifests of # all of the other subpackages - %if %{with debug_build} %files -n %{pkgname}-debug %if %{with main_python} @@ -1516,85 +1449,17 @@ CheckPython optimized # Analog of the core subpackage's files: %{_bindir}/python%{LDVERSION_debug} -# Analog of the -libs subpackage's files: -# ...with debug builds of the built-in "extension" modules: - -%{dynload_dir}/_blake2.%{SOABI_debug}.so -%{dynload_dir}/_md5.%{SOABI_debug}.so -%{dynload_dir}/_sha1.%{SOABI_debug}.so -%{dynload_dir}/_sha2.%{SOABI_debug}.so -%{dynload_dir}/_sha3.%{SOABI_debug}.so - -%{dynload_dir}/_asyncio.%{SOABI_debug}.so -%{dynload_dir}/_bisect.%{SOABI_debug}.so -%{dynload_dir}/_bz2.%{SOABI_debug}.so -%{dynload_dir}/_codecs_cn.%{SOABI_debug}.so -%{dynload_dir}/_codecs_hk.%{SOABI_debug}.so -%{dynload_dir}/_codecs_iso2022.%{SOABI_debug}.so -%{dynload_dir}/_codecs_jp.%{SOABI_debug}.so -%{dynload_dir}/_codecs_kr.%{SOABI_debug}.so -%{dynload_dir}/_codecs_tw.%{SOABI_debug}.so -%{dynload_dir}/_contextvars.%{SOABI_debug}.so -%{dynload_dir}/_csv.%{SOABI_debug}.so -%{dynload_dir}/_ctypes.%{SOABI_debug}.so -%{dynload_dir}/_curses.%{SOABI_debug}.so -%{dynload_dir}/_curses_panel.%{SOABI_debug}.so -%{dynload_dir}/_dbm.%{SOABI_debug}.so -%{dynload_dir}/_decimal.%{SOABI_debug}.so -%{dynload_dir}/_elementtree.%{SOABI_debug}.so -%if %{with gdbm} -%{dynload_dir}/_gdbm.%{SOABI_debug}.so -%endif -%{dynload_dir}/_hashlib.%{SOABI_debug}.so -%{dynload_dir}/_heapq.%{SOABI_debug}.so -%{dynload_dir}/_json.%{SOABI_debug}.so -%{dynload_dir}/_lsprof.%{SOABI_debug}.so -%{dynload_dir}/_lzma.%{SOABI_debug}.so -%{dynload_dir}/_multibytecodec.%{SOABI_debug}.so -%{dynload_dir}/_multiprocessing.%{SOABI_debug}.so -%{dynload_dir}/_opcode.%{SOABI_debug}.so -%{dynload_dir}/_pickle.%{SOABI_debug}.so -%{dynload_dir}/_posixsubprocess.%{SOABI_debug}.so -%{dynload_dir}/_queue.%{SOABI_debug}.so -%{dynload_dir}/_random.%{SOABI_debug}.so -%{dynload_dir}/_socket.%{SOABI_debug}.so -%{dynload_dir}/_sqlite3.%{SOABI_debug}.so -%{dynload_dir}/_ssl.%{SOABI_debug}.so -%{dynload_dir}/_statistics.%{SOABI_debug}.so -%{dynload_dir}/_struct.%{SOABI_debug}.so -%{dynload_dir}/array.%{SOABI_debug}.so -%{dynload_dir}/binascii.%{SOABI_debug}.so -%{dynload_dir}/cmath.%{SOABI_debug}.so -%{dynload_dir}/_datetime.%{SOABI_debug}.so -%{dynload_dir}/fcntl.%{SOABI_debug}.so -%{dynload_dir}/grp.%{SOABI_debug}.so -%{dynload_dir}/math.%{SOABI_debug}.so -%{dynload_dir}/mmap.%{SOABI_debug}.so -%{dynload_dir}/_posixshmem.%{SOABI_debug}.so -%{dynload_dir}/pyexpat.%{SOABI_debug}.so -%{dynload_dir}/readline.%{SOABI_debug}.so -%{dynload_dir}/resource.%{SOABI_debug}.so -%{dynload_dir}/select.%{SOABI_debug}.so -%{dynload_dir}/syslog.%{SOABI_debug}.so -%{dynload_dir}/termios.%{SOABI_debug}.so -%{dynload_dir}/unicodedata.%{SOABI_debug}.so -%{dynload_dir}/_uuid.%{SOABI_debug}.so -%{dynload_dir}/xxlimited.%{SOABI_debug}.so -%{dynload_dir}/xxlimited_35.%{SOABI_debug}.so -%{dynload_dir}/_xxsubinterpreters.%{SOABI_debug}.so -%{dynload_dir}/xxsubtype.%{SOABI_debug}.so -%{dynload_dir}/zlib.%{SOABI_debug}.so -%{dynload_dir}/_zoneinfo.%{SOABI_debug}.so - -# No need to split things out the "Makefile" and the config-32/64.h file as we -# do for the regular build above (bug 531901), since they're all in one package -# now; they're listed below, under "-devel": - +# Analog to the -libs subpackage's files: %{_libdir}/%{py_INSTSONAME_debug} +# Analog of the libs, test, and tkinter extension modules: +%extension_modules %{SOABI_debug} +%extension_modules_test %{SOABI_debug} +%{dynload_dir}/_tkinter.%{SOABI_debug}.so + # Analog of the -devel subpackage's files: -%{pylibdir}/config-%{LDVERSION_debug}-%{platform_triplet} -%{_includedir}/python%{LDVERSION_debug} +%{pylibdir}/config-%{LDVERSION_debug}-%{platform_triplet}/ +%{_includedir}/python%{LDVERSION_debug}/ %{_bindir}/python%{LDVERSION_debug}-config %{_bindir}/python%{LDVERSION_debug}-*-config %{_libdir}/libpython%{LDVERSION_debug}.so @@ -1602,26 +1467,6 @@ CheckPython optimized %{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc %{_libdir}/pkgconfig/python-%{LDVERSION_debug}-embed.pc -# Analog of the -tools subpackage's files: -# None for now; we could build precanned versions that have the appropriate -# shebang if needed - -# Analog of the tkinter subpackage's files: -%{dynload_dir}/_tkinter.%{SOABI_debug}.so - -# Analog of the -test subpackage's files: -%{dynload_dir}/_ctypes_test.%{SOABI_debug}.so -%{dynload_dir}/_testbuffer.%{SOABI_debug}.so -%{dynload_dir}/_testcapi.%{SOABI_debug}.so -%{dynload_dir}/_testclinic.%{SOABI_debug}.so -%{dynload_dir}/_testclinic_limited.%{SOABI_debug}.so -%{dynload_dir}/_testimportmultiple.%{SOABI_debug}.so -%{dynload_dir}/_testinternalcapi.%{SOABI_debug}.so -%{dynload_dir}/_testmultiphase.%{SOABI_debug}.so -%{dynload_dir}/_testsinglephase.%{SOABI_debug}.so -%{dynload_dir}/_xxinterpchannels.%{SOABI_debug}.so -%{dynload_dir}/_xxtestfuzz.%{SOABI_debug}.so - %{pylibdir}/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}.py %{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}%{bytecode_suffixes} From f7b147540fd9d372072ad6921829b7340e5334dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 29 Nov 2023 15:50:27 +0100 Subject: [PATCH 002/115] Remove a duplicate %files entry for /usr/lib64/libpython3.Xd.so.1.0 This file is already listed as %{_libdir}/%{py_INSTSONAME_debug}. The relevant nondebug file is in -libs, not -devel. --- python3.13.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 33e947d..2eb5fa0 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1463,7 +1463,6 @@ CheckPython optimized %{_bindir}/python%{LDVERSION_debug}-config %{_bindir}/python%{LDVERSION_debug}-*-config %{_libdir}/libpython%{LDVERSION_debug}.so -%{_libdir}/libpython%{LDVERSION_debug}.so.%{py_SOVERSION} %{_libdir}/pkgconfig/python-%{LDVERSION_debug}.pc %{_libdir}/pkgconfig/python-%{LDVERSION_debug}-embed.pc From 84d78b385a57306af12b04922f60d516e6e8be49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 30 Oct 2023 14:29:53 +0100 Subject: [PATCH 003/115] Add the python3.13-freethreading and python3.13-freethreading-debug packages - See https://peps.python.org/pep-0703/ --- python3.13.spec | 185 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 175 insertions(+), 10 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 2eb5fa0..068fe14 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -136,6 +136,10 @@ Provides: bundled(python3dist(packaging)) = 23 # (the -debug subpackages) %bcond_without debug_build +# Extra build without GIL, the freethreading PEP 703 provisional way +# (the -freethreading subpackage) +%bcond_without freethreading_build + # Support for the GDB debugger %bcond_without gdb_hooks @@ -168,11 +172,15 @@ Provides: bundled(python3dist(packaging)) = 23 # ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac # See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/ -%global ABIFLAGS_optimized %{nil} -%global ABIFLAGS_debug d +%global ABIFLAGS_optimized %{nil} +%global ABIFLAGS_debug d +%global ABIFLAGS_freethreading t +%global ABIFLAGS_freethreading_debug td -%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} -%global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} +%global LDVERSION_optimized %{pybasever}%{ABIFLAGS_optimized} +%global LDVERSION_debug %{pybasever}%{ABIFLAGS_debug} +%global LDVERSION_freethreading %{pybasever}%{ABIFLAGS_freethreading} +%global LDVERSION_freethreading_debug %{pybasever}%{ABIFLAGS_freethreading_debug} # We use the upstream arch triplets, we convert them from %%{_arch}-linux%%{_gnu} %global platform_triplet %{expand:%(echo %{_arch}-linux%{_gnu} | sed -E \\ @@ -180,8 +188,10 @@ Provides: bundled(python3dist(packaging)) = 23 -e 's/^mips64(el)?-linux-gnu$/mips64\\1-linux-gnuabi64/' \\ -e 's/^ppc(64)?(le)?-linux-gnu$/powerpc\\1\\2-linux-gnu/')} -%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{platform_triplet} -%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{platform_triplet} +%global SOABI_optimized cpython-%{pyshortver}%{ABIFLAGS_optimized}-%{platform_triplet} +%global SOABI_debug cpython-%{pyshortver}%{ABIFLAGS_debug}-%{platform_triplet} +%global SOABI_freethreading cpython-%{pyshortver}%{ABIFLAGS_freethreading}-%{platform_triplet} +%global SOABI_freethreading_debug cpython-%{pyshortver}%{ABIFLAGS_freethreading_debug}-%{platform_triplet} # All bytecode files are in a __pycache__ subdirectory, with a name # reflecting the version of the bytecode. @@ -202,8 +212,10 @@ Provides: bundled(python3dist(packaging)) = 23 # (if these get out of sync, the payload of the libs subpackage will fail # and halt the build) %global py_SOVERSION 1.0 -%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} -%global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} +%global py_INSTSONAME_optimized libpython%{LDVERSION_optimized}.so.%{py_SOVERSION} +%global py_INSTSONAME_debug libpython%{LDVERSION_debug}.so.%{py_SOVERSION} +%global py_INSTSONAME_freethreading libpython%{LDVERSION_freethreading}.so.%{py_SOVERSION} +%global py_INSTSONAME_freethreading_debug libpython%{LDVERSION_freethreading_debug}.so.%{py_SOVERSION} # Disable automatic bytecompilation. The python3 binary is not yet be # available in /usr/bin when Python is built. Also, the bytecompilation fails @@ -659,6 +671,67 @@ The debug runtime additionally supports debug builds of C-API extensions %endif # with debug_build +%if %{with freethreading_build} +# This deliberately does not use the %%{pkgname}- prefix, +# we want to call this python3.X-threading even when built as a main Python. +# At least until the PEP 703 build remains provisional. +%package -n python%{pybasever}-freethreading +Summary: Free Threading (PEP 703) version of the Python runtime + +# The freethreading build is an all-in-one package version of the regular build, and +# shares the same .py/.pyc files and directories as the regular build. Hence +# we depend on all of the subpackages of the regular build: +Requires: %{pkgname}%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-devel%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-test%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-tkinter%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release} + +%description -n python%{pybasever}-freethreading +The provisional Free Threading (PEP 703) build of Python. + +CPython’s global interpreter lock (“GIL”) prevents multiple threads from +executing Python code at the same time. The GIL is an obstacle to using +multi-core CPUs from Python efficiently. + +This build of Python is built with the --disable-gil option. +It lets the interpreter run Python code without the global interpreter lock +and with the necessary changes needed to make the interpreter thread-safe. +%endif # with freethreading_build + + +%if %{with freethreading_build} && %{with debug_build} +%package -n python%{pybasever}-freethreading-debug +Summary: Free Threading (PEP 703) version of the Python runtime (debug build) + +# The debug build is an all-in-one package version of the regular build, and +# shares the same .py/.pyc files and directories as the regular build. Hence +# we depend on all of the subpackages of the regular build: +Requires: %{pkgname}%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-devel%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-test%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-tkinter%{?_isa} = %{version}-%{release} +Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release} + +%description -n python%{pybasever}-freethreading-debug +The provisional Free Threading (PEP 703) build of Python. Debug build. + +CPython’s global interpreter lock (“GIL”) prevents multiple threads from +executing Python code at the same time. The GIL is an obstacle to using +multi-core CPUs from Python efficiently. + +This build of Python is built with the --disable-gil option. +It lets the interpreter run Python code without the global interpreter lock +and with the necessary changes needed to make the interpreter thread-safe. + +This package provides a version of the Python runtime with numerous debugging +features enabled, aimed at advanced Python users such as developers of Python +extension modules. +%endif # with freethreading_build && debug_build + + # ====================================================== # The prep phase of the build: # ====================================================== @@ -820,6 +893,18 @@ BuildPython optimized \ "--without-ensurepip %{optimizations_flag}" \ "" +%if %{with freethreading_build} && %{with debug_build} +BuildPython freethreading-debug \ + "--without-ensurepip --with-pydebug --disable-gil" \ + "-O0 -Wno-cpp" +%endif # with freethreading_build && debug_build + +%if %{with freethreading_build} +BuildPython freethreading \ + "--without-ensurepip %{optimizations_flag} --disable-gil" \ + "" +%endif # with freethreading_build + # ====================================================== # Installing the built code: # ====================================================== @@ -918,8 +1003,16 @@ EOF echo FINISHED: INSTALL OF PYTHON FOR CONFIGURATION: $ConfName } -# Install the "debug" build first; any common files will be overridden with +# Install the "freethreading" and "debug" builds first; any common files will be overridden with # later builds +%if %{with freethreading_build} && %{with debug_build} +# Now the freethreading debug build: +InstallPython freethreading-debug \ + %{py_INSTSONAME_freethreading_debug} \ + "" \ + %{LDVERSION_freethreading_debug} +%endif # with freethreading_build && debug_build + %if %{with debug_build} InstallPython debug \ %{py_INSTSONAME_debug} \ @@ -927,6 +1020,14 @@ InstallPython debug \ %{LDVERSION_debug} %endif # with debug_build +%if %{with freethreading_build} +# Now the freethreading optimized build: +InstallPython freethreading \ + %{py_INSTSONAME_freethreading} \ + "" \ + %{LDVERSION_freethreading} +%endif # with freethreading_build + # Now the optimized build: InstallPython optimized \ %{py_INSTSONAME_optimized} \ @@ -1160,6 +1261,12 @@ CheckPython() { CheckPython debug %endif # with debug_build CheckPython optimized +%if %{with freethreading_build} && %{with debug_build} +CheckPython freethreading-debug +%endif # with freethreading_build && debug_build +%if %{with freethreading_build} +CheckPython freethreading +%endif # with freethreading_build %endif # with tests @@ -1471,6 +1578,60 @@ CheckPython optimized %endif # with debug_build +%if %{with freethreading_build} +%files -n python%{pybasever}-freethreading +# Analog of the core subpackage's files: +%{_bindir}/python%{LDVERSION_freethreading} + +# Analog to the -libs subpackage's files: +%{_libdir}/%{py_INSTSONAME_freethreading} + +# Analog of the libs, test, and tkinter extension modules: +%extension_modules %{SOABI_freethreading} +%extension_modules_test %{SOABI_freethreading} +%{dynload_dir}/_tkinter.%{SOABI_freethreading}.so + +# Analog of the -devel subpackage's files: +%{pylibdir}/config-%{LDVERSION_freethreading}-%{platform_triplet}/ +%{_includedir}/python%{LDVERSION_freethreading}/ +%{_bindir}/python%{LDVERSION_freethreading}-config +%{_bindir}/python%{LDVERSION_freethreading}-*-config +%{_libdir}/libpython%{LDVERSION_freethreading}.so +%{_libdir}/pkgconfig/python-%{LDVERSION_freethreading}.pc +%{_libdir}/pkgconfig/python-%{LDVERSION_freethreading}-embed.pc + +%{pylibdir}/_sysconfigdata_%{ABIFLAGS_freethreading}_linux_%{platform_triplet}.py +%{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_freethreading}_linux_%{platform_triplet}%{bytecode_suffixes} + +%endif # with freethreading_build + +%if %{with freethreading_build} && %{with debug_build} +%files -n python%{pybasever}-freethreading-debug +# Analog of the core subpackage's files: +%{_bindir}/python%{LDVERSION_freethreading_debug} + +# Analog to the -libs subpackage's files: +%{_libdir}/%{py_INSTSONAME_freethreading_debug} + +# Analog of the libs, test, and tkinter extension modules: +%extension_modules %{SOABI_freethreading_debug} +%extension_modules_test %{SOABI_freethreading_debug} +%{dynload_dir}/_tkinter.%{SOABI_freethreading_debug}.so + +# Analog of the -devel subpackage's files: +%{pylibdir}/config-%{LDVERSION_freethreading_debug}-%{platform_triplet}/ +%{_includedir}/python%{LDVERSION_freethreading_debug}/ +%{_bindir}/python%{LDVERSION_freethreading_debug}-config +%{_bindir}/python%{LDVERSION_freethreading_debug}-*-config +%{_libdir}/libpython%{LDVERSION_freethreading_debug}.so +%{_libdir}/pkgconfig/python-%{LDVERSION_freethreading_debug}.pc +%{_libdir}/pkgconfig/python-%{LDVERSION_freethreading_debug}-embed.pc + +%{pylibdir}/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}.py +%{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}%{bytecode_suffixes} + +%endif # with freethreading_build && debug_build + # We put the debug-gdb.py file inside /usr/lib/debug to avoid noise from ldconfig # See https://bugzilla.redhat.com/show_bug.cgi?id=562980 # @@ -1492,6 +1653,10 @@ CheckPython optimized # ====================================================== %changelog +* Tue Dec 05 2023 Miro Hrončok - 3.13.0~a2-2 +- Add the python3.13-freethreading and python3.13-freethreading-debug packages +- See https://peps.python.org/pep-0703/ + * Fri Nov 24 2023 Karolina Surma - 3.13.0~a2-1 - Update to Python 3.13.0a2 From 2da1bb9f6d7ee905dfb8c1e982eced9fa7143b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 6 Dec 2023 11:52:56 +0100 Subject: [PATCH 004/115] Don't build the freethreding packages on ppc64le/s390x for now See https://github.com/python/cpython/issues/112535 And https://github.com/python/cpython/pull/112624 And https://github.com/python/cpython/pull/112751 Rather than backporting a handful of small commits, let's wait for the next release. --- python3.13.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index 068fe14..1f704af 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -138,7 +138,13 @@ Provides: bundled(python3dist(packaging)) = 23 # Extra build without GIL, the freethreading PEP 703 provisional way # (the -freethreading subpackage) +# support for the excluded arches is being added upstream and is expected to land in 3.13.0a3 +# https://github.com/python/cpython/issues/112535 +%ifnarch ppc64le s390x %bcond_without freethreading_build +%else +%bcond_with freethreading_build +%endif # Support for the GDB debugger %bcond_without gdb_hooks @@ -1656,6 +1662,7 @@ CheckPython freethreading * Tue Dec 05 2023 Miro Hrončok - 3.13.0~a2-2 - Add the python3.13-freethreading and python3.13-freethreading-debug packages - See https://peps.python.org/pep-0703/ +- ppc64le and s390x are excluded for now, support is expected in 3.13.0a3 * Fri Nov 24 2023 Karolina Surma - 3.13.0~a2-1 - Update to Python 3.13.0a2 From c01336e5dcfbedd316aaa9be157fd520e7fe957b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 6 Dec 2023 14:19:18 +0100 Subject: [PATCH 005/115] Update rpmlint.toml with regards to the freethreading builds --- rpmlint.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rpmlint.toml b/rpmlint.toml index b532441..2b157ef 100644 --- a/rpmlint.toml +++ b/rpmlint.toml @@ -52,10 +52,10 @@ Filters = [ # manual pages 'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3?-debug|pathfix|msgfmt|pygettext)', 'no-manual-page-for-binary python3?.*-config$', - 'no-manual-page-for-binary python3\.\d+dm?$', + 'no-manual-page-for-binary python3\.\d+t?dm?$', # missing documentation from subpackages - '^python3(\.\d+)?-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation', + '^python3(\.\d+)?-(freethreading(-debug)?|debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation', # platform python is obsoleted, but not provided 'obsolete-not-provided platform-python', @@ -77,13 +77,13 @@ Filters = [ # this is OK for F28+ 'library-without-ldconfig-post', - # debug package contains devel and non-devel files - 'python3(\.\d+)?-debug\.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package', + # freethreading/debug package contains devel and non-devel files + 'python3(\.\d+)?-(freethreading(-debug)?|debug)\.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package', # this goes to other subpackage, hence not actually dangling 'dangling-relative-symlink /usr/bin/python python3', 'dangling-relative-symlink /usr/share/man/man1/python\.1\.gz python3\.1\.gz', - 'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\d+dm?(-embed)?\.pc python-3\.\d+(-embed)?\.pc', + 'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\d+t?d?m?(-embed)?\.pc python-3\.\d+t?(-embed)?\.pc', # the python-unversioned-command package contains dangling symlinks by design '^python-unversioned-command\.[^:]+: (E|W): dangling-relative-symlink (/usr/bin/python \./python3|/usr/share/man/man1/python\.1\S* ./python3\.1\S*)$', From f0b75f2c21ec0f9ffe129cc2dfbc4fe17b1de4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Thu, 4 Jan 2024 12:54:41 +0100 Subject: [PATCH 006/115] Require python3-rpm-generators even when bootstrapping non-main Pythons --- python3.13.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 1f704af..1a9a5f8 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -325,6 +325,9 @@ BuildRequires: %{python_wheel_pkg_prefix}-wheel-wheel # upgrading the main python3 to a new Python version, this would pull in the # old version instead. BuildRequires: python%{pybasever} +%endif + +%if %{without bootstrap} || %{without main_python} # for proper automatic provides BuildRequires: python3-rpm-generators %endif @@ -561,7 +564,8 @@ Recommends: %{pkgname}-pip # tox users are likely to need the devel subpackage Supplements: tox -%if %{without bootstrap} +%if %{without bootstrap} || %{without main_python} +# Generators run on the main Python 3 so we cannot require them when bootstrapping it Requires: (python3-rpm-generators if rpm-build) %endif From 864b42948f912932cfccd69d9b595b2df34489db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 8 Jan 2024 13:16:49 +0100 Subject: [PATCH 007/115] Update the comment for the bootstrap bcond --- python3.13.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 1a9a5f8..8277fcd 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -47,9 +47,9 @@ License: Python-2.0.1 %bcond_without python_abi_provides_for_alt_pythons %endif -# When bootstrapping python3, we need to build setuptools. -# but setuptools BR python3-devel and that brings in python3-rpm-generators; -# python3-rpm-generators needs python3-setuptools, so we cannot have it yet. +# When bootstrapping python3, we need to build python3-packaging. +# but packaging BR python3-devel and that brings in python3-rpm-generators; +# python3-rpm-generators needs python3-packaging, so we cannot have it yet. # # We also use the previous build of Python in "make regen-all". # From f6915d7e27fba43230fedf1ecc093b1630ec59b0 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 18 Jan 2024 10:18:46 +0100 Subject: [PATCH 008/115] Update to Python 3.13.0a3 --- 00251-change-user-install-location.patch | 29 +++++++++-------- ...or-the-main-thread-gh-28549-gh-28589.patch | 2 +- ...on-t-generate-sbom-in-make-regen-all.patch | 32 +++++++++++++++++++ python3.13.spec | 30 +++++++++++++---- sources | 4 +-- 5 files changed, 73 insertions(+), 24 deletions(-) create mode 100644 00418-don-t-generate-sbom-in-make-regen-all.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 9383ef3..dc8bcae 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -25,15 +25,15 @@ Co-authored-by: Michal Cyprian Co-authored-by: Lumír Balhar --- Lib/site.py | 9 ++++++- - Lib/sysconfig/__init__.py | 49 +++++++++++++++++++++++++++++++++++++- + Lib/sysconfig/__init__.py | 50 +++++++++++++++++++++++++++++++++++++- Lib/test/test_sysconfig.py | 17 +++++++++++-- - 3 files changed, 71 insertions(+), 4 deletions(-) + 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index 672fa7b000..0a9c5be53e 100644 +index 0631f3f611..2ed7b683a0 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -377,8 +377,15 @@ def getsitepackages(prefixes=None): +@@ -395,8 +395,15 @@ def getsitepackages(prefixes=None): return sitepackages def addsitepackages(known_paths, prefixes=None): @@ -51,10 +51,10 @@ index 672fa7b000..0a9c5be53e 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 2a7fa45be0..7b75228fb3 100644 +index 07ab27c7fb..d3e22762bf 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py -@@ -104,6 +104,11 @@ +@@ -104,6 +104,12 @@ else: _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_venv'] @@ -63,10 +63,11 @@ index 2a7fa45be0..7b75228fb3 100644 +# For backwards compatibility, we keep it here (at least on 3.10 and 3.11). +_INSTALL_SCHEMES['rpm_prefix'] = _INSTALL_SCHEMES['posix_prefix'] + ++ + def _get_implementation(): + return 'Python' - # NOTE: site.py has copy of this function. - # Sync it when modify this function. -@@ -163,6 +168,19 @@ def joinuser(*args): +@@ -165,6 +171,19 @@ def joinuser(*args): }, } @@ -86,7 +87,7 @@ index 2a7fa45be0..7b75228fb3 100644 _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', 'scripts', 'data') -@@ -257,11 +275,40 @@ def _extend_dict(target_dict, other_dict): +@@ -259,11 +278,40 @@ def _extend_dict(target_dict, other_dict): target_dict[key] = value @@ -129,10 +130,10 @@ index 2a7fa45be0..7b75228fb3 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 2a6813f00b..00d7034801 100644 +index be609a0abd..8269f48c6d 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py -@@ -113,8 +113,19 @@ def test_get_path(self): +@@ -115,8 +115,19 @@ def test_get_path(self): for scheme in _INSTALL_SCHEMES: for name in _INSTALL_SCHEMES[scheme]: expected = _INSTALL_SCHEMES[scheme][name].format(**config_vars) @@ -153,7 +154,7 @@ index 2a6813f00b..00d7034801 100644 os.path.normpath(expected), ) -@@ -338,7 +349,7 @@ def test_get_config_h_filename(self): +@@ -340,7 +351,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -162,7 +163,7 @@ index 2a6813f00b..00d7034801 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -350,6 +361,8 @@ def test_symlink(self): # Issue 7880 +@@ -352,6 +363,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch b/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch index b536ae0..4639352 100644 --- a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +++ b/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch @@ -16,7 +16,7 @@ https://github.com/GrahamDumpleton/mod_wsgi/issues/730 2 files changed, 11 insertions(+), 53 deletions(-) diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py -index 146e2dbc0f..af63422c6c 100644 +index 3060af44fd..4c7afe648d 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1056,39 +1056,6 @@ def noop(): pass diff --git a/00418-don-t-generate-sbom-in-make-regen-all.patch b/00418-don-t-generate-sbom-in-make-regen-all.patch new file mode 100644 index 0000000..36bf09c --- /dev/null +++ b/00418-don-t-generate-sbom-in-make-regen-all.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Fri, 19 Jan 2024 12:00:18 +0100 +Subject: [PATCH] 00418: Don't generate sbom in make regen-all + +The script and make target, added in Python 3.13.0a3, assumes a fixed +location of pip wheel and other bundled libraries, resulting in an +error and failed build when not found. +Reported upstream: https://github.com/python/cpython/issues/114240 +and https://github.com/python/cpython/issues/114244 +--- + Makefile.pre.in | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 289ab97666..1058fac8cc 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1364,10 +1364,11 @@ regen-unicodedata: + regen-all: regen-cases regen-typeslots \ + regen-token regen-ast regen-keyword regen-sre regen-frozen \ + regen-pegen-metaparser regen-pegen regen-test-frozenmain \ +- regen-test-levenshtein regen-global-objects regen-sbom ++ regen-test-levenshtein regen-global-objects + @echo + @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, " +- @echo "make regen-configure and make regen-unicodedata should be run manually" ++ @echo "make regen-configure, make regen-unicodedata and make regen-sbom " ++ @echo "should be run manually" + + ############################################################################ + # Special rules for object files diff --git a/python3.13.spec b/python3.13.spec index 8277fcd..ce12b34 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel a2 +%global prerel a3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -71,15 +71,15 @@ License: Python-2.0.1 # If the rpmwheels condition is disabled, we use the bundled wheel packages # from Python with the versions below. # This needs to be manually updated when we update Python. -%global pip_version 23.2.1 +%global pip_version 23.3.2 %global setuptools_version 67.6.1 %global wheel_version 0.40.0 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: -Provides: bundled(python3dist(cachecontrol)) = 0.12.11 -Provides: bundled(python3dist(certifi)) = 2023.5.7 +Provides: bundled(python3dist(cachecontrol)) = 0.13.1 +Provides: bundled(python3dist(certifi)) = 2023.7.22 Provides: bundled(python3dist(chardet)) = 5.1 Provides: bundled(python3dist(colorama)) = 0.4.6 Provides: bundled(python3dist(distlib)) = 0.3.6 @@ -98,8 +98,9 @@ Provides: bundled(python3dist(setuptools)) = 68 Provides: bundled(python3dist(six)) = 1.16 Provides: bundled(python3dist(tenacity)) = 8.2.2 Provides: bundled(python3dist(tomli)) = 2.0.1 +Provides: bundled(python3dist(truststore)) = 0.8 Provides: bundled(python3dist(typing-extensions)) = 4.7.1 -Provides: bundled(python3dist(urllib3)) = 1.26.16 +Provides: bundled(python3dist(urllib3)) = 1.26.17 Provides: bundled(python3dist(webencodings)) = 0.5.1 } # setuptools @@ -354,7 +355,7 @@ Source11: idle3.appdata.xml # (Patches taken from github.com/fedora-python/cpython) -# 00251 # 758eb29fbfe9253ab343e8a09a480a6b64e57df8 +# 00251 # 60dd97be7bf3662ff65edd8471e948924b4175b2 # Change user install location # # Set values of base and platbase in sysconfig from /usr @@ -382,6 +383,16 @@ Patch251: 00251-change-user-install-location.patch # https://github.com/GrahamDumpleton/mod_wsgi/issues/730 Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +# 00418 # 7044fbb05d0825f5fd9733a6491bb5bea904fab1 +# Don't generate sbom in make regen-all +# +# The script and make target, added in Python 3.13.0a3, assumes a fixed +# location of pip wheel and other bundled libraries, resulting in an +# error and failed build when not found. +# Reported upstream: https://github.com/python/cpython/issues/114240 +# and https://github.com/python/cpython/issues/114244 +Patch418: 00418-don-t-generate-sbom-in-make-regen-all.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1329,6 +1340,7 @@ CheckPython freethreading %{pylibdir}/json/ %{pylibdir}/logging/ %{pylibdir}/multiprocessing/ +%{pylibdir}/pathlib/ %{pylibdir}/pydoc_data/ %{pylibdir}/re/ %{pylibdir}/sqlite3/ @@ -1421,6 +1433,7 @@ CheckPython freethreading %{dynload_dir}/_statistics.%{1}.so\ %{dynload_dir}/_struct.%{1}.so\ %{dynload_dir}/_uuid.%{1}.so\ +%{dynload_dir}/_xxinterpqueues.%{1}.so\ %{dynload_dir}/_xxsubinterpreters.%{1}.so\ %{dynload_dir}/_zoneinfo.%{1}.so\ %{dynload_dir}/array.%{1}.so\ @@ -1663,6 +1676,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Jan 18 2024 Karolina Surma - 3.13.0~a3-1 +- Update to Python 3.13.0a3 + * Tue Dec 05 2023 Miro Hrončok - 3.13.0~a2-2 - Add the python3.13-freethreading and python3.13-freethreading-debug packages - See https://peps.python.org/pep-0703/ diff --git a/sources b/sources index 15f25bf..52bf88e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0a2.tar.xz) = 2702f630ebb49a835c213656f2f0d41f87daf2dad6b856821f4011f4614c19279656eaa1dad9f1cbfd258992aa5f59d4571577057c6a4ad1cdcfa4d8ada3b607 -SHA512 (Python-3.13.0a2.tar.xz.asc) = c6a0101b844701fcd860a519ec4830bde0df486ea78377831544dbe0db25dd67c28360f46d5ef01db64aa4347cf7b0d489590f6dc91e768b16753228f2c93b25 +SHA512 (Python-3.13.0a3.tar.xz) = 0cabe30ca97f89df7da35684dda9ac8a3018fb7547d97f595e7883323809fdb99ff02c48719d71fb12abdacda1fc86f0ca15b1d27717e941cdc0b31c72fd63bb +SHA512 (Python-3.13.0a3.tar.xz.asc) = 91efe8e66085e4b60b565130a8ab43b3772e3dafe25fa6266900a8c19004082bcfd7e72e6e5293dc5bc3330ea2db233365d1028ef3b86ee4bb7df1246b6641b0 From 1fd7efe73588d4355828d58c70c7c9f3f816c145 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 18 Jan 2024 10:25:12 +0100 Subject: [PATCH 009/115] Document how to find the bundled wheels versions --- python3.13.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index ce12b34..83d2569 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -71,6 +71,8 @@ License: Python-2.0.1 # If the rpmwheels condition is disabled, we use the bundled wheel packages # from Python with the versions below. # This needs to be manually updated when we update Python. +# Explore the sources tarball (you need the version before %%prep is executed): +# $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl %global pip_version 23.3.2 %global setuptools_version 67.6.1 %global wheel_version 0.40.0 From f26990ceb8fcd21ff9dab7a68d60e0f494c93d6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 19 Jan 2024 22:54:14 +0100 Subject: [PATCH 010/115] Enable python3.13-freethreading and python3.13-freethreading-debug on ppc64le --- python3.13.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 83d2569..b9ba0ac 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -141,9 +141,9 @@ Provides: bundled(python3dist(packaging)) = 23 # Extra build without GIL, the freethreading PEP 703 provisional way # (the -freethreading subpackage) -# support for the excluded arches is being added upstream and is expected to land in 3.13.0a3 -# https://github.com/python/cpython/issues/112535 -%ifnarch ppc64le s390x +# support for s390x is pending investigation in +# https://github.com/python/cpython/issues/114331 +%ifnarch s390x %bcond_without freethreading_build %else %bcond_with freethreading_build @@ -1678,6 +1678,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Jan 19 2024 Miro Hrončok - 3.13.0~a3-2 +- Enable python3.13-freethreading and python3.13-freethreading-debug on ppc64le + * Thu Jan 18 2024 Karolina Surma - 3.13.0~a3-1 - Update to Python 3.13.0a3 From 08e077563cebb5839f7990c0730260f6fa9f0ac2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jan 2024 13:33:15 +0000 Subject: [PATCH 011/115] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index b9ba0ac..2a45fd5 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -1678,6 +1678,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Jan 26 2024 Fedora Release Engineering - 3.13.0~a3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 Miro Hrončok - 3.13.0~a3-2 - Enable python3.13-freethreading and python3.13-freethreading-debug on ppc64le From 1ac5b6981ebd54c778df2be4660bc78441deea68 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Fri, 16 Feb 2024 09:59:14 +0100 Subject: [PATCH 012/115] Update to Python 3.13.0a4 --- 00251-change-user-install-location.patch | 6 ++-- ...or-the-main-thread-gh-28549-gh-28589.patch | 8 ++--- ...on-t-generate-sbom-in-make-regen-all.patch | 32 ------------------- python3.13.spec | 29 +++++++---------- sources | 4 +-- 5 files changed, 20 insertions(+), 59 deletions(-) delete mode 100644 00418-don-t-generate-sbom-in-make-regen-all.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index dc8bcae..0b8c76c 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -130,7 +130,7 @@ index 07ab27c7fb..d3e22762bf 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index be609a0abd..8269f48c6d 100644 +index bb87bf00dc..0717f44cb0 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -115,8 +115,19 @@ def test_get_path(self): @@ -154,7 +154,7 @@ index be609a0abd..8269f48c6d 100644 os.path.normpath(expected), ) -@@ -340,7 +351,7 @@ def test_get_config_h_filename(self): +@@ -349,7 +360,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -163,7 +163,7 @@ index be609a0abd..8269f48c6d 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -352,6 +363,8 @@ def test_symlink(self): # Issue 7880 +@@ -361,6 +372,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch b/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch index 4639352..eb5f027 100644 --- a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +++ b/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch @@ -16,10 +16,10 @@ https://github.com/GrahamDumpleton/mod_wsgi/issues/730 2 files changed, 11 insertions(+), 53 deletions(-) diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py -index 3060af44fd..4c7afe648d 100644 +index 1ab223b81e..727b2b0c43 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py -@@ -1056,39 +1056,6 @@ def noop(): pass +@@ -1169,39 +1169,6 @@ def noop(): pass threading.Thread(target=noop).start() # Thread.join() is not called @@ -60,10 +60,10 @@ index 3060af44fd..4c7afe648d 100644 code = """if 1: import atexit diff --git a/Lib/threading.py b/Lib/threading.py -index 85aff58968..746c409c63 100644 +index b6ff00acad..0447c3ee54 100644 --- a/Lib/threading.py +++ b/Lib/threading.py -@@ -1616,32 +1616,23 @@ def _shutdown(): +@@ -1652,32 +1652,23 @@ def _shutdown(): global _SHUTTING_DOWN _SHUTTING_DOWN = True diff --git a/00418-don-t-generate-sbom-in-make-regen-all.patch b/00418-don-t-generate-sbom-in-make-regen-all.patch deleted file mode 100644 index 36bf09c..0000000 --- a/00418-don-t-generate-sbom-in-make-regen-all.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Fri, 19 Jan 2024 12:00:18 +0100 -Subject: [PATCH] 00418: Don't generate sbom in make regen-all - -The script and make target, added in Python 3.13.0a3, assumes a fixed -location of pip wheel and other bundled libraries, resulting in an -error and failed build when not found. -Reported upstream: https://github.com/python/cpython/issues/114240 -and https://github.com/python/cpython/issues/114244 ---- - Makefile.pre.in | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 289ab97666..1058fac8cc 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1364,10 +1364,11 @@ regen-unicodedata: - regen-all: regen-cases regen-typeslots \ - regen-token regen-ast regen-keyword regen-sre regen-frozen \ - regen-pegen-metaparser regen-pegen regen-test-frozenmain \ -- regen-test-levenshtein regen-global-objects regen-sbom -+ regen-test-levenshtein regen-global-objects - @echo - @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, " -- @echo "make regen-configure and make regen-unicodedata should be run manually" -+ @echo "make regen-configure, make regen-unicodedata and make regen-sbom " -+ @echo "should be run manually" - - ############################################################################ - # Special rules for object files diff --git a/python3.13.spec b/python3.13.spec index 2a45fd5..8c8bc59 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel a3 +%global prerel a4 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -73,7 +73,7 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 23.3.2 +%global pip_version 24.0 %global setuptools_version 67.6.1 %global wheel_version 0.40.0 # All of those also include a list of indirect bundled libs: @@ -84,7 +84,7 @@ Provides: bundled(python3dist(cachecontrol)) = 0.13.1 Provides: bundled(python3dist(certifi)) = 2023.7.22 Provides: bundled(python3dist(chardet)) = 5.1 Provides: bundled(python3dist(colorama)) = 0.4.6 -Provides: bundled(python3dist(distlib)) = 0.3.6 +Provides: bundled(python3dist(distlib)) = 0.3.8 Provides: bundled(python3dist(distro)) = 1.8 Provides: bundled(python3dist(idna)) = 3.4 Provides: bundled(python3dist(msgpack)) = 1.0.5 @@ -124,7 +124,7 @@ Provides: bundled(python3dist(typing-extensions)) = 4.4 Provides: bundled(python3dist(zipp)) = 3.7 } # wheel -# $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheel-*.whl wheel/vendored/vendor.txt) +# $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheeldata/wheel-*.whl wheel/vendored/vendor.txt) %global wheel_bundled_provides %{expand: Provides: bundled(python3dist(packaging)) = 23 } @@ -385,16 +385,6 @@ Patch251: 00251-change-user-install-location.patch # https://github.com/GrahamDumpleton/mod_wsgi/issues/730 Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch -# 00418 # 7044fbb05d0825f5fd9733a6491bb5bea904fab1 -# Don't generate sbom in make regen-all -# -# The script and make target, added in Python 3.13.0a3, assumes a fixed -# location of pip wheel and other bundled libraries, resulting in an -# error and failed build when not found. -# Reported upstream: https://github.com/python/cpython/issues/114240 -# and https://github.com/python/cpython/issues/114244 -Patch418: 00418-don-t-generate-sbom-in-make-regen-all.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -768,13 +758,13 @@ extension modules. # setuptools.whl does not contain the vendored.txt files if [ -f %{_rpmconfigdir}/pythonbundles.py ]; then %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) --compare-with '%pip_bundled_provides' - %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheel-*.whl wheel/vendored/vendor.txt) --compare-with '%wheel_bundled_provides' + %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheeldata/wheel-*.whl wheel/vendored/vendor.txt) --compare-with '%wheel_bundled_provides' fi %if %{with rpmwheels} rm Lib/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl -rm Lib/test/setuptools-%{setuptools_version}-py3-none-any.whl -rm Lib/test/wheel-%{wheel_version}-py3-none-any.whl +rm Lib/test/wheeldata/setuptools-%{setuptools_version}-py3-none-any.whl +rm Lib/test/wheeldata/wheel-%{wheel_version}-py3-none-any.whl %endif # Remove all exe files to ensure we are not shipping prebuilt binaries @@ -1678,6 +1668,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Feb 16 2024 Karolina Surma - 3.13.0~a4-1 +- Update to Python 3.13.0a4 + * Fri Jan 26 2024 Fedora Release Engineering - 3.13.0~a3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 52bf88e..ddc25f3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0a3.tar.xz) = 0cabe30ca97f89df7da35684dda9ac8a3018fb7547d97f595e7883323809fdb99ff02c48719d71fb12abdacda1fc86f0ca15b1d27717e941cdc0b31c72fd63bb -SHA512 (Python-3.13.0a3.tar.xz.asc) = 91efe8e66085e4b60b565130a8ab43b3772e3dafe25fa6266900a8c19004082bcfd7e72e6e5293dc5bc3330ea2db233365d1028ef3b86ee4bb7df1246b6641b0 +SHA512 (Python-3.13.0a4.tar.xz) = f0dccc822ba000e8a50853d62698975d35382b981b62091e25ad6a6e0669e4e517c880e884644b508172de38226006ec11ddc649d9271320e728c0cd6c0b4dcc +SHA512 (Python-3.13.0a4.tar.xz.asc) = 261c0b23f84301f8b2aa4e8ea32995ea64a74a48dabc595028af71466915df93c118e699c939d7e4372d4575c59221743cb5ae21a936cc41241bdbafb9fab6c3 From c9e9f5fd4d8b64e0a78706bcd1ee5ce61ceeb998 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 21 Feb 2024 10:41:48 +0100 Subject: [PATCH 013/115] Fix crash involving exhausted list operator Additionally don't generate sbom (causes build to fail), backport an accidentally lost _PyCFunctionFastWithKeywords name. --- ...on-t-generate-sbom-in-make-regen-all.patch | 31 ++++++ ...ctionfastwithkeywords-name-gh-115561.patch | 41 +++++++ ...lving-exhausted-list-iterator-115740.patch | 105 ++++++++++++++++++ python3.13.spec | 29 ++++- 4 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 00418-don-t-generate-sbom-in-make-regen-all.patch create mode 100644 00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch create mode 100644 00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch diff --git a/00418-don-t-generate-sbom-in-make-regen-all.patch b/00418-don-t-generate-sbom-in-make-regen-all.patch new file mode 100644 index 0000000..aac6f9a --- /dev/null +++ b/00418-don-t-generate-sbom-in-make-regen-all.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Fri, 19 Jan 2024 12:00:18 +0100 +Subject: [PATCH] 00418: Don't generate sbom in make regen-all + +The script and make target, modified in Python 3.13.0a4, +assumes the presence of expat and _decimal/libmpdec libraries, resulting in an +error and failed build when not found. +Reported upstream: https://github.com/python/cpython/issues/115663 +--- + Makefile.pre.in | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 8252e6631c..3f4a89ad07 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1625,10 +1625,11 @@ regen-unicodedata: + regen-all: regen-cases regen-typeslots \ + regen-token regen-ast regen-keyword regen-sre regen-frozen \ + regen-pegen-metaparser regen-pegen regen-test-frozenmain \ +- regen-test-levenshtein regen-global-objects regen-sbom regen-jit ++ regen-test-levenshtein regen-global-objects regen-jit + @echo + @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, " +- @echo "make regen-configure and make regen-unicodedata should be run manually" ++ @echo "make regen-configure, make regen-unicodedata and make regen-sbom " ++ @echo "should be run manually" + + ############################################################################ + # Special rules for object files diff --git a/00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch b/00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch new file mode 100644 index 0000000..e6933c9 --- /dev/null +++ b/00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Mon, 19 Feb 2024 13:20:46 +0100 +Subject: [PATCH] 00420: gh-114626: Add again _PyCFunctionFastWithKeywords name + (GH-115561) + +Keep the old private _PyCFunctionFastWithKeywords name (Python 3.7) +as an alias to the new public name PyCFunctionFastWithKeywords +(Python 3.13a4). + +_PyCFunctionWithKeywords doesn't exist in Python 3.13a3, whereas +_PyCFunctionFastWithKeywords was removed in Python 3.13a4. +--- + Include/methodobject.h | 2 +- + .../next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst | 4 ++++ + 2 files changed, 5 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst + +diff --git a/Include/methodobject.h b/Include/methodobject.h +index 452f891a7a..39272815b1 100644 +--- a/Include/methodobject.h ++++ b/Include/methodobject.h +@@ -31,7 +31,7 @@ typedef PyObject *(*PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, + // Note that the underscore-prefixed names were documented in public docs; + // people may be using them. + typedef PyCFunctionFast _PyCFunctionFast; +-typedef PyCFunctionWithKeywords _PyCFunctionWithKeywords; ++typedef PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords; + + // Cast an function to the PyCFunction type to use it with PyMethodDef. + // +diff --git a/Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst b/Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst +new file mode 100644 +index 0000000000..763f4cee6d +--- /dev/null ++++ b/Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst +@@ -0,0 +1,4 @@ ++Add again ``_PyCFunctionFastWithKeywords`` name, removed in Python 3.13 ++alpha 4 by mistake. Keep the old private ``_PyCFunctionFastWithKeywords`` ++name (Python 3.7) as an alias to the new public name ++``PyCFunctionFastWithKeywords`` (Python 3.13a4). Patch by Victor Stinner. diff --git a/00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch b/00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch new file mode 100644 index 0000000..8809b38 --- /dev/null +++ b/00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch @@ -0,0 +1,105 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sam Gross +Date: Tue, 20 Feb 2024 15:18:44 -0500 +Subject: [PATCH] 00421: gh-115733: Fix crash involving exhausted list iterator + (#115740) + +--- + Lib/test/list_tests.py | 5 +++++ + .../2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst | 1 + + Objects/listobject.c | 10 +++++----- + Python/bytecodes.c | 3 ++- + Python/executor_cases.c.h | 1 + + Python/generated_cases.c.h | 2 +- + 6 files changed, 15 insertions(+), 7 deletions(-) + create mode 100644 Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst + +diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py +index d9ab21d494..26118e14bb 100644 +--- a/Lib/test/list_tests.py ++++ b/Lib/test/list_tests.py +@@ -562,3 +562,8 @@ def test_exhausted_iterator(self): + self.assertEqual(list(exhit), []) + self.assertEqual(list(empit), [9]) + self.assertEqual(a, self.type2test([1, 2, 3, 9])) ++ ++ # gh-115733: Crash when iterating over exhausted iterator ++ exhit = iter(self.type2test([1, 2, 3])) ++ for _ in exhit: ++ next(exhit, 1) +diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst b/Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst +new file mode 100644 +index 0000000000..5cbb292065 +--- /dev/null ++++ b/Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst +@@ -0,0 +1 @@ ++Fix crash when calling ``next()`` on exhausted list iterators. +diff --git a/Objects/listobject.c b/Objects/listobject.c +index 96182a4230..7917b80824 100644 +--- a/Objects/listobject.c ++++ b/Objects/listobject.c +@@ -3537,13 +3537,13 @@ listreviter_next(PyObject *self) + { + listreviterobject *it = (listreviterobject *)self; + assert(it != NULL); ++ Py_ssize_t index = LOAD_SSIZE(it->it_index); ++ if (index < 0) { ++ return NULL; ++ } ++ + PyListObject *seq = it->it_seq; + assert(PyList_Check(seq)); +- +- Py_ssize_t index = LOAD_SSIZE(it->it_index); +- if (index < 0) { +- return NULL; +- } + PyObject *item = list_get_item_ref(seq, index); + if (item != NULL) { + STORE_SSIZE(it->it_index, index - 1); +diff --git a/Python/bytecodes.c b/Python/bytecodes.c +index 6822e772e9..228d4c2f7a 100644 +--- a/Python/bytecodes.c ++++ b/Python/bytecodes.c +@@ -2606,7 +2606,7 @@ dummy_func( + assert(Py_TYPE(iter) == &PyListIter_Type); + STAT_INC(FOR_ITER, hit); + PyListObject *seq = it->it_seq; +- if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { ++ if (seq == NULL || (size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { + it->it_index = -1; + #ifndef Py_GIL_DISABLED + if (seq != NULL) { +@@ -2627,6 +2627,7 @@ dummy_func( + _PyListIterObject *it = (_PyListIterObject *)iter; + assert(Py_TYPE(iter) == &PyListIter_Type); + PyListObject *seq = it->it_seq; ++ DEOPT_IF(seq == NULL); + DEOPT_IF((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)); + } + +diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h +index 11e2a1fe85..bb0033514e 100644 +--- a/Python/executor_cases.c.h ++++ b/Python/executor_cases.c.h +@@ -2201,6 +2201,7 @@ + _PyListIterObject *it = (_PyListIterObject *)iter; + assert(Py_TYPE(iter) == &PyListIter_Type); + PyListObject *seq = it->it_seq; ++ if (seq == NULL) goto deoptimize; + if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) goto deoptimize; + break; + } +diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h +index 6c19adc60c..094fe0336d 100644 +--- a/Python/generated_cases.c.h ++++ b/Python/generated_cases.c.h +@@ -2541,7 +2541,7 @@ + assert(Py_TYPE(iter) == &PyListIter_Type); + STAT_INC(FOR_ITER, hit); + PyListObject *seq = it->it_seq; +- if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { ++ if (seq == NULL || (size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { + it->it_index = -1; + #ifndef Py_GIL_DISABLED + if (seq != NULL) { diff --git a/python3.13.spec b/python3.13.spec index 8c8bc59..c5ef8e1 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a4 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -385,6 +385,30 @@ Patch251: 00251-change-user-install-location.patch # https://github.com/GrahamDumpleton/mod_wsgi/issues/730 Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +# 00418 # 00835b95549d7107cb998a663631c22494db8529 +# Don't generate sbom in make regen-all +# +# The script and make target, modified in Python 3.13.0a4, +# assumes the presence of expat and _decimal/libmpdec libraries, resulting in an +# error and failed build when not found. +# Reported upstream: https://github.com/python/cpython/issues/115663 +Patch418: 00418-don-t-generate-sbom-in-make-regen-all.patch + +# 00420 # 9493f930d1e64ecb947d77548ed9993bfb7cd7f0 +# gh-114626: Add again _PyCFunctionFastWithKeywords name (GH-115561) +# +# Keep the old private _PyCFunctionFastWithKeywords name (Python 3.7) +# as an alias to the new public name PyCFunctionFastWithKeywords +# (Python 3.13a4). +# +# _PyCFunctionWithKeywords doesn't exist in Python 3.13a3, whereas +# _PyCFunctionFastWithKeywords was removed in Python 3.13a4. +Patch420: 00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch + +# 00421 # 11c050c0763b7e67e783c1433e38dcc65070c60c +# gh-115733: Fix crash involving exhausted list iterator (#115740) +Patch421: 00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1668,6 +1692,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Feb 21 2024 Karolina Surma - 3.13.0~a4-2 +- Fix crash involving exhausted list iterator + * Fri Feb 16 2024 Karolina Surma - 3.13.0~a4-1 - Update to Python 3.13.0a4 From 0697d12bdad76f5acf4ae6af1e832d72d3f6b3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 13 Mar 2024 01:35:58 +0100 Subject: [PATCH 014/115] Update to Python 3.13.0a5 --- 00251-change-user-install-location.patch | 10 +- ...or-the-main-thread-gh-28549-gh-28589.patch | 6 +- ...on-t-generate-sbom-in-make-regen-all.patch | 31 ------ ...ctionfastwithkeywords-name-gh-115561.patch | 41 ------- ...lving-exhausted-list-iterator-115740.patch | 105 ------------------ python3.13.spec | 33 ++---- sources | 4 +- 7 files changed, 17 insertions(+), 213 deletions(-) delete mode 100644 00418-don-t-generate-sbom-in-make-regen-all.patch delete mode 100644 00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch delete mode 100644 00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 0b8c76c..a816ed2 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,7 +30,7 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index 0631f3f611..2ed7b683a0 100644 +index 2aee63e24c..00855f437c 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -395,8 +395,15 @@ def getsitepackages(prefixes=None): @@ -130,10 +130,10 @@ index 07ab27c7fb..d3e22762bf 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index bb87bf00dc..0717f44cb0 100644 +index c8315bbc8b..5a18592d8f 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py -@@ -115,8 +115,19 @@ def test_get_path(self): +@@ -117,8 +117,19 @@ def test_get_path(self): for scheme in _INSTALL_SCHEMES: for name in _INSTALL_SCHEMES[scheme]: expected = _INSTALL_SCHEMES[scheme][name].format(**config_vars) @@ -154,7 +154,7 @@ index bb87bf00dc..0717f44cb0 100644 os.path.normpath(expected), ) -@@ -349,7 +360,7 @@ def test_get_config_h_filename(self): +@@ -351,7 +362,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -163,7 +163,7 @@ index bb87bf00dc..0717f44cb0 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -361,6 +372,8 @@ def test_symlink(self): # Issue 7880 +@@ -363,6 +374,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch b/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch index eb5f027..1b33c31 100644 --- a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +++ b/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch @@ -16,7 +16,7 @@ https://github.com/GrahamDumpleton/mod_wsgi/issues/730 2 files changed, 11 insertions(+), 53 deletions(-) diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py -index 1ab223b81e..727b2b0c43 100644 +index 3b5c37c948..ad070237d0 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1169,39 +1169,6 @@ def noop(): pass @@ -60,10 +60,10 @@ index 1ab223b81e..727b2b0c43 100644 code = """if 1: import atexit diff --git a/Lib/threading.py b/Lib/threading.py -index b6ff00acad..0447c3ee54 100644 +index ec89550d6b..46b222a6a3 100644 --- a/Lib/threading.py +++ b/Lib/threading.py -@@ -1652,32 +1652,23 @@ def _shutdown(): +@@ -1642,32 +1642,23 @@ def _shutdown(): global _SHUTTING_DOWN _SHUTTING_DOWN = True diff --git a/00418-don-t-generate-sbom-in-make-regen-all.patch b/00418-don-t-generate-sbom-in-make-regen-all.patch deleted file mode 100644 index aac6f9a..0000000 --- a/00418-don-t-generate-sbom-in-make-regen-all.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Fri, 19 Jan 2024 12:00:18 +0100 -Subject: [PATCH] 00418: Don't generate sbom in make regen-all - -The script and make target, modified in Python 3.13.0a4, -assumes the presence of expat and _decimal/libmpdec libraries, resulting in an -error and failed build when not found. -Reported upstream: https://github.com/python/cpython/issues/115663 ---- - Makefile.pre.in | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 8252e6631c..3f4a89ad07 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1625,10 +1625,11 @@ regen-unicodedata: - regen-all: regen-cases regen-typeslots \ - regen-token regen-ast regen-keyword regen-sre regen-frozen \ - regen-pegen-metaparser regen-pegen regen-test-frozenmain \ -- regen-test-levenshtein regen-global-objects regen-sbom regen-jit -+ regen-test-levenshtein regen-global-objects regen-jit - @echo - @echo "Note: make regen-stdlib-module-names, make regen-limited-abi, " -- @echo "make regen-configure and make regen-unicodedata should be run manually" -+ @echo "make regen-configure, make regen-unicodedata and make regen-sbom " -+ @echo "should be run manually" - - ############################################################################ - # Special rules for object files diff --git a/00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch b/00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch deleted file mode 100644 index e6933c9..0000000 --- a/00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Mon, 19 Feb 2024 13:20:46 +0100 -Subject: [PATCH] 00420: gh-114626: Add again _PyCFunctionFastWithKeywords name - (GH-115561) - -Keep the old private _PyCFunctionFastWithKeywords name (Python 3.7) -as an alias to the new public name PyCFunctionFastWithKeywords -(Python 3.13a4). - -_PyCFunctionWithKeywords doesn't exist in Python 3.13a3, whereas -_PyCFunctionFastWithKeywords was removed in Python 3.13a4. ---- - Include/methodobject.h | 2 +- - .../next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst | 4 ++++ - 2 files changed, 5 insertions(+), 1 deletion(-) - create mode 100644 Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst - -diff --git a/Include/methodobject.h b/Include/methodobject.h -index 452f891a7a..39272815b1 100644 ---- a/Include/methodobject.h -+++ b/Include/methodobject.h -@@ -31,7 +31,7 @@ typedef PyObject *(*PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, - // Note that the underscore-prefixed names were documented in public docs; - // people may be using them. - typedef PyCFunctionFast _PyCFunctionFast; --typedef PyCFunctionWithKeywords _PyCFunctionWithKeywords; -+typedef PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords; - - // Cast an function to the PyCFunction type to use it with PyMethodDef. - // -diff --git a/Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst b/Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst -new file mode 100644 -index 0000000000..763f4cee6d ---- /dev/null -+++ b/Misc/NEWS.d/next/C API/2024-02-16-15-56-53.gh-issue-114626.ie2esA.rst -@@ -0,0 +1,4 @@ -+Add again ``_PyCFunctionFastWithKeywords`` name, removed in Python 3.13 -+alpha 4 by mistake. Keep the old private ``_PyCFunctionFastWithKeywords`` -+name (Python 3.7) as an alias to the new public name -+``PyCFunctionFastWithKeywords`` (Python 3.13a4). Patch by Victor Stinner. diff --git a/00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch b/00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch deleted file mode 100644 index 8809b38..0000000 --- a/00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Sam Gross -Date: Tue, 20 Feb 2024 15:18:44 -0500 -Subject: [PATCH] 00421: gh-115733: Fix crash involving exhausted list iterator - (#115740) - ---- - Lib/test/list_tests.py | 5 +++++ - .../2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst | 1 + - Objects/listobject.c | 10 +++++----- - Python/bytecodes.c | 3 ++- - Python/executor_cases.c.h | 1 + - Python/generated_cases.c.h | 2 +- - 6 files changed, 15 insertions(+), 7 deletions(-) - create mode 100644 Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst - -diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py -index d9ab21d494..26118e14bb 100644 ---- a/Lib/test/list_tests.py -+++ b/Lib/test/list_tests.py -@@ -562,3 +562,8 @@ def test_exhausted_iterator(self): - self.assertEqual(list(exhit), []) - self.assertEqual(list(empit), [9]) - self.assertEqual(a, self.type2test([1, 2, 3, 9])) -+ -+ # gh-115733: Crash when iterating over exhausted iterator -+ exhit = iter(self.type2test([1, 2, 3])) -+ for _ in exhit: -+ next(exhit, 1) -diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst b/Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst -new file mode 100644 -index 0000000000..5cbb292065 ---- /dev/null -+++ b/Misc/NEWS.d/next/Core and Builtins/2024-02-20-18-49-02.gh-issue-115733.51Zb85.rst -@@ -0,0 +1 @@ -+Fix crash when calling ``next()`` on exhausted list iterators. -diff --git a/Objects/listobject.c b/Objects/listobject.c -index 96182a4230..7917b80824 100644 ---- a/Objects/listobject.c -+++ b/Objects/listobject.c -@@ -3537,13 +3537,13 @@ listreviter_next(PyObject *self) - { - listreviterobject *it = (listreviterobject *)self; - assert(it != NULL); -+ Py_ssize_t index = LOAD_SSIZE(it->it_index); -+ if (index < 0) { -+ return NULL; -+ } -+ - PyListObject *seq = it->it_seq; - assert(PyList_Check(seq)); -- -- Py_ssize_t index = LOAD_SSIZE(it->it_index); -- if (index < 0) { -- return NULL; -- } - PyObject *item = list_get_item_ref(seq, index); - if (item != NULL) { - STORE_SSIZE(it->it_index, index - 1); -diff --git a/Python/bytecodes.c b/Python/bytecodes.c -index 6822e772e9..228d4c2f7a 100644 ---- a/Python/bytecodes.c -+++ b/Python/bytecodes.c -@@ -2606,7 +2606,7 @@ dummy_func( - assert(Py_TYPE(iter) == &PyListIter_Type); - STAT_INC(FOR_ITER, hit); - PyListObject *seq = it->it_seq; -- if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { -+ if (seq == NULL || (size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { - it->it_index = -1; - #ifndef Py_GIL_DISABLED - if (seq != NULL) { -@@ -2627,6 +2627,7 @@ dummy_func( - _PyListIterObject *it = (_PyListIterObject *)iter; - assert(Py_TYPE(iter) == &PyListIter_Type); - PyListObject *seq = it->it_seq; -+ DEOPT_IF(seq == NULL); - DEOPT_IF((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)); - } - -diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h -index 11e2a1fe85..bb0033514e 100644 ---- a/Python/executor_cases.c.h -+++ b/Python/executor_cases.c.h -@@ -2201,6 +2201,7 @@ - _PyListIterObject *it = (_PyListIterObject *)iter; - assert(Py_TYPE(iter) == &PyListIter_Type); - PyListObject *seq = it->it_seq; -+ if (seq == NULL) goto deoptimize; - if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) goto deoptimize; - break; - } -diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h -index 6c19adc60c..094fe0336d 100644 ---- a/Python/generated_cases.c.h -+++ b/Python/generated_cases.c.h -@@ -2541,7 +2541,7 @@ - assert(Py_TYPE(iter) == &PyListIter_Type); - STAT_INC(FOR_ITER, hit); - PyListObject *seq = it->it_seq; -- if ((size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { -+ if (seq == NULL || (size_t)it->it_index >= (size_t)PyList_GET_SIZE(seq)) { - it->it_index = -1; - #ifndef Py_GIL_DISABLED - if (seq != NULL) { diff --git a/python3.13.spec b/python3.13.spec index c5ef8e1..1446c36 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel a4 +%global prerel a5 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -385,30 +385,6 @@ Patch251: 00251-change-user-install-location.patch # https://github.com/GrahamDumpleton/mod_wsgi/issues/730 Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch -# 00418 # 00835b95549d7107cb998a663631c22494db8529 -# Don't generate sbom in make regen-all -# -# The script and make target, modified in Python 3.13.0a4, -# assumes the presence of expat and _decimal/libmpdec libraries, resulting in an -# error and failed build when not found. -# Reported upstream: https://github.com/python/cpython/issues/115663 -Patch418: 00418-don-t-generate-sbom-in-make-regen-all.patch - -# 00420 # 9493f930d1e64ecb947d77548ed9993bfb7cd7f0 -# gh-114626: Add again _PyCFunctionFastWithKeywords name (GH-115561) -# -# Keep the old private _PyCFunctionFastWithKeywords name (Python 3.7) -# as an alias to the new public name PyCFunctionFastWithKeywords -# (Python 3.13a4). -# -# _PyCFunctionWithKeywords doesn't exist in Python 3.13a3, whereas -# _PyCFunctionFastWithKeywords was removed in Python 3.13a4. -Patch420: 00420-gh-114626-add-again-_pycfunctionfastwithkeywords-name-gh-115561.patch - -# 00421 # 11c050c0763b7e67e783c1433e38dcc65070c60c -# gh-115733: Fix crash involving exhausted list iterator (#115740) -Patch421: 00421-gh-115733-fix-crash-involving-exhausted-list-iterator-115740.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1570,8 +1546,10 @@ CheckPython freethreading %{dynload_dir}/_testcapi.%{1}.so\ %{dynload_dir}/_testclinic.%{1}.so\ %{dynload_dir}/_testclinic_limited.%{1}.so\ +%{dynload_dir}/_testexternalinspection.%{1}.so\ %{dynload_dir}/_testimportmultiple.%{1}.so\ %{dynload_dir}/_testinternalcapi.%{1}.so\ +%{dynload_dir}/_testlimitedcapi.%{1}.so\ %{dynload_dir}/_testmultiphase.%{1}.so\ %{dynload_dir}/_testsinglephase.%{1}.so\ %{dynload_dir}/_xxinterpchannels.%{1}.so\ @@ -1692,6 +1670,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Mar 13 2024 Miro Hrončok - 3.13.0~a5-1 +- Update to Python 3.13.0a5 + * Wed Feb 21 2024 Karolina Surma - 3.13.0~a4-2 - Fix crash involving exhausted list iterator diff --git a/sources b/sources index ddc25f3..261b5bb 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0a4.tar.xz) = f0dccc822ba000e8a50853d62698975d35382b981b62091e25ad6a6e0669e4e517c880e884644b508172de38226006ec11ddc649d9271320e728c0cd6c0b4dcc -SHA512 (Python-3.13.0a4.tar.xz.asc) = 261c0b23f84301f8b2aa4e8ea32995ea64a74a48dabc595028af71466915df93c118e699c939d7e4372d4575c59221743cb5ae21a936cc41241bdbafb9fab6c3 +SHA512 (Python-3.13.0a5.tar.xz) = 7238d6792ac35f4cf9c701f7a69ed37de13efe0ba676f26a9b01a15ded1f8f070be295be6fc70b29153e9f2216224438d46500570b5d64641347cf2ccc66b556 +SHA512 (Python-3.13.0a5.tar.xz.asc) = 9cb4235afcde912904a2c3a728d83db45947cbda5ae1efae742f6045d1744008fefe67ed4b667f58194d81b2f341f3718841eb06ffad9a2f2fb5357cb1a373f4 From 4161fb48da96ef853a9ef1f533a589e0fb687f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 13 Mar 2024 12:03:40 +0100 Subject: [PATCH 015/115] Move all test modules to the test subpackage - __phello__ - _xxinterpqueues - _xxsubinterpreters - xxlimited - xxlimited_35 - xxsubtype Source: https://github.com/python/cpython/blob/v3.13.0a5/Tools/build/generate_stdlib_module_names.py#L21 --- python3.13.spec | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 1446c36..b36ae29 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a5 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -1318,7 +1318,6 @@ CheckPython freethreading %dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/__phello__/ %{pylibdir}/asyncio/ %{pylibdir}/collections/ %{pylibdir}/concurrent/ @@ -1425,8 +1424,6 @@ CheckPython freethreading %{dynload_dir}/_statistics.%{1}.so\ %{dynload_dir}/_struct.%{1}.so\ %{dynload_dir}/_uuid.%{1}.so\ -%{dynload_dir}/_xxinterpqueues.%{1}.so\ -%{dynload_dir}/_xxsubinterpreters.%{1}.so\ %{dynload_dir}/_zoneinfo.%{1}.so\ %{dynload_dir}/array.%{1}.so\ %{dynload_dir}/binascii.%{1}.so\ @@ -1442,9 +1439,6 @@ CheckPython freethreading %{dynload_dir}/syslog.%{1}.so\ %{dynload_dir}/termios.%{1}.so\ %{dynload_dir}/unicodedata.%{1}.so\ -%{dynload_dir}/xxlimited.%{1}.so\ -%{dynload_dir}/xxlimited_35.%{1}.so\ -%{dynload_dir}/xxsubtype.%{1}.so\ %{dynload_dir}/zlib.%{1}.so %extension_modules %{SOABI_optimized} @@ -1538,6 +1532,9 @@ CheckPython freethreading %files -n %{pkgname}-test %{pylibdir}/test/ +# Pure Python modules +%{pylibdir}/__phello__/ + # Extension modules # This is macronized for reuse in the -debug package %define extension_modules_test() \ @@ -1553,7 +1550,12 @@ CheckPython freethreading %{dynload_dir}/_testmultiphase.%{1}.so\ %{dynload_dir}/_testsinglephase.%{1}.so\ %{dynload_dir}/_xxinterpchannels.%{1}.so\ -%{dynload_dir}/_xxtestfuzz.%{1}.so +%{dynload_dir}/_xxinterpqueues.%{1}.so\ +%{dynload_dir}/_xxsubinterpreters.%{1}.so\ +%{dynload_dir}/_xxtestfuzz.%{1}.so\ +%{dynload_dir}/xxlimited.%{1}.so\ +%{dynload_dir}/xxlimited_35.%{1}.so\ +%{dynload_dir}/xxsubtype.%{1}.so %extension_modules_test %{SOABI_optimized} @@ -1670,6 +1672,15 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Mar 13 2024 Miro Hrončok - 3.13.0~a5-2 +- Move all test modules to the python3.13-test package, namely: + - __phello__ + - _xxinterpqueues + - _xxsubinterpreters + - xxlimited + - xxlimited_35 + - xxsubtype + * Wed Mar 13 2024 Miro Hrončok - 3.13.0~a5-1 - Update to Python 3.13.0a5 From c1d785c5ae6829fe4566200be5da4a39ef8c18bf Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 20 Mar 2024 15:48:00 +0100 Subject: [PATCH 016/115] Remove internal usage of @LIBPYTHON@ --- ...move-all-internal-usage-of-libpython.patch | 37 +++++++++++++++++++ python3.13.spec | 11 +++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 00424-gh-116745-remove-all-internal-usage-of-libpython.patch diff --git a/00424-gh-116745-remove-all-internal-usage-of-libpython.patch b/00424-gh-116745-remove-all-internal-usage-of-libpython.patch new file mode 100644 index 0000000..4c6f8fe --- /dev/null +++ b/00424-gh-116745-remove-all-internal-usage-of-libpython.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Thomas A Caswell +Date: Wed, 13 Mar 2024 14:05:35 -0400 +Subject: [PATCH] 00424: gh-116745: remove all internal usage of @LIBPYTHON@ + +Follow on to https://github.com/python/cpython/pull/115780 . + +Without this change numpy's build is broken. +--- + Misc/python-config.sh.in | 2 +- + Misc/python.pc.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in +index eb02223ddc..c3c0b34fc1 100644 +--- a/Misc/python-config.sh.in ++++ b/Misc/python-config.sh.in +@@ -46,7 +46,7 @@ LIBM="@LIBM@" + LIBC="@LIBC@" + SYSLIBS="$LIBM $LIBC" + ABIFLAGS="@ABIFLAGS@" +-LIBS="@LIBPYTHON@ @LIBS@ $SYSLIBS" ++LIBS="@MODULE_LDFLAGS@ @LIBS@ $SYSLIBS" + LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS" + BASECFLAGS="@BASECFLAGS@" + LDLIBRARY="@LDLIBRARY@" +diff --git a/Misc/python.pc.in b/Misc/python.pc.in +index 027dba3858..c2c740e82b 100644 +--- a/Misc/python.pc.in ++++ b/Misc/python.pc.in +@@ -9,5 +9,5 @@ Description: Build a C extension for Python + Requires: + Version: @VERSION@ + Libs.private: @LIBS@ +-Libs: -L${libdir} @LIBPYTHON@ ++Libs: -L${libdir} @MODULE_LDFLAGS@ + Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@ diff --git a/python3.13.spec b/python3.13.spec index b36ae29..f9b750e 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -385,6 +385,14 @@ Patch251: 00251-change-user-install-location.patch # https://github.com/GrahamDumpleton/mod_wsgi/issues/730 Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +# 00424 # 767f9ca0f729a52808648bca8786fe046c25a016 +# gh-116745: remove all internal usage of @LIBPYTHON@ +# +# Follow on to https://github.com/python/cpython/pull/115780 . +# +# Without this change numpy's build is broken. +Patch424: 00424-gh-116745-remove-all-internal-usage-of-libpython.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1672,7 +1680,7 @@ CheckPython freethreading # ====================================================== %changelog -* Wed Mar 13 2024 Miro Hrončok - 3.13.0~a5-2 +* Wed Mar 13 2024 Python Maint - 3.13.0~a5-2 - Move all test modules to the python3.13-test package, namely: - __phello__ - _xxinterpqueues @@ -1680,6 +1688,7 @@ CheckPython freethreading - xxlimited - xxlimited_35 - xxsubtype +- Remove internal usage of @LIBPYTHON@ * Wed Mar 13 2024 Miro Hrončok - 3.13.0~a5-1 - Update to Python 3.13.0a5 From b95623ede39c3d35860ccb67f92c0521aaec44c1 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 10 Apr 2024 11:22:30 +0200 Subject: [PATCH 017/115] Update to Python 3.13.0a6 Patch 00371 was removed as it no longer applies after https://github.com/python/cpython/commit/33da0e844c922b3dcded75fbb9b7be67cb013a17 We need to monitor the freeipa situation and rework the patch entirely in case it is still needed. See also https://bugzilla.redhat.com/2133853 --- 00251-change-user-install-location.patch | 18 +-- ...or-the-main-thread-gh-28549-gh-28589.patch | 109 ------------------ ...move-all-internal-usage-of-libpython.patch | 37 ------ ...st-wheeldata-when-it-s-actually-used.patch | 28 +++++ python3.13.spec | 37 +++--- sources | 4 +- 6 files changed, 54 insertions(+), 179 deletions(-) delete mode 100644 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch delete mode 100644 00424-gh-116745-remove-all-internal-usage-of-libpython.patch create mode 100644 00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index a816ed2..823059e 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,7 +30,7 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index 2aee63e24c..00855f437c 100644 +index 162bbec4f8..40c5981e03 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -395,8 +395,15 @@ def getsitepackages(prefixes=None): @@ -51,10 +51,10 @@ index 2aee63e24c..00855f437c 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 07ab27c7fb..d3e22762bf 100644 +index 70bdecf213..5cd75a3b96 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py -@@ -104,6 +104,12 @@ +@@ -106,6 +106,12 @@ else: _INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_venv'] @@ -67,7 +67,7 @@ index 07ab27c7fb..d3e22762bf 100644 def _get_implementation(): return 'Python' -@@ -165,6 +171,19 @@ def joinuser(*args): +@@ -167,6 +173,19 @@ def joinuser(*args): }, } @@ -87,7 +87,7 @@ index 07ab27c7fb..d3e22762bf 100644 _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', 'scripts', 'data') -@@ -259,11 +278,40 @@ def _extend_dict(target_dict, other_dict): +@@ -261,11 +280,40 @@ def _extend_dict(target_dict, other_dict): target_dict[key] = value @@ -130,10 +130,10 @@ index 07ab27c7fb..d3e22762bf 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index c8315bbc8b..5a18592d8f 100644 +index 61c6a5a425..fd5fbe17ad 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py -@@ -117,8 +117,19 @@ def test_get_path(self): +@@ -121,8 +121,19 @@ def test_get_path(self): for scheme in _INSTALL_SCHEMES: for name in _INSTALL_SCHEMES[scheme]: expected = _INSTALL_SCHEMES[scheme][name].format(**config_vars) @@ -154,7 +154,7 @@ index c8315bbc8b..5a18592d8f 100644 os.path.normpath(expected), ) -@@ -351,7 +362,7 @@ def test_get_config_h_filename(self): +@@ -357,7 +368,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -163,7 +163,7 @@ index c8315bbc8b..5a18592d8f 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -363,6 +374,8 @@ def test_symlink(self): # Issue 7880 +@@ -369,6 +380,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch b/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch deleted file mode 100644 index 1b33c31..0000000 --- a/00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= -Date: Tue, 25 Oct 2022 12:02:33 +0200 -Subject: [PATCH] 00371: Revert "bpo-1596321: Fix threading._shutdown() for the - main thread (GH-28549) (GH-28589)" - -This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It -introduced regression causing FreeIPA's tests to fail. - -For more info see: -https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31 -https://github.com/GrahamDumpleton/mod_wsgi/issues/730 ---- - Lib/test/test_threading.py | 33 --------------------------------- - Lib/threading.py | 31 +++++++++++-------------------- - 2 files changed, 11 insertions(+), 53 deletions(-) - -diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py -index 3b5c37c948..ad070237d0 100644 ---- a/Lib/test/test_threading.py -+++ b/Lib/test/test_threading.py -@@ -1169,39 +1169,6 @@ def noop(): pass - threading.Thread(target=noop).start() - # Thread.join() is not called - -- def test_import_from_another_thread(self): -- # bpo-1596321: If the threading module is first import from a thread -- # different than the main thread, threading._shutdown() must handle -- # this case without logging an error at Python exit. -- code = textwrap.dedent(''' -- import _thread -- import sys -- -- event = _thread.allocate_lock() -- event.acquire() -- -- def import_threading(): -- import threading -- event.release() -- -- if 'threading' in sys.modules: -- raise Exception('threading is already imported') -- -- _thread.start_new_thread(import_threading, ()) -- -- # wait until the threading module is imported -- event.acquire() -- event.release() -- -- if 'threading' not in sys.modules: -- raise Exception('threading is not imported') -- -- # don't wait until the thread completes -- ''') -- rc, out, err = assert_python_ok("-c", code) -- self.assertEqual(out, b'') -- self.assertEqual(err, b'') -- - def test_start_new_thread_at_exit(self): - code = """if 1: - import atexit -diff --git a/Lib/threading.py b/Lib/threading.py -index ec89550d6b..46b222a6a3 100644 ---- a/Lib/threading.py -+++ b/Lib/threading.py -@@ -1642,32 +1642,23 @@ def _shutdown(): - - global _SHUTTING_DOWN - _SHUTTING_DOWN = True -+ # Main thread -+ tlock = _main_thread._tstate_lock -+ # The main thread isn't finished yet, so its thread state lock can't have -+ # been released. -+ assert tlock is not None -+ if tlock.locked(): -+ # It should have been released already by -+ # _PyInterpreterState_SetNotRunningMain(), but there may be -+ # embedders that aren't calling that yet. -+ tlock.release() -+ _main_thread._stop() - - # Call registered threading atexit functions before threads are joined. - # Order is reversed, similar to atexit. - for atexit_call in reversed(_threading_atexits): - atexit_call() - -- # Main thread -- if _main_thread.ident == get_ident(): -- tlock = _main_thread._tstate_lock -- # The main thread isn't finished yet, so its thread state lock can't -- # have been released. -- assert tlock is not None -- if tlock.locked(): -- # It should have been released already by -- # _PyInterpreterState_SetNotRunningMain(), but there may be -- # embedders that aren't calling that yet. -- tlock.release() -- _main_thread._stop() -- else: -- # bpo-1596321: _shutdown() must be called in the main thread. -- # If the threading module was not imported by the main thread, -- # _main_thread is the thread which imported the threading module. -- # In this case, ignore _main_thread, similar behavior than for threads -- # spawned by C libraries or using _thread.start_new_thread(). -- pass -- - # Join all non-deamon threads - while True: - with _shutdown_locks_lock: diff --git a/00424-gh-116745-remove-all-internal-usage-of-libpython.patch b/00424-gh-116745-remove-all-internal-usage-of-libpython.patch deleted file mode 100644 index 4c6f8fe..0000000 --- a/00424-gh-116745-remove-all-internal-usage-of-libpython.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Thomas A Caswell -Date: Wed, 13 Mar 2024 14:05:35 -0400 -Subject: [PATCH] 00424: gh-116745: remove all internal usage of @LIBPYTHON@ - -Follow on to https://github.com/python/cpython/pull/115780 . - -Without this change numpy's build is broken. ---- - Misc/python-config.sh.in | 2 +- - Misc/python.pc.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in -index eb02223ddc..c3c0b34fc1 100644 ---- a/Misc/python-config.sh.in -+++ b/Misc/python-config.sh.in -@@ -46,7 +46,7 @@ LIBM="@LIBM@" - LIBC="@LIBC@" - SYSLIBS="$LIBM $LIBC" - ABIFLAGS="@ABIFLAGS@" --LIBS="@LIBPYTHON@ @LIBS@ $SYSLIBS" -+LIBS="@MODULE_LDFLAGS@ @LIBS@ $SYSLIBS" - LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS" - BASECFLAGS="@BASECFLAGS@" - LDLIBRARY="@LDLIBRARY@" -diff --git a/Misc/python.pc.in b/Misc/python.pc.in -index 027dba3858..c2c740e82b 100644 ---- a/Misc/python.pc.in -+++ b/Misc/python.pc.in -@@ -9,5 +9,5 @@ Description: Build a C extension for Python - Requires: - Version: @VERSION@ - Libs.private: @LIBS@ --Libs: -L${libdir} @LIBPYTHON@ -+Libs: -L${libdir} @MODULE_LDFLAGS@ - Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@ diff --git a/00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch b/00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch new file mode 100644 index 0000000..1946abb --- /dev/null +++ b/00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Wed, 10 Apr 2024 15:35:04 +0200 +Subject: [PATCH] 00425: Only check for 'test/wheeldata' when it's actually + used + +We build Python in Fedora 39+ with option `--with-wheel-pkg-dir` +pointing to a custom wheel directory and delete the contents of +upstream's `test/wheeldata`. Don't include the directory in the test set +if the wheels are used from a different location. +--- + Lib/test/test_tools/test_makefile.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/Lib/test/test_tools/test_makefile.py b/Lib/test/test_tools/test_makefile.py +index 29f5c28e33..b0dc56c714 100644 +--- a/Lib/test/test_tools/test_makefile.py ++++ b/Lib/test/test_tools/test_makefile.py +@@ -67,6 +67,9 @@ def test_makefile_test_folders(self): + ) + used.append(relpath) + ++ if sysconfig.get_config_var('WHEEL_PKG_DIR'): ++ test_dirs.remove('test/wheeldata') ++ + # Check that there are no extra entries: + unique_test_dirs = set(test_dirs) + self.assertSetEqual(unique_test_dirs, set(used)) diff --git a/python3.13.spec b/python3.13.spec index f9b750e..ca73288 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel a5 +%global prerel a6 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -75,7 +75,7 @@ License: Python-2.0.1 # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl %global pip_version 24.0 %global setuptools_version 67.6.1 -%global wheel_version 0.40.0 +%global wheel_version 0.43.0 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) @@ -126,7 +126,7 @@ Provides: bundled(python3dist(zipp)) = 3.7 # wheel # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheeldata/wheel-*.whl wheel/vendored/vendor.txt) %global wheel_bundled_provides %{expand: -Provides: bundled(python3dist(packaging)) = 23 +Provides: bundled(python3dist(packaging)) = 24 } # Expensive optimizations (mainly, profile-guided optimizations) @@ -142,7 +142,7 @@ Provides: bundled(python3dist(packaging)) = 23 # Extra build without GIL, the freethreading PEP 703 provisional way # (the -freethreading subpackage) # support for s390x is pending investigation in -# https://github.com/python/cpython/issues/114331 +# https://github.com/python/cpython/issues/117755 %ifnarch s390x %bcond_without freethreading_build %else @@ -374,24 +374,14 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00371 # 16d2d6be400cb52c0f50fa27c0e08ae63d1d3add -# Revert "bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)" +# 00425 # a563ac3076a00f0f48b3f94ff63d91d37cb4f1e9 +# Only check for 'test/wheeldata' when it's actually used # -# This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It -# introduced regression causing FreeIPA's tests to fail. -# -# For more info see: -# https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31 -# https://github.com/GrahamDumpleton/mod_wsgi/issues/730 -Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch - -# 00424 # 767f9ca0f729a52808648bca8786fe046c25a016 -# gh-116745: remove all internal usage of @LIBPYTHON@ -# -# Follow on to https://github.com/python/cpython/pull/115780 . -# -# Without this change numpy's build is broken. -Patch424: 00424-gh-116745-remove-all-internal-usage-of-libpython.patch +# We build Python in Fedora 39+ with option `--with-wheel-pkg-dir` +# pointing to a custom wheel directory and delete the contents of +# upstream's `test/wheeldata`. Don't include the directory in the test set +# if the wheels are used from a different location. +Patch425: 00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch # (New patches go here ^^^) # @@ -1680,6 +1670,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Apr 10 2024 Karolina Surma - 3.13.0~a6-1 +- Update to Python 3.13.0a6 + * Wed Mar 13 2024 Python Maint - 3.13.0~a5-2 - Move all test modules to the python3.13-test package, namely: - __phello__ diff --git a/sources b/sources index 261b5bb..530c12a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0a5.tar.xz) = 7238d6792ac35f4cf9c701f7a69ed37de13efe0ba676f26a9b01a15ded1f8f070be295be6fc70b29153e9f2216224438d46500570b5d64641347cf2ccc66b556 -SHA512 (Python-3.13.0a5.tar.xz.asc) = 9cb4235afcde912904a2c3a728d83db45947cbda5ae1efae742f6045d1744008fefe67ed4b667f58194d81b2f341f3718841eb06ffad9a2f2fb5357cb1a373f4 +SHA512 (Python-3.13.0a6.tar.xz) = 6e999c718cdfede4abc52297aae7160a2864424e8f49a47321fa822d40c331a3d061a0982e355351a0c4bea40e9b1ec3832d76a7f4b6b3986b62fca2757f0ca1 +SHA512 (Python-3.13.0a6.tar.xz.asc) = 1ec2abe8198a5fbd98490274bed7e84b48fcfc6ff25fcb474455d9f33b62673cfb7cf4939b304684aed005975d166143cb644b9a3e484d25de3dacb869de0131 From fa7c4e897f7773e0295e012c62a9892247b7667a Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Fri, 12 Apr 2024 12:46:04 +0200 Subject: [PATCH 018/115] Declare the bundled mimalloc and update license tags accordingly mimalloc provide is only declared in -libs subpackage, although it's present also in -devel, -debug, -freethreading and -freethreading-debug. All of those effectively require -libs, so duplicating the provide accross all those was deemed unnecessary. --- python3.13.spec | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index ca73288..7c911e8 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -503,15 +503,17 @@ This package contains /usr/bin/python - the "python" command that runs Python 3. %package -n %{pkgname}-libs Summary: Python runtime libraries +# Bundled libb2 is CC0, covered by grandfathering exception +# Bundled mimalloc is MIT +%global libs_license Python-2.0.1 AND CC0-1.0 AND MIT %if %{with rpmwheels} Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 -# Bundled libb2 is CC0, covered by grandfathering exception -License: Python-2.0.1 AND CC0-1.0 +License: %{libs_license} %else Provides: bundled(python3dist(pip)) = %{pip_version} %pip_bundled_provides -# License manually combined form Python + pip -License: Python-2.0.1 AND CC0-1.0 AND MIT AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) +# License combined from Python libs + pip +License: %{libs_license} AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) %endif %unversioned_obsoletes_of_python3_X_if_main libs @@ -520,6 +522,11 @@ License: Python-2.0.1 AND CC0-1.0 AND MIT AND Apache-2.0 AND BSD-2-Clause AND BS # last updated by https://github.com/python/cpython/pull/6286 Provides: bundled(libb2) = 0.98.1 +# Bundled mimalloc version in Include/internal/mimalloc/mimalloc.h +# Python's version is modified, differences are listed in: +# https://github.com/python/cpython/issues/113141 +Provides: bundled(mimalloc) = 2.12 + # There are files in the standard library that have python shebang. # We've filtered the automatic requirement out so libs are installable without # the main package. This however makes it pulled in by default. @@ -543,6 +550,8 @@ This package contains runtime libraries for use by Python: %package -n %{pkgname}-devel Summary: Libraries and header files needed for Python development +# Bundled mimalloc header files are MIT +License: Python-2.0.1 AND MIT Requires: %{pkgname} = %{version}-%{release} Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} # The RPM related dependencies bring nothing to a non-RPM Python developer @@ -651,6 +660,7 @@ you should use the unittest module from %{pkgname}-libs, or a library such as %if %{with debug_build} %package -n %{pkgname}-debug Summary: Debug version of the Python runtime +License: %{libs_license} # The debug build is an all-in-one package version of the regular build, and # shares the same .py/.pyc files and directories as the regular build. Hence @@ -688,6 +698,7 @@ The debug runtime additionally supports debug builds of C-API extensions # At least until the PEP 703 build remains provisional. %package -n python%{pybasever}-freethreading Summary: Free Threading (PEP 703) version of the Python runtime +License: %{libs_license} # The freethreading build is an all-in-one package version of the regular build, and # shares the same .py/.pyc files and directories as the regular build. Hence @@ -715,6 +726,7 @@ and with the necessary changes needed to make the interpreter thread-safe. %if %{with freethreading_build} && %{with debug_build} %package -n python%{pybasever}-freethreading-debug Summary: Free Threading (PEP 703) version of the Python runtime (debug build) +License: %{libs_license} # The debug build is an all-in-one package version of the regular build, and # shares the same .py/.pyc files and directories as the regular build. Hence From c686992b6c25a39d0e4117053ddb669fd5998723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 18 Apr 2024 00:53:04 +0200 Subject: [PATCH 019/115] Require expat >= 2.6 to prevent errors when creating venvs with older expat The code in CPython uses XML_SetReparseDeferralEnabled when expat is >= 2.6 during the build. However, when users upgrade Python independently on the expat package, they may have expat 2.5 installed and see errors like: $ python3.1X -m venv venv Error: Command '['venv/bin/python3.1X', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. $ venv/bin/python3.1X -m ensurepip --upgrade --default-pip Traceback (most recent call last): ... File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_internal/commands/install.py", line 15, in from pip._internal.cli.req_command import ( ...<3 lines>... ) File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_internal/cli/req_command.py", line 21, in from pip._internal.index.package_finder import PackageFinder File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_internal/index/package_finder.py", line 30, in from pip._internal.req import InstallRequirement File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_internal/req/__init__.py", line 8, in from .req_install import InstallRequirement File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_internal/req/req_install.py", line 40, in from pip._internal.operations.install.wheel import install_wheel File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_internal/operations/install/wheel.py", line 39, in from pip._vendor.distlib.scripts import ScriptMaker File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 16, in from .compat import sysconfig, detect_encoding, ZipFile File "/tmp/.../pip-24.0-py3-none-any.whl/pip/_vendor/distlib/compat.py", line 81, in import xmlrpc.client as xmlrpclib File "/usr/lib64/python3.1X/xmlrpc/client.py", line 138, in from xml.parsers import expat File "/usr/lib64/python3.1X/xml/parsers/expat.py", line 4, in from pyexpat import * ImportError: /usr/lib64/python3.1X/lib-dynload/pyexpat.cpython-31X-x86_64-linux-gnu.so: undefined symbol: XML_SetReparseDeferralEnabled Traceback (most recent call last): ... subprocess.CalledProcessError: Command '['venv/bin/python3.1X', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/.../pip-24.0-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/...\', \'--upgrade\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1. Thanks to Markus Falb for discovering this problem. https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/7XHGWHBQDNFKNGSZTP44SSD6PQKZPG6C/ --- python3.13.spec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 7c911e8..10742b3 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a6 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -263,7 +263,8 @@ BuildRequires: bluez-libs-devel BuildRequires: bzip2 BuildRequires: bzip2-devel BuildRequires: desktop-file-utils -BuildRequires: expat-devel +# See the runtime requirement in the -libs subpackage +BuildRequires: expat-devel >= 2.6 BuildRequires: findutils BuildRequires: gcc-c++ @@ -541,6 +542,14 @@ Recommends: (%{pkgname}-tkinter%{?_isa} = %{version}-%{release} if tk%{?_isa}) # The zoneinfo module needs tzdata Requires: tzdata +# The requirement on libexpat is generated, but we need to version it. +# When built with expat >= 2.6, but installed with older expat, we get: +# ImportError: /usr/lib64/python3.X/lib-dynload/pyexpat.cpython-....so: +# undefined symbol: XML_SetReparseDeferralEnabled +# This breaks many things, including python -m venv. +# Other subpackages (like -debug) also need this, but they all depend on -libs. +Requires: expat >= 2.6 + %description -n %{pkgname}-libs This package contains runtime libraries for use by Python: - the majority of the Python standard library @@ -1682,6 +1691,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Apr 17 2024 Miro Hrončok - 3.13.0~a6-2 +- Require expat >= 2.6 to prevent errors when creating venvs with older expat + * Wed Apr 10 2024 Karolina Surma - 3.13.0~a6-1 - Update to Python 3.13.0a6 From 0898154cc94c4661b836b170164bc688621734fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 6 May 2024 11:41:41 +0200 Subject: [PATCH 020/115] Build Python with -O3 https://fedoraproject.org/wiki/Changes/Python_built_with_gcc_O3 --- python3.13.spec | 31 ++++++++++++++++++++++--------- tests/tests.yml | 11 +++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 10742b3..58380aa 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel a6 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -226,6 +226,15 @@ Provides: bundled(python3dist(packaging)) = 24 %global py_INSTSONAME_freethreading libpython%{LDVERSION_freethreading}.so.%{py_SOVERSION} %global py_INSTSONAME_freethreading_debug libpython%{LDVERSION_freethreading_debug}.so.%{py_SOVERSION} +# The -O flag for the compiler, optimized builds +# https://fedoraproject.org/wiki/Changes/Python_built_with_gcc_O3 +%global optflags_optimized -O3 +# The -O flag for the compiler, debug builds +# -Wno-cpp avoids some warnings with -O0 +%global optflags_debug -O0 -Wno-cpp +# Remove the default -O2 flag, our flags are applied in %%build/%%install +%global __global_compiler_flags %(echo '%{__global_compiler_flags}' | sed 's/-O[[:digit:]]//') + # Disable automatic bytecompilation. The python3 binary is not yet be # available in /usr/bin when Python is built. Also, the bytecompilation fails # on files that test invalid syntax. @@ -918,23 +927,23 @@ BuildPython() { # See also: https://bugzilla.redhat.com/show_bug.cgi?id=1818857 BuildPython debug \ "--without-ensurepip --with-pydebug" \ - "-O0 -Wno-cpp" + "%{optflags_debug}" %endif # with debug_build BuildPython optimized \ "--without-ensurepip %{optimizations_flag}" \ - "" + "%{optflags_optimized}" %if %{with freethreading_build} && %{with debug_build} BuildPython freethreading-debug \ "--without-ensurepip --with-pydebug --disable-gil" \ - "-O0 -Wno-cpp" + "%{optflags_debug}" %endif # with freethreading_build && debug_build %if %{with freethreading_build} BuildPython freethreading \ "--without-ensurepip %{optimizations_flag} --disable-gil" \ - "" + "%{optflags_optimized}" %endif # with freethreading_build # ====================================================== @@ -1041,14 +1050,14 @@ EOF # Now the freethreading debug build: InstallPython freethreading-debug \ %{py_INSTSONAME_freethreading_debug} \ - "" \ + "%{optflags_debug}" \ %{LDVERSION_freethreading_debug} %endif # with freethreading_build && debug_build %if %{with debug_build} InstallPython debug \ %{py_INSTSONAME_debug} \ - -O0 \ + "%{optflags_debug}" \ %{LDVERSION_debug} %endif # with debug_build @@ -1056,14 +1065,14 @@ InstallPython debug \ # Now the freethreading optimized build: InstallPython freethreading \ %{py_INSTSONAME_freethreading} \ - "" \ + "%{optflags_optimized}" \ %{LDVERSION_freethreading} %endif # with freethreading_build # Now the optimized build: InstallPython optimized \ %{py_INSTSONAME_optimized} \ - "" \ + "%{optflags_optimized}" \ %{LDVERSION_optimized} # Install directories for additional packages @@ -1691,6 +1700,10 @@ CheckPython freethreading # ====================================================== %changelog +* Mon May 06 2024 Miro Hrončok - 3.13.0~a6-3 +- Build Python with -O3 +- https://fedoraproject.org/wiki/Changes/Python_built_with_gcc_O3 + * Wed Apr 17 2024 Miro Hrončok - 3.13.0~a6-2 - Require expat >= 2.6 to prevent errors when creating venvs with older expat diff --git a/tests/tests.yml b/tests/tests.yml index 4ba56aa..fb2659f 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -34,9 +34,18 @@ - debugtest: dir: python/selftest run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes' ./parallel.sh" + - optimizedflags: + dir: python/flags + run: "python{{ pybasever }} ./assertflags.py -O3" - debugflags: dir: python/flags run: "python{{ pybasever }}d ./assertflags.py -O0" + - freethreadingflags: + dir: python/flags + run: "python{{ pybasever }}t ./assertflags.py -O3" + - freethreadingdebugflags: + dir: python/flags + run: "python{{ pybasever }}td ./assertflags.py -O0" - marshalparser: dir: python/marshalparser run: "VERSION={{ pybasever }} SAMPLE=10 test_marshalparser_compatibility.sh" @@ -49,6 +58,8 @@ - "python{{ pybasever }}-devel" # for extension building in venv and selftest - "python{{ pybasever }}-tkinter" # for selftest - "python{{ pybasever }}-test" # for selftest + - "python{{ pybasever }}-freethreading" # for -O... flag test + - "python{{ pybasever }}-freethreading-debug" # for -O... flag test - tox # for venv tests - virtualenv # for virtualenv tests - glibc-all-langpacks # for locale tests From 1c243743626022b87799c276f70d265bf3124f18 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 9 May 2024 10:17:01 +0200 Subject: [PATCH 021/115] Update to Python 3.13.0b1 --- 00251-change-user-install-location.patch | 12 ++-- ...st-wheeldata-when-it-s-actually-used.patch | 28 --------- ...fix-pgo-tests-in-free-threaded-build.patch | 58 +++++++++++++++++++ python3.13.spec | 34 +++++------ sources | 4 +- 5 files changed, 82 insertions(+), 54 deletions(-) delete mode 100644 00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch create mode 100644 00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 823059e..cd0aa2f 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,10 +30,10 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index 162bbec4f8..40c5981e03 100644 +index b63447d667..2476b1a484 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -395,8 +395,15 @@ def getsitepackages(prefixes=None): +@@ -404,8 +404,15 @@ def getsitepackages(prefixes=None): return sitepackages def addsitepackages(known_paths, prefixes=None): @@ -51,7 +51,7 @@ index 162bbec4f8..40c5981e03 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 70bdecf213..5cd75a3b96 100644 +index 98a14e5d3a..8369073fee 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -130,7 +130,7 @@ index 70bdecf213..5cd75a3b96 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 61c6a5a425..fd5fbe17ad 100644 +index 9233304c6a..4acaad5ed6 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -121,8 +121,19 @@ def test_get_path(self): @@ -154,7 +154,7 @@ index 61c6a5a425..fd5fbe17ad 100644 os.path.normpath(expected), ) -@@ -357,7 +368,7 @@ def test_get_config_h_filename(self): +@@ -377,7 +388,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -163,7 +163,7 @@ index 61c6a5a425..fd5fbe17ad 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -369,6 +380,8 @@ def test_symlink(self): # Issue 7880 +@@ -389,6 +400,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch b/00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch deleted file mode 100644 index 1946abb..0000000 --- a/00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Wed, 10 Apr 2024 15:35:04 +0200 -Subject: [PATCH] 00425: Only check for 'test/wheeldata' when it's actually - used - -We build Python in Fedora 39+ with option `--with-wheel-pkg-dir` -pointing to a custom wheel directory and delete the contents of -upstream's `test/wheeldata`. Don't include the directory in the test set -if the wheels are used from a different location. ---- - Lib/test/test_tools/test_makefile.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/Lib/test/test_tools/test_makefile.py b/Lib/test/test_tools/test_makefile.py -index 29f5c28e33..b0dc56c714 100644 ---- a/Lib/test/test_tools/test_makefile.py -+++ b/Lib/test/test_tools/test_makefile.py -@@ -67,6 +67,9 @@ def test_makefile_test_folders(self): - ) - used.append(relpath) - -+ if sysconfig.get_config_var('WHEEL_PKG_DIR'): -+ test_dirs.remove('test/wheeldata') -+ - # Check that there are no extra entries: - unique_test_dirs = set(test_dirs) - self.assertSetEqual(unique_test_dirs, set(used)) diff --git a/00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch b/00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch new file mode 100644 index 0000000..b56a0f6 --- /dev/null +++ b/00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sam Gross +Date: Thu, 9 May 2024 16:06:20 -0400 +Subject: [PATCH] 00428: gh-118846: Fix PGO tests in free-threaded build + +Avoid immortalizing objects in tests that verify garbage collection of +classes or modules. + +This fixes test_ordered_dict and test_struct. + +(cherry picked from commit 1b1db2fd9a531e26b79b34667bccfb938c4d184d) +--- + Lib/test/test_ordered_dict.py | 3 ++- + Lib/test/test_struct.py | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py +index 4571b23dfe..06a0e81227 100644 +--- a/Lib/test/test_ordered_dict.py ++++ b/Lib/test/test_ordered_dict.py +@@ -10,7 +10,7 @@ + import weakref + from collections.abc import MutableMapping + from test import mapping_tests, support +-from test.support import import_helper ++from test.support import import_helper, suppress_immortalization + + + py_coll = import_helper.import_fresh_module('collections', +@@ -667,6 +667,7 @@ def test_dict_update(self): + dict.update(od, [('spam', 1)]) + self.assertNotIn('NULL', repr(od)) + ++ @suppress_immortalization() + def test_reference_loop(self): + # Issue 25935 + OrderedDict = self.OrderedDict +diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py +index 15f6ee06ff..5508cc3eec 100644 +--- a/Lib/test/test_struct.py ++++ b/Lib/test/test_struct.py +@@ -9,7 +9,7 @@ + import weakref + + from test import support +-from test.support import import_helper ++from test.support import import_helper, suppress_immortalization + from test.support.script_helper import assert_python_ok + + ISBIGENDIAN = sys.byteorder == "big" +@@ -674,6 +674,7 @@ def __del__(self): + self.assertIn(b"Exception ignored in:", stderr) + self.assertIn(b"C.__del__", stderr) + ++ @suppress_immortalization() + def test__struct_reference_cycle_cleaned_up(self): + # Regression test for python/cpython#94207. + diff --git a/python3.13.spec b/python3.13.spec index 58380aa..4bfe050 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel a6 +%global prerel b1 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -141,13 +141,7 @@ Provides: bundled(python3dist(packaging)) = 24 # Extra build without GIL, the freethreading PEP 703 provisional way # (the -freethreading subpackage) -# support for s390x is pending investigation in -# https://github.com/python/cpython/issues/117755 -%ifnarch s390x %bcond_without freethreading_build -%else -%bcond_with freethreading_build -%endif # Support for the GDB debugger %bcond_without gdb_hooks @@ -384,14 +378,14 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00425 # a563ac3076a00f0f48b3f94ff63d91d37cb4f1e9 -# Only check for 'test/wheeldata' when it's actually used +# 00428 # 8c674ea0d9368e1b239bc9c7ee6044d925e252a4 +# gh-118846: Fix PGO tests in free-threaded build # -# We build Python in Fedora 39+ with option `--with-wheel-pkg-dir` -# pointing to a custom wheel directory and delete the contents of -# upstream's `test/wheeldata`. Don't include the directory in the test set -# if the wheels are used from a different location. -Patch425: 00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch +# Avoid immortalizing objects in tests that verify garbage collection of +# classes or modules. +# +# This fixes test_ordered_dict and test_struct. +Patch428: 00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch # (New patches go here ^^^) # @@ -1346,6 +1340,7 @@ CheckPython freethreading %dir %{pylibdir}/__pycache__/ %{pylibdir}/__pycache__/*%{bytecode_suffixes} +%{pylibdir}/_pyrepl/ %{pylibdir}/asyncio/ %{pylibdir}/collections/ %{pylibdir}/concurrent/ @@ -1431,6 +1426,9 @@ CheckPython freethreading %{dynload_dir}/_elementtree.%{1}.so\ %{dynload_dir}/_hashlib.%{1}.so\ %{dynload_dir}/_heapq.%{1}.so\ +%{dynload_dir}/_interpchannels.%{1}.so\ +%{dynload_dir}/_interpqueues.%{1}.so\ +%{dynload_dir}/_interpreters.%{1}.so\ %{dynload_dir}/_json.%{1}.so\ %{dynload_dir}/_lsprof.%{1}.so\ %{dynload_dir}/_lzma.%{1}.so\ @@ -1577,9 +1575,6 @@ CheckPython freethreading %{dynload_dir}/_testlimitedcapi.%{1}.so\ %{dynload_dir}/_testmultiphase.%{1}.so\ %{dynload_dir}/_testsinglephase.%{1}.so\ -%{dynload_dir}/_xxinterpchannels.%{1}.so\ -%{dynload_dir}/_xxinterpqueues.%{1}.so\ -%{dynload_dir}/_xxsubinterpreters.%{1}.so\ %{dynload_dir}/_xxtestfuzz.%{1}.so\ %{dynload_dir}/xxlimited.%{1}.so\ %{dynload_dir}/xxlimited_35.%{1}.so\ @@ -1700,6 +1695,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu May 09 2024 Karolina Surma - 3.13.0~b1-1 +- Update to Python 3.13.0b1 + * Mon May 06 2024 Miro Hrončok - 3.13.0~a6-3 - Build Python with -O3 - https://fedoraproject.org/wiki/Changes/Python_built_with_gcc_O3 diff --git a/sources b/sources index 530c12a..f78212a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0a6.tar.xz) = 6e999c718cdfede4abc52297aae7160a2864424e8f49a47321fa822d40c331a3d061a0982e355351a0c4bea40e9b1ec3832d76a7f4b6b3986b62fca2757f0ca1 -SHA512 (Python-3.13.0a6.tar.xz.asc) = 1ec2abe8198a5fbd98490274bed7e84b48fcfc6ff25fcb474455d9f33b62673cfb7cf4939b304684aed005975d166143cb644b9a3e484d25de3dacb869de0131 +SHA512 (Python-3.13.0b1.tar.xz) = 81cc1d8691bfcc8f8bb232ea15c18039d0df036f5cbc1667fec3b6c34cdf198bed97418ec775c037778c250b7bc4f35bd5fb938dd478cc17fc48c74b8a2b2d19 +SHA512 (Python-3.13.0b1.tar.xz.asc) = c10832b5016ad9a9588b7efd29a35272c1c07b444df116c397fed82d66f30150687d68a6853637094be2fe1d8ed0928a9cd151617c91d9eb9938ba1385bd7143 From 7b82077f4937f4d623ad5f9ec47c6e76b2653abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 6 Jun 2024 01:32:42 +0200 Subject: [PATCH 022/115] Update to Python 3.13.0b2 --- 00251-change-user-install-location.patch | 4 +- ...fix-pgo-tests-in-free-threaded-build.patch | 58 ------------------- python3.13.spec | 14 ++--- sources | 4 +- 4 files changed, 8 insertions(+), 72 deletions(-) delete mode 100644 00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index cd0aa2f..1381023 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,10 +30,10 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index b63447d667..2476b1a484 100644 +index 7eace190f5..8d193abfbb 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -404,8 +404,15 @@ def getsitepackages(prefixes=None): +@@ -406,8 +406,15 @@ def getsitepackages(prefixes=None): return sitepackages def addsitepackages(known_paths, prefixes=None): diff --git a/00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch b/00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch deleted file mode 100644 index b56a0f6..0000000 --- a/00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Sam Gross -Date: Thu, 9 May 2024 16:06:20 -0400 -Subject: [PATCH] 00428: gh-118846: Fix PGO tests in free-threaded build - -Avoid immortalizing objects in tests that verify garbage collection of -classes or modules. - -This fixes test_ordered_dict and test_struct. - -(cherry picked from commit 1b1db2fd9a531e26b79b34667bccfb938c4d184d) ---- - Lib/test/test_ordered_dict.py | 3 ++- - Lib/test/test_struct.py | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py -index 4571b23dfe..06a0e81227 100644 ---- a/Lib/test/test_ordered_dict.py -+++ b/Lib/test/test_ordered_dict.py -@@ -10,7 +10,7 @@ - import weakref - from collections.abc import MutableMapping - from test import mapping_tests, support --from test.support import import_helper -+from test.support import import_helper, suppress_immortalization - - - py_coll = import_helper.import_fresh_module('collections', -@@ -667,6 +667,7 @@ def test_dict_update(self): - dict.update(od, [('spam', 1)]) - self.assertNotIn('NULL', repr(od)) - -+ @suppress_immortalization() - def test_reference_loop(self): - # Issue 25935 - OrderedDict = self.OrderedDict -diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py -index 15f6ee06ff..5508cc3eec 100644 ---- a/Lib/test/test_struct.py -+++ b/Lib/test/test_struct.py -@@ -9,7 +9,7 @@ - import weakref - - from test import support --from test.support import import_helper -+from test.support import import_helper, suppress_immortalization - from test.support.script_helper import assert_python_ok - - ISBIGENDIAN = sys.byteorder == "big" -@@ -674,6 +674,7 @@ def __del__(self): - self.assertIn(b"Exception ignored in:", stderr) - self.assertIn(b"C.__del__", stderr) - -+ @suppress_immortalization() - def test__struct_reference_cycle_cleaned_up(self): - # Regression test for python/cpython#94207. - diff --git a/python3.13.spec b/python3.13.spec index 4bfe050..4e7e73d 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel b1 +%global prerel b2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} Release: 1%{?dist} @@ -378,15 +378,6 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00428 # 8c674ea0d9368e1b239bc9c7ee6044d925e252a4 -# gh-118846: Fix PGO tests in free-threaded build -# -# Avoid immortalizing objects in tests that verify garbage collection of -# classes or modules. -# -# This fixes test_ordered_dict and test_struct. -Patch428: 00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1695,6 +1686,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Jun 05 2024 Miro Hrončok - 3.13.0~b2-1 +- Update to Python 3.13.0b2 + * Thu May 09 2024 Karolina Surma - 3.13.0~b1-1 - Update to Python 3.13.0b1 diff --git a/sources b/sources index f78212a..2ac030e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0b1.tar.xz) = 81cc1d8691bfcc8f8bb232ea15c18039d0df036f5cbc1667fec3b6c34cdf198bed97418ec775c037778c250b7bc4f35bd5fb938dd478cc17fc48c74b8a2b2d19 -SHA512 (Python-3.13.0b1.tar.xz.asc) = c10832b5016ad9a9588b7efd29a35272c1c07b444df116c397fed82d66f30150687d68a6853637094be2fe1d8ed0928a9cd151617c91d9eb9938ba1385bd7143 +SHA512 (Python-3.13.0b2.tar.xz) = 3a37c8137958a6ebaf06f5a03b28c7817f359f346d820a9989932b1a716478647e8d1b94c1a08197bcabf68cd90443a08ab9454af9151eace52401d8b60d0c35 +SHA512 (Python-3.13.0b2.tar.xz.asc) = 17091aba45ebd8c8feb3e9c54854e20dcd44fec4a1c08c9c0c4593166c407c4ad2b245a0e0893afc83a43e8b461a557fa1d6691c87a6a5ebc97ea448a9201c87 From db3aa2889c791c175c5346a05d1c1a71d484969b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 6 Jun 2024 07:27:34 +0200 Subject: [PATCH 023/115] Skip test_gdb for now --- python3.13.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index 4e7e73d..bf69e4b 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1265,6 +1265,7 @@ CheckPython() { # test_check_probes is failing since it was introduced in 3.12.0rc1, # the test is skipped until it is fixed in upstream. # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 + # test_gdb is skipped due to https://bugzilla.redhat.com/2275274#c11 # test.regrtest fails if SOURCE_DATE_EPOCH is set # https://github.com/python/cpython/issues/110932 unset SOURCE_DATE_EPOCH @@ -1272,6 +1273,7 @@ CheckPython() { -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ -i test_check_probes \ + -x test_gdb \ %ifarch %{mips64} -x test_ctypes \ %endif From fe953219938265fbdb763a9254cc02e2781dc568 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 6 Jun 2024 11:35:31 +0200 Subject: [PATCH 024/115] Skip test_signal for now --- python3.13.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index bf69e4b..b86186f 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1266,6 +1266,7 @@ CheckPython() { # the test is skipped until it is fixed in upstream. # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 # test_gdb is skipped due to https://bugzilla.redhat.com/2275274#c11 + # test_signal is skipped due to https://github.com/python/cpython/issues/118989 # test.regrtest fails if SOURCE_DATE_EPOCH is set # https://github.com/python/cpython/issues/110932 unset SOURCE_DATE_EPOCH @@ -1277,6 +1278,9 @@ CheckPython() { %ifarch %{mips64} -x test_ctypes \ %endif + %ifarch s390x + -x test_signal \ + %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName From e2f294c9e269fefd7778cd26e1a5472c13ded70c Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 6 Jun 2024 11:36:26 +0200 Subject: [PATCH 025/115] Keep SOURCE_DATE_EPOCH set --- python3.13.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index b86186f..d056efa 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1267,9 +1267,6 @@ CheckPython() { # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 # test_gdb is skipped due to https://bugzilla.redhat.com/2275274#c11 # test_signal is skipped due to https://github.com/python/cpython/issues/118989 - # test.regrtest fails if SOURCE_DATE_EPOCH is set - # https://github.com/python/cpython/issues/110932 - unset SOURCE_DATE_EPOCH LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ From 3aedd5cc92bf4959cee1ca6b4e4e7e30fccbe922 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 6 Jun 2024 11:38:13 +0200 Subject: [PATCH 026/115] Fedora 38 is EOL, always build with rpmwheels --- python3.13.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index d056efa..d44d76d 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -62,12 +62,7 @@ License: Python-2.0.1 # Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages # Uses upstream bundled prebuilt wheels otherwise -# Only F39+ has a pip new enough to work with Python 3.12 -%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10 %bcond_without rpmwheels -%else -%bcond_with rpmwheels -%endif # If the rpmwheels condition is disabled, we use the bundled wheel packages # from Python with the versions below. # This needs to be manually updated when we update Python. From a84345561014ffa696a390b9985907f951a7acd1 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Thu, 6 Jun 2024 16:08:11 +0200 Subject: [PATCH 027/115] Bootstrap for Python 3.13 --- python3.13.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index d44d76d..0da5d22 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -58,11 +58,11 @@ License: Python-2.0.1 # IMPORTANT: When bootstrapping, it's very likely python-pip-wheel is # not available. Turn off the rpmwheels bcond until # python-pip is built with a wheel to get around the issue. -%bcond_with bootstrap +%bcond_without bootstrap # Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages # Uses upstream bundled prebuilt wheels otherwise -%bcond_without rpmwheels +%bcond_with rpmwheels # If the rpmwheels condition is disabled, we use the bundled wheel packages # from Python with the versions below. # This needs to be manually updated when we update Python. @@ -125,10 +125,10 @@ Provides: bundled(python3dist(packaging)) = 24 } # Expensive optimizations (mainly, profile-guided optimizations) -%bcond_without optimizations +%bcond_with optimizations # Run the test suite in %%check -%bcond_without tests +%bcond_with tests # Extra build for debugging the interpreter or C-API extensions # (the -debug subpackages) @@ -1684,6 +1684,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Jun 06 2024 Python Maint - 3.13.0~b2-2 +- Bootstrap for Python 3.13 + * Wed Jun 05 2024 Miro Hrončok - 3.13.0~b2-1 - Update to Python 3.13.0b2 From 5cf9f2e9e5bcf78ee01a8384c40eca1edecd825b Mon Sep 17 00:00:00 2001 From: Python Maint Date: Thu, 6 Jun 2024 18:27:18 +0200 Subject: [PATCH 028/115] Rebuilt for Python 3.13 --- python3.13.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 0da5d22..6ae61cb 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -58,11 +58,11 @@ License: Python-2.0.1 # IMPORTANT: When bootstrapping, it's very likely python-pip-wheel is # not available. Turn off the rpmwheels bcond until # python-pip is built with a wheel to get around the issue. -%bcond_without bootstrap +%bcond_with bootstrap # Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages # Uses upstream bundled prebuilt wheels otherwise -%bcond_with rpmwheels +%bcond_without rpmwheels # If the rpmwheels condition is disabled, we use the bundled wheel packages # from Python with the versions below. # This needs to be manually updated when we update Python. @@ -125,10 +125,10 @@ Provides: bundled(python3dist(packaging)) = 24 } # Expensive optimizations (mainly, profile-guided optimizations) -%bcond_with optimizations +%bcond_without optimizations # Run the test suite in %%check -%bcond_with tests +%bcond_without tests # Extra build for debugging the interpreter or C-API extensions # (the -debug subpackages) @@ -1684,6 +1684,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Jun 06 2024 Python Maint - 3.13.0~b2-3 +- Rebuilt for Python 3.13 + * Thu Jun 06 2024 Python Maint - 3.13.0~b2-2 - Bootstrap for Python 3.13 From 29ab7b7006c2dcc24bd0b603412428578fd11cf7 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Fri, 7 Jun 2024 14:06:06 +0200 Subject: [PATCH 029/115] Skip test_deadlock on s390x --- python3.13.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index 6ae61cb..db59320 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1262,6 +1262,8 @@ CheckPython() { # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 # test_gdb is skipped due to https://bugzilla.redhat.com/2275274#c11 # test_signal is skipped due to https://github.com/python/cpython/issues/118989 + # test.test_concurrent_futures.test_deadlock tends to time out on s390x in + # freethreading{,-debug} build, skipping it to shorten the build time LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ @@ -1272,6 +1274,7 @@ CheckPython() { %endif %ifarch s390x -x test_signal \ + -i test_deadlock \ %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName From f1315eaf0bf93ef8f7d514df1529ebce303a4efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 12 May 2024 19:32:37 +0200 Subject: [PATCH 030/115] On Fedora 40+ x86_64 and aarch64, build Python with the experimental JIT compiler --- ...ition-when-generating-jit_stencils-h.patch | 40 +++++++++++++++++++ python3.13.spec | 38 ++++++++++++++++-- 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch diff --git a/00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch b/00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch new file mode 100644 index 0000000..f6ab16e --- /dev/null +++ b/00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Tue, 18 Jun 2024 15:25:31 +0200 +Subject: [PATCH] 00429: GH-118943: Fix another race condition when generating + jit_stencils.h + +Another process might have already moved jit_stencils.h.new +--- + .../Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst | 3 +++ + Tools/jit/_targets.py | 7 ++++++- + 2 files changed, 9 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst + +diff --git a/Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst b/Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst +new file mode 100644 +index 0000000000..997c990a96 +--- /dev/null ++++ b/Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst +@@ -0,0 +1,3 @@ ++Fix a possible race condition affecting parallel builds configured with ++``--enable-experimental-jit``, in which :exc:`FileNotFoundError` could be caused by ++another process already moving ``jit_stencils.h.new`` to ``jit_stencils.h``. +diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py +index 5604c429bc..73d10a1287 100644 +--- a/Tools/jit/_targets.py ++++ b/Tools/jit/_targets.py +@@ -221,7 +221,12 @@ def build( + file.write("\n") + for line in _writer.dump(stencil_groups): + file.write(f"{line}\n") +- jit_stencils_new.replace(jit_stencils) ++ try: ++ jit_stencils_new.replace(jit_stencils) ++ except FileNotFoundError: ++ # another process probably already moved the file ++ if not jit_stencils.is_file(): ++ raise + finally: + jit_stencils_new.unlink(missing_ok=True) + diff --git a/python3.13.spec b/python3.13.spec index db59320..32ef5b1 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 4%{?dist} License: Python-2.0.1 @@ -138,6 +138,22 @@ Provides: bundled(python3dist(packaging)) = 24 # (the -freethreading subpackage) %bcond_without freethreading_build +# PEP 744: JIT Compilation +# Whether to build with the experimental JIT compiler +# We can only have this on Fedora 40+, where clang 18+ is available +# And only on certain architectures: https://peps.python.org/pep-0744/#support +# The freethreading build (when enabled) does not support JIT yet +%bcond_with jit +%ifarch x86_64 aarch64 +%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10 +%bcond_without jit +%endif +%endif +%if %{with jit} +# When built with JIT, it still needs to be enabled on runtime via PYTHON_JIT=1 +%global jit_flag --enable-experimental-jit=yes-off +%endif + # Support for the GDB debugger %bcond_without gdb_hooks @@ -299,6 +315,11 @@ BuildRequires: tcl-devel BuildRequires: tk-devel BuildRequires: tzdata +%if %{with jit} +BuildRequires: clang(major) = 18 +BuildRequires: llvm(major) = 18 +%endif + %if %{with valgrind} BuildRequires: valgrind-devel %endif @@ -373,6 +394,12 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch +# 00429 # fa7831be5e5365646d4dd400e23e977f83f64923 +# GH-118943: Fix another race condition when generating jit_stencils.h +# +# Another process might have already moved jit_stencils.h.new +Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -906,12 +933,12 @@ BuildPython() { # option produces too many warnings when compiling at the O0 optimization level. # See also: https://bugzilla.redhat.com/show_bug.cgi?id=1818857 BuildPython debug \ - "--without-ensurepip --with-pydebug" \ + "--without-ensurepip --with-pydebug %{?jit_flag}" \ "%{optflags_debug}" %endif # with debug_build BuildPython optimized \ - "--without-ensurepip %{optimizations_flag}" \ + "--without-ensurepip %{?jit_flag} %{optimizations_flag}" \ "%{optflags_optimized}" %if %{with freethreading_build} && %{with debug_build} @@ -1687,6 +1714,11 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Jun 18 2024 Miro Hrončok - 3.13.0~b2-4 +- On Fedora 40+ x86_64 and aarch64, build Python with the experimental JIT compiler +- To enable it on runtime, set the PYTHON_JIT environment variable to 1 +- https://peps.python.org/pep-0744/ + * Thu Jun 06 2024 Python Maint - 3.13.0~b2-3 - Rebuilt for Python 3.13 From 917cccffae0471dd9b207e2079ccb312db9239d3 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Fri, 28 Jun 2024 10:38:31 +0200 Subject: [PATCH 031/115] Update to Python 3.13.0b3 --- python3.13.spec | 44 +++++++++++++++++++++----------------------- sources | 4 ++-- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 32ef5b1..127f3ec 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel b2 +%global prerel b3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 4%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -68,37 +68,32 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 24.0 +%global pip_version 24.1.1 %global setuptools_version 67.6.1 %global wheel_version 0.43.0 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: -Provides: bundled(python3dist(cachecontrol)) = 0.13.1 -Provides: bundled(python3dist(certifi)) = 2023.7.22 -Provides: bundled(python3dist(chardet)) = 5.1 -Provides: bundled(python3dist(colorama)) = 0.4.6 +Provides: bundled(python3dist(cachecontrol)) = 0.14 +Provides: bundled(python3dist(certifi)) = 2024.2.2 Provides: bundled(python3dist(distlib)) = 0.3.8 -Provides: bundled(python3dist(distro)) = 1.8 -Provides: bundled(python3dist(idna)) = 3.4 -Provides: bundled(python3dist(msgpack)) = 1.0.5 -Provides: bundled(python3dist(packaging)) = 21.3 -Provides: bundled(python3dist(platformdirs)) = 3.8.1 -Provides: bundled(python3dist(pygments)) = 2.15.1 -Provides: bundled(python3dist(pyparsing)) = 3.1 +Provides: bundled(python3dist(distro)) = 1.9 +Provides: bundled(python3dist(idna)) = 3.7 +Provides: bundled(python3dist(msgpack)) = 1.0.8 +Provides: bundled(python3dist(packaging)) = 24.1 +Provides: bundled(python3dist(platformdirs)) = 4.2.1 +Provides: bundled(python3dist(pygments)) = 2.17.2 Provides: bundled(python3dist(pyproject-hooks)) = 1 -Provides: bundled(python3dist(requests)) = 2.31 +Provides: bundled(python3dist(requests)) = 2.32.3 Provides: bundled(python3dist(resolvelib)) = 1.0.1 -Provides: bundled(python3dist(rich)) = 13.4.2 -Provides: bundled(python3dist(setuptools)) = 68 -Provides: bundled(python3dist(six)) = 1.16 -Provides: bundled(python3dist(tenacity)) = 8.2.2 +Provides: bundled(python3dist(rich)) = 13.7.1 +Provides: bundled(python3dist(setuptools)) = 69.5.1 +Provides: bundled(python3dist(tenacity)) = 8.2.3 Provides: bundled(python3dist(tomli)) = 2.0.1 -Provides: bundled(python3dist(truststore)) = 0.8 -Provides: bundled(python3dist(typing-extensions)) = 4.7.1 -Provides: bundled(python3dist(urllib3)) = 1.26.17 -Provides: bundled(python3dist(webencodings)) = 0.5.1 +Provides: bundled(python3dist(truststore)) = 0.9.1 +Provides: bundled(python3dist(typing-extensions)) = 4.11 +Provides: bundled(python3dist(urllib3)) = 1.26.18 } # setuptools # vendor.txt files not in .whl @@ -1714,6 +1709,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Jun 28 2024 Karolina Surma - 3.13.0~b3-1 +- Update to Python 3.13.0b3 + * Tue Jun 18 2024 Miro Hrončok - 3.13.0~b2-4 - On Fedora 40+ x86_64 and aarch64, build Python with the experimental JIT compiler - To enable it on runtime, set the PYTHON_JIT environment variable to 1 diff --git a/sources b/sources index 2ac030e..58ea498 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0b2.tar.xz) = 3a37c8137958a6ebaf06f5a03b28c7817f359f346d820a9989932b1a716478647e8d1b94c1a08197bcabf68cd90443a08ab9454af9151eace52401d8b60d0c35 -SHA512 (Python-3.13.0b2.tar.xz.asc) = 17091aba45ebd8c8feb3e9c54854e20dcd44fec4a1c08c9c0c4593166c407c4ad2b245a0e0893afc83a43e8b461a557fa1d6691c87a6a5ebc97ea448a9201c87 +SHA512 (Python-3.13.0b3.tar.xz) = 1f0ef2d6f5d450664ad4104b92193b5a2dbe9c79add0a79c35ad9508f9fc7f1a5561efd5e4367defddf45457291524d353705d9a60b3550065920e204c77357d +SHA512 (Python-3.13.0b3.tar.xz.asc) = 3d8bdc8c26441a12518940d264e93a8897042e297ccf9cd2ddec725716a58486475be9462582ee489bd189a4d028b43504f979298174c1b008d521b7ab5fbf1b From 1fc17cc89809853492ceb0ae105679207bfcec25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 2 Jul 2024 11:33:00 +0200 Subject: [PATCH 032/115] Fix a bug that emptied the command history of the Python REPL (~/.python_history) --- ...1245-amend-d611c4c8e9-correct-import.patch | 37 +++++++++++++++++++ python3.13.spec | 9 ++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 00430-gh-121245-amend-d611c4c8e9-correct-import.patch diff --git a/00430-gh-121245-amend-d611c4c8e9-correct-import.patch b/00430-gh-121245-amend-d611c4c8e9-correct-import.patch new file mode 100644 index 0000000..d98110f --- /dev/null +++ b/00430-gh-121245-amend-d611c4c8e9-correct-import.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sergey B Kirpichev +Date: Tue, 2 Jul 2024 12:40:01 +0300 +Subject: [PATCH] 00430: gh-121245: Amend d611c4c8e9 (correct import) (#121255) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Co-authored-by: Miro Hrončok +--- + Lib/site.py | 3 +-- + .../Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst | 2 ++ + 2 files changed, 3 insertions(+), 2 deletions(-) + create mode 100644 Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst + +diff --git a/Lib/site.py b/Lib/site.py +index 8d193abfbb..7fff22328e 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -533,8 +533,7 @@ def register_readline(): + + def write_history(): + try: +- # _pyrepl.__main__ is executed as the __main__ module +- from __main__ import CAN_USE_PYREPL ++ from _pyrepl.main import CAN_USE_PYREPL + except ImportError: + CAN_USE_PYREPL = False + +diff --git a/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst b/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst +new file mode 100644 +index 0000000000..6e9dec2545 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst +@@ -0,0 +1,2 @@ ++Fix a bug in the handling of the command history of the new :term:`REPL` that caused ++the history file to be wiped at REPL exit. diff --git a/python3.13.spec b/python3.13.spec index 127f3ec..e488c8a 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -395,6 +395,10 @@ Patch251: 00251-change-user-install-location.patch # Another process might have already moved jit_stencils.h.new Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch +# 00430 # e6851cbe4b1043e8d99e3f3dfa9c9f286fe0d511 +# gh-121245: Amend d611c4c8e9 (correct import) (#121255) +Patch430: 00430-gh-121245-amend-d611c4c8e9-correct-import.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1709,6 +1713,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Jul 02 2024 Miro Hrončok - 3.13.0~b3-2 +- Fix a bug that emptied the command history of the Python REPL (~/.python_history) + * Fri Jun 28 2024 Karolina Surma - 3.13.0~b3-1 - Update to Python 3.13.0b3 From 4463b58c2fcbd772a2256a8963f1b47f2f6525b6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jul 2024 17:26:54 +0000 Subject: [PATCH 033/115] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index e488c8a..8b7e66b 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -1713,6 +1713,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Jul 19 2024 Fedora Release Engineering - 3.13.0~b3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Jul 02 2024 Miro Hrončok - 3.13.0~b3-2 - Fix a bug that emptied the command history of the Python REPL (~/.python_history) From 6740145ba840026089c8d793327f81b5ee4e2e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 18 Jul 2024 22:01:33 +0200 Subject: [PATCH 034/115] Update to Python 3.13.0b4 The freethreading packages are now located in /usr/lib64/python3.13t See https://github.com/python/cpython/issues/121103 Co-Authored-By: Karolina Surma --- 00251-change-user-install-location.patch | 8 +- ...1245-amend-d611c4c8e9-correct-import.patch | 37 -- ...-in-test_sysconfig-test_user_similar.patch | 30 ++ python3.13.spec | 386 ++++++++++-------- rpmlint.toml | 14 +- sources | 4 +- 6 files changed, 255 insertions(+), 224 deletions(-) delete mode 100644 00430-gh-121245-amend-d611c4c8e9-correct-import.patch create mode 100644 00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 1381023..9edee00 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,10 +30,10 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index 7eace190f5..8d193abfbb 100644 +index 0a0dc47b17..bb42e1cf5a 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -406,8 +406,15 @@ def getsitepackages(prefixes=None): +@@ -414,8 +414,15 @@ def getsitepackages(prefixes=None): return sitepackages def addsitepackages(known_paths, prefixes=None): @@ -51,7 +51,7 @@ index 7eace190f5..8d193abfbb 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 98a14e5d3a..8369073fee 100644 +index 83e057c177..8b167dca31 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -130,7 +130,7 @@ index 98a14e5d3a..8369073fee 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 9233304c6a..4acaad5ed6 100644 +index 37cee92768..ffb63452be 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -121,8 +121,19 @@ def test_get_path(self): diff --git a/00430-gh-121245-amend-d611c4c8e9-correct-import.patch b/00430-gh-121245-amend-d611c4c8e9-correct-import.patch deleted file mode 100644 index d98110f..0000000 --- a/00430-gh-121245-amend-d611c4c8e9-correct-import.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Sergey B Kirpichev -Date: Tue, 2 Jul 2024 12:40:01 +0300 -Subject: [PATCH] 00430: gh-121245: Amend d611c4c8e9 (correct import) (#121255) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Co-authored-by: Miro Hrončok ---- - Lib/site.py | 3 +-- - .../Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst | 2 ++ - 2 files changed, 3 insertions(+), 2 deletions(-) - create mode 100644 Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst - -diff --git a/Lib/site.py b/Lib/site.py -index 8d193abfbb..7fff22328e 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -533,8 +533,7 @@ def register_readline(): - - def write_history(): - try: -- # _pyrepl.__main__ is executed as the __main__ module -- from __main__ import CAN_USE_PYREPL -+ from _pyrepl.main import CAN_USE_PYREPL - except ImportError: - CAN_USE_PYREPL = False - -diff --git a/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst b/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst -new file mode 100644 -index 0000000000..6e9dec2545 ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2024-07-02-11-34-06.gh-issue-121245.sSkDAr.rst -@@ -0,0 +1,2 @@ -+Fix a bug in the handling of the command history of the new :term:`REPL` that caused -+the history file to be wiped at REPL exit. diff --git a/00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch b/00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch new file mode 100644 index 0000000..b023c47 --- /dev/null +++ b/00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Fri, 19 Jul 2024 11:20:27 +0200 +Subject: [PATCH] 00432: Account with abi_thread in + test_sysconfig.test_user_similar + +From https://github.com/python/cpython/pull/122017 +--- + Lib/test/test_sysconfig.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py +index ffb63452be..43cab7ba21 100644 +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -428,10 +428,10 @@ def test_user_similar(self): + # bpo-44860: platlib of posix_user doesn't use sys.platlibdir, + # whereas posix_prefix does. + if name == 'platlib': +- # Replace "/lib64/python3.11/site-packages" suffix +- # with "/lib/python3.11/site-packages". +- py_version_short = sysconfig.get_python_version() +- suffix = f'python{py_version_short}/site-packages' ++ # Replace "/lib64/python3.11{abi_thread}/site-packages" suffix ++ # with "/lib/python3.11{abi_thread}/site-packages". ++ py_version_abi = sysconfig._get_python_version_abi() ++ suffix = f'python{py_version_abi}/site-packages' + expected = expected.replace(f'/{sys.platlibdir}/{suffix}', + f'/lib/{suffix}') + self.assertEqual(user_path, expected) diff --git a/python3.13.spec b/python3.13.spec index 8b7e66b..084f339 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel b3 +%global prerel b4 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -176,9 +176,6 @@ Provides: bundled(python3dist(packaging)) = 24 %global exename python%{pybasever} %endif -%global pylibdir %{_libdir}/python%{pybasever} -%global dynload_dir %{pylibdir}/lib-dynload - # ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac # See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/ %global ABIFLAGS_optimized %{nil} @@ -191,6 +188,13 @@ Provides: bundled(python3dist(packaging)) = 24 %global LDVERSION_freethreading %{pybasever}%{ABIFLAGS_freethreading} %global LDVERSION_freethreading_debug %{pybasever}%{ABIFLAGS_freethreading_debug} +%global pylibdir %{_libdir}/python%{pybasever} +%global dynload_dir %{pylibdir}/lib-dynload +# freethreading libraries are located in e.g. /usr/lib64/python3.13t/ +# https://github.com/python/cpython/issues/121103 +%global pylibdir_freethreading %{pylibdir}%{ABIFLAGS_freethreading} +%global dynload_dir_freethreading %{pylibdir_freethreading}/lib-dynload + # We use the upstream arch triplets, we convert them from %%{_arch}-linux%%{_gnu} %global platform_triplet %{expand:%(echo %{_arch}-linux%{_gnu} | sed -E \\ -e 's/^arm(eb)?-linux-gnueabi$/arm\\1-linux-gnueabihf/' \\ @@ -395,9 +399,11 @@ Patch251: 00251-change-user-install-location.patch # Another process might have already moved jit_stencils.h.new Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch -# 00430 # e6851cbe4b1043e8d99e3f3dfa9c9f286fe0d511 -# gh-121245: Amend d611c4c8e9 (correct import) (#121255) -Patch430: 00430-gh-121245-amend-d611c4c8e9-correct-import.patch +# 00432 # 74b8ebb01dac2390dea7d76a8040ad54198c73c4 +# Account with abi_thread in test_sysconfig.test_user_similar +# +# From https://github.com/python/cpython/pull/122017 +Patch432: 00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch # (New patches go here ^^^) # @@ -722,17 +728,30 @@ The debug runtime additionally supports debug builds of C-API extensions # At least until the PEP 703 build remains provisional. %package -n python%{pybasever}-freethreading Summary: Free Threading (PEP 703) version of the Python runtime -License: %{libs_license} -# The freethreading build is an all-in-one package version of the regular build, and -# shares the same .py/.pyc files and directories as the regular build. Hence -# we depend on all of the subpackages of the regular build: -Requires: %{pkgname}%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-devel%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-test%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-tkinter%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release} +%if %{with rpmwheels} +Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 +Requires: %{python_wheel_pkg_prefix}-setuptools-wheel +Requires: %{python_wheel_pkg_prefix}-wheel-wheel +License: %{libs_license} +%else +Provides: bundled(python3dist(pip)) = %{pip_version} +%pip_bundled_provides +Provides: bundled(python3dist(setuptools)) = %{setuptools_version} +%setuptools_bundled_provides +Provides: bundled(python3dist(wheel)) = %{wheel_version} +%wheel_bundled_provides +# License combined from Python libs + pip + setuptools + wheel +License: %{libs_license} AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) +%endif + +# This package doesn't depend on python3-libs, so we need to explicitly +# define the same Provides and Requires. +# See the comments in the definition of -libs subpackage for detailed explanations +Provides: bundled(libb2) = 0.98.1 +Provides: bundled(mimalloc) = 2.12 +Requires: tzdata +Requires: expat >= 2.6 %description -n python%{pybasever}-freethreading The provisional Free Threading (PEP 703) build of Python. @@ -752,15 +771,8 @@ and with the necessary changes needed to make the interpreter thread-safe. Summary: Free Threading (PEP 703) version of the Python runtime (debug build) License: %{libs_license} -# The debug build is an all-in-one package version of the regular build, and -# shares the same .py/.pyc files and directories as the regular build. Hence -# we depend on all of the subpackages of the regular build: -Requires: %{pkgname}%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-devel%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-test%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-tkinter%{?_isa} = %{version}-%{release} -Requires: %{pkgname}-idle%{?_isa} = %{version}-%{release} +# This uses the pure Python modules from the freethreading package +Requires: python%{pybasever}-freethreading%{?_isa} = %{version}-%{release} %description -n python%{pybasever}-freethreading-debug The provisional Free Threading (PEP 703) build of Python. Debug build. @@ -1090,6 +1102,9 @@ install -d -m 0755 %{buildroot}%{pylibdir}/site-packages/__pycache__ # Note that rpmlint will complain about hardcoded library path; # this is intentional. install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}/site-packages/__pycache__ +%if %{with freethreading_build} +install -d -m 0755 %{buildroot}%{_prefix}/lib/python%{pybasever}%{ABIFLAGS_freethreading}/site-packages/__pycache__ +%endif # with freethreading_build %endif %if %{with main_python} @@ -1156,7 +1171,7 @@ find . -name "*~" -exec rm -f {} \; %if 0%{?clamp_mtime_to_source_date_epoch} LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ PYTHONPATH="%{_rpmconfigdir}/redhat" \ -%{buildroot}%{_bindir}/python%{pybasever} -s -B -m clamp_source_mtime %{buildroot}%{pylibdir} +%{buildroot}%{_bindir}/python%{pybasever} -s -B -m clamp_source_mtime %{buildroot}%{pylibdir} %{?with_freethreading_build:%{buildroot}%{pylibdir_freethreading}} %endif # compileall CMD line options: # -f - force rebuild even if timestamps are up to date @@ -1354,59 +1369,61 @@ CheckPython freethreading %license %{pylibdir}/LICENSE.txt # Pure Python modules -%{pylibdir}/*.py -%dir %{pylibdir}/__pycache__/ -%{pylibdir}/__pycache__/*%{bytecode_suffixes} - -%{pylibdir}/_pyrepl/ -%{pylibdir}/asyncio/ -%{pylibdir}/collections/ -%{pylibdir}/concurrent/ -%{pylibdir}/ctypes/ -%{pylibdir}/curses/ -%{pylibdir}/dbm/ -%{pylibdir}/encodings/ -%{pylibdir}/html/ -%{pylibdir}/http/ -%{pylibdir}/importlib/ -%{pylibdir}/json/ -%{pylibdir}/logging/ -%{pylibdir}/multiprocessing/ -%{pylibdir}/pathlib/ -%{pylibdir}/pydoc_data/ -%{pylibdir}/re/ -%{pylibdir}/sqlite3/ -%{pylibdir}/sysconfig/ -%{pylibdir}/tomllib/ -%{pylibdir}/unittest/ -%{pylibdir}/urllib/ -%{pylibdir}/venv/ -%{pylibdir}/wsgiref/ -%{pylibdir}/xml/ -%{pylibdir}/xmlrpc/ -%{pylibdir}/zipfile/ -%{pylibdir}/zoneinfo/ - -# Handle the email module in detail to mark architecture.rst as %%doc -%dir %{pylibdir}/email/ -%dir %{pylibdir}/email/__pycache__/ -%{pylibdir}/email/*.py -%{pylibdir}/email/__pycache__/*%{bytecode_suffixes} -%{pylibdir}/email/mime/ -%doc %{pylibdir}/email/architecture.rst - -# Handle the ensurepip module in detail to not accidentally ship wheels -%dir %{pylibdir}/ensurepip/ -%dir %{pylibdir}/ensurepip/__pycache__/ -%{pylibdir}/ensurepip/*.py -%{pylibdir}/ensurepip/__pycache__/*%{bytecode_suffixes} -%if %{with rpmwheels} -%exclude %{pylibdir}/ensurepip/_bundled -%else -%dir %{pylibdir}/ensurepip/_bundled -%{pylibdir}/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl +# This is macronized for reuse in the -freethreading package +%define pure_python_modules() \ +%{1}/*.py\ +%dir %{1}/__pycache__/\ +%{1}/__pycache__/*%{bytecode_suffixes}\ +\ +%{1}/_pyrepl/\ +%{1}/asyncio/\ +%{1}/collections/\ +%{1}/concurrent/\ +%{1}/ctypes/\ +%{1}/curses/\ +%{1}/dbm/\ +%{1}/encodings/\ +%{1}/html/\ +%{1}/http/\ +%{1}/importlib/\ +%{1}/json/\ +%{1}/logging/\ +%{1}/multiprocessing/\ +%{1}/pathlib/\ +%{1}/pydoc_data/\ +%{1}/re/\ +%{1}/sqlite3/\ +%{1}/sysconfig/\ +%{1}/tomllib/\ +%{1}/unittest/\ +%{1}/urllib/\ +%{1}/venv/\ +%{1}/wsgiref/\ +%{1}/xml/\ +%{1}/xmlrpc/\ +%{1}/zipfile/\ +%{1}/zoneinfo/\ +# Handle the email module in detail to mark architecture.rst as %%doc\ +%dir %{1}/email/\ +%dir %{1}/email/__pycache__/\ +%{1}/email/*.py\ +%{1}/email/__pycache__/*%{bytecode_suffixes}\ +%{1}/email/mime/\ +%doc %{1}/email/architecture.rst\ +# Handle the ensurepip module in detail to not accidentally ship wheels\ +%dir %{1}/ensurepip/\ +%dir %{1}/ensurepip/__pycache__/\ +%{1}/ensurepip/*.py\ +%{1}/ensurepip/__pycache__/*%{bytecode_suffixes}\ +%if %{with rpmwheels}\ +%exclude %{1}/ensurepip/_bundled\ +%else\ +%dir %{1}/ensurepip/_bundled\ +%{1}/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl\ %endif +%pure_python_modules %{pylibdir} + # This will be in the tkinter package %exclude %{pylibdir}/turtle.py %exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes} @@ -1420,72 +1437,72 @@ CheckPython freethreading # Extension modules # This is macronized for reuse in the -debug package %define extension_modules() \ -%{dynload_dir}/_asyncio.%{1}.so\ -%{dynload_dir}/_bisect.%{1}.so\ -%{dynload_dir}/_blake2.%{1}.so\ -%{dynload_dir}/_bz2.%{1}.so\ -%{dynload_dir}/_codecs_cn.%{1}.so\ -%{dynload_dir}/_codecs_hk.%{1}.so\ -%{dynload_dir}/_codecs_iso2022.%{1}.so\ -%{dynload_dir}/_codecs_jp.%{1}.so\ -%{dynload_dir}/_codecs_kr.%{1}.so\ -%{dynload_dir}/_codecs_tw.%{1}.so\ -%{dynload_dir}/_contextvars.%{1}.so\ -%{dynload_dir}/_csv.%{1}.so\ -%{dynload_dir}/_ctypes.%{1}.so\ -%{dynload_dir}/_curses.%{1}.so\ -%{dynload_dir}/_curses_panel.%{1}.so\ -%{dynload_dir}/_datetime.%{1}.so\ -%{dynload_dir}/_dbm.%{1}.so\ +%{1}/_asyncio.%{2}.so\ +%{1}/_bisect.%{2}.so\ +%{1}/_blake2.%{2}.so\ +%{1}/_bz2.%{2}.so\ +%{1}/_codecs_cn.%{2}.so\ +%{1}/_codecs_hk.%{2}.so\ +%{1}/_codecs_iso2022.%{2}.so\ +%{1}/_codecs_jp.%{2}.so\ +%{1}/_codecs_kr.%{2}.so\ +%{1}/_codecs_tw.%{2}.so\ +%{1}/_contextvars.%{2}.so\ +%{1}/_csv.%{2}.so\ +%{1}/_ctypes.%{2}.so\ +%{1}/_curses.%{2}.so\ +%{1}/_curses_panel.%{2}.so\ +%{1}/_datetime.%{2}.so\ +%{1}/_dbm.%{2}.so\ %if %{with gdbm}\ -%{dynload_dir}/_gdbm.%{1}.so\ +%{1}/_gdbm.%{2}.so\ %endif\ -%{dynload_dir}/_decimal.%{1}.so\ -%{dynload_dir}/_elementtree.%{1}.so\ -%{dynload_dir}/_hashlib.%{1}.so\ -%{dynload_dir}/_heapq.%{1}.so\ -%{dynload_dir}/_interpchannels.%{1}.so\ -%{dynload_dir}/_interpqueues.%{1}.so\ -%{dynload_dir}/_interpreters.%{1}.so\ -%{dynload_dir}/_json.%{1}.so\ -%{dynload_dir}/_lsprof.%{1}.so\ -%{dynload_dir}/_lzma.%{1}.so\ -%{dynload_dir}/_md5.%{1}.so\ -%{dynload_dir}/_multibytecodec.%{1}.so\ -%{dynload_dir}/_multiprocessing.%{1}.so\ -%{dynload_dir}/_opcode.%{1}.so\ -%{dynload_dir}/_pickle.%{1}.so\ -%{dynload_dir}/_posixshmem.%{1}.so\ -%{dynload_dir}/_posixsubprocess.%{1}.so\ -%{dynload_dir}/_queue.%{1}.so\ -%{dynload_dir}/_random.%{1}.so\ -%{dynload_dir}/_sha1.%{1}.so\ -%{dynload_dir}/_sha2.%{1}.so\ -%{dynload_dir}/_sha3.%{1}.so\ -%{dynload_dir}/_socket.%{1}.so\ -%{dynload_dir}/_sqlite3.%{1}.so\ -%{dynload_dir}/_ssl.%{1}.so\ -%{dynload_dir}/_statistics.%{1}.so\ -%{dynload_dir}/_struct.%{1}.so\ -%{dynload_dir}/_uuid.%{1}.so\ -%{dynload_dir}/_zoneinfo.%{1}.so\ -%{dynload_dir}/array.%{1}.so\ -%{dynload_dir}/binascii.%{1}.so\ -%{dynload_dir}/cmath.%{1}.so\ -%{dynload_dir}/fcntl.%{1}.so\ -%{dynload_dir}/grp.%{1}.so\ -%{dynload_dir}/math.%{1}.so\ -%{dynload_dir}/mmap.%{1}.so\ -%{dynload_dir}/pyexpat.%{1}.so\ -%{dynload_dir}/readline.%{1}.so\ -%{dynload_dir}/resource.%{1}.so\ -%{dynload_dir}/select.%{1}.so\ -%{dynload_dir}/syslog.%{1}.so\ -%{dynload_dir}/termios.%{1}.so\ -%{dynload_dir}/unicodedata.%{1}.so\ -%{dynload_dir}/zlib.%{1}.so +%{1}/_decimal.%{2}.so\ +%{1}/_elementtree.%{2}.so\ +%{1}/_hashlib.%{2}.so\ +%{1}/_heapq.%{2}.so\ +%{1}/_interpchannels.%{2}.so\ +%{1}/_interpqueues.%{2}.so\ +%{1}/_interpreters.%{2}.so\ +%{1}/_json.%{2}.so\ +%{1}/_lsprof.%{2}.so\ +%{1}/_lzma.%{2}.so\ +%{1}/_md5.%{2}.so\ +%{1}/_multibytecodec.%{2}.so\ +%{1}/_multiprocessing.%{2}.so\ +%{1}/_opcode.%{2}.so\ +%{1}/_pickle.%{2}.so\ +%{1}/_posixshmem.%{2}.so\ +%{1}/_posixsubprocess.%{2}.so\ +%{1}/_queue.%{2}.so\ +%{1}/_random.%{2}.so\ +%{1}/_sha1.%{2}.so\ +%{1}/_sha2.%{2}.so\ +%{1}/_sha3.%{2}.so\ +%{1}/_socket.%{2}.so\ +%{1}/_sqlite3.%{2}.so\ +%{1}/_ssl.%{2}.so\ +%{1}/_statistics.%{2}.so\ +%{1}/_struct.%{2}.so\ +%{1}/_uuid.%{2}.so\ +%{1}/_zoneinfo.%{2}.so\ +%{1}/array.%{2}.so\ +%{1}/binascii.%{2}.so\ +%{1}/cmath.%{2}.so\ +%{1}/fcntl.%{2}.so\ +%{1}/grp.%{2}.so\ +%{1}/math.%{2}.so\ +%{1}/mmap.%{2}.so\ +%{1}/pyexpat.%{2}.so\ +%{1}/readline.%{2}.so\ +%{1}/resource.%{2}.so\ +%{1}/select.%{2}.so\ +%{1}/syslog.%{2}.so\ +%{1}/termios.%{2}.so\ +%{1}/unicodedata.%{2}.so\ +%{1}/zlib.%{2}.so -%extension_modules %{SOABI_optimized} +%extension_modules %{dynload_dir} %{SOABI_optimized} %dir %{pylibdir}/site-packages/ %dir %{pylibdir}/site-packages/__pycache__/ @@ -1582,23 +1599,23 @@ CheckPython freethreading # Extension modules # This is macronized for reuse in the -debug package %define extension_modules_test() \ -%{dynload_dir}/_ctypes_test.%{1}.so\ -%{dynload_dir}/_testbuffer.%{1}.so\ -%{dynload_dir}/_testcapi.%{1}.so\ -%{dynload_dir}/_testclinic.%{1}.so\ -%{dynload_dir}/_testclinic_limited.%{1}.so\ -%{dynload_dir}/_testexternalinspection.%{1}.so\ -%{dynload_dir}/_testimportmultiple.%{1}.so\ -%{dynload_dir}/_testinternalcapi.%{1}.so\ -%{dynload_dir}/_testlimitedcapi.%{1}.so\ -%{dynload_dir}/_testmultiphase.%{1}.so\ -%{dynload_dir}/_testsinglephase.%{1}.so\ -%{dynload_dir}/_xxtestfuzz.%{1}.so\ -%{dynload_dir}/xxlimited.%{1}.so\ -%{dynload_dir}/xxlimited_35.%{1}.so\ -%{dynload_dir}/xxsubtype.%{1}.so +%{1}/_ctypes_test.%{2}.so\ +%{1}/_testbuffer.%{2}.so\ +%{1}/_testcapi.%{2}.so\ +%{1}/_testclinic.%{2}.so\ +%{1}/_testclinic_limited.%{2}.so\ +%{1}/_testexternalinspection.%{2}.so\ +%{1}/_testimportmultiple.%{2}.so\ +%{1}/_testinternalcapi.%{2}.so\ +%{1}/_testlimitedcapi.%{2}.so\ +%{1}/_testmultiphase.%{2}.so\ +%{1}/_testsinglephase.%{2}.so\ +%{1}/_xxtestfuzz.%{2}.so\ +%{1}/xxlimited.%{2}.so\ +%{1}/xxlimited_35.%{2}.so\ +%{1}/xxsubtype.%{2}.so -%extension_modules_test %{SOABI_optimized} +%extension_modules_test %{dynload_dir} %{SOABI_optimized} # We don't bother splitting the debug build out into further subpackages: @@ -1620,8 +1637,8 @@ CheckPython freethreading %{_libdir}/%{py_INSTSONAME_debug} # Analog of the libs, test, and tkinter extension modules: -%extension_modules %{SOABI_debug} -%extension_modules_test %{SOABI_debug} +%extension_modules %{dynload_dir} %{SOABI_debug} +%extension_modules_test %{dynload_dir} %{SOABI_debug} %{dynload_dir}/_tkinter.%{SOABI_debug}.so # Analog of the -devel subpackage's files: @@ -1640,19 +1657,40 @@ CheckPython freethreading %if %{with freethreading_build} %files -n python%{pybasever}-freethreading +%dir %{pylibdir_freethreading} +%dir %{dynload_dir_freethreading} + +%license %{pylibdir_freethreading}/LICENSE.txt +%doc %{pylibdir_freethreading}/site-packages/README.txt + +# Pure Python modules +%pure_python_modules %{pylibdir_freethreading} + +# Modules that we separate from python3-libs, but want to ship in -freethreading +%{pylibdir_freethreading}/__phello__/ +%{pylibdir_freethreading}/idlelib/ +%{pylibdir_freethreading}/test/ +%{pylibdir_freethreading}/tkinter/ +%{pylibdir_freethreading}/turtledemo/ + +# This will be in the -freethreading-debug package +%if %{with debug_build} +%exclude %{pylibdir_freethreading}/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}.py +%exclude %{pylibdir_freethreading}/__pycache__/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}%{bytecode_suffixes} +%endif + # Analog of the core subpackage's files: %{_bindir}/python%{LDVERSION_freethreading} # Analog to the -libs subpackage's files: %{_libdir}/%{py_INSTSONAME_freethreading} -# Analog of the libs, test, and tkinter extension modules: -%extension_modules %{SOABI_freethreading} -%extension_modules_test %{SOABI_freethreading} -%{dynload_dir}/_tkinter.%{SOABI_freethreading}.so +%extension_modules %{dynload_dir_freethreading} %{SOABI_freethreading} +%extension_modules_test %{dynload_dir_freethreading} %{SOABI_freethreading} +%{dynload_dir_freethreading}/_tkinter.%{SOABI_freethreading}.so # Analog of the -devel subpackage's files: -%{pylibdir}/config-%{LDVERSION_freethreading}-%{platform_triplet}/ +%{pylibdir_freethreading}/config-%{LDVERSION_freethreading}-%{platform_triplet}/ %{_includedir}/python%{LDVERSION_freethreading}/ %{_bindir}/python%{LDVERSION_freethreading}-config %{_bindir}/python%{LDVERSION_freethreading}-*-config @@ -1660,9 +1698,6 @@ CheckPython freethreading %{_libdir}/pkgconfig/python-%{LDVERSION_freethreading}.pc %{_libdir}/pkgconfig/python-%{LDVERSION_freethreading}-embed.pc -%{pylibdir}/_sysconfigdata_%{ABIFLAGS_freethreading}_linux_%{platform_triplet}.py -%{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_freethreading}_linux_%{platform_triplet}%{bytecode_suffixes} - %endif # with freethreading_build %if %{with freethreading_build} && %{with debug_build} @@ -1674,12 +1709,12 @@ CheckPython freethreading %{_libdir}/%{py_INSTSONAME_freethreading_debug} # Analog of the libs, test, and tkinter extension modules: -%extension_modules %{SOABI_freethreading_debug} -%extension_modules_test %{SOABI_freethreading_debug} -%{dynload_dir}/_tkinter.%{SOABI_freethreading_debug}.so +%extension_modules %{dynload_dir_freethreading} %{SOABI_freethreading_debug} +%extension_modules_test %{dynload_dir_freethreading} %{SOABI_freethreading_debug} +%{dynload_dir_freethreading}/_tkinter.%{SOABI_freethreading_debug}.so # Analog of the -devel subpackage's files: -%{pylibdir}/config-%{LDVERSION_freethreading_debug}-%{platform_triplet}/ +%{pylibdir_freethreading}/config-%{LDVERSION_freethreading_debug}-%{platform_triplet}/ %{_includedir}/python%{LDVERSION_freethreading_debug}/ %{_bindir}/python%{LDVERSION_freethreading_debug}-config %{_bindir}/python%{LDVERSION_freethreading_debug}-*-config @@ -1687,8 +1722,8 @@ CheckPython freethreading %{_libdir}/pkgconfig/python-%{LDVERSION_freethreading_debug}.pc %{_libdir}/pkgconfig/python-%{LDVERSION_freethreading_debug}-embed.pc -%{pylibdir}/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}.py -%{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}%{bytecode_suffixes} +%{pylibdir_freethreading}/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}.py +%{pylibdir_freethreading}/__pycache__/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}%{bytecode_suffixes} %endif # with freethreading_build && debug_build @@ -1713,6 +1748,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Jul 19 2024 Miro Hrončok - 3.13.0~b4-1 +- Update to Python 3.13.0b4 + * Fri Jul 19 2024 Fedora Release Engineering - 3.13.0~b3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/rpmlint.toml b/rpmlint.toml index 2b157ef..231aec5 100644 --- a/rpmlint.toml +++ b/rpmlint.toml @@ -6,7 +6,7 @@ Filters = [ # TESTS: - '(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3\.\d+/test', + '(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3\.\d+t?/test', # OTHER DELIBERATES: @@ -14,7 +14,7 @@ Filters = [ 'missing-call-to-chdir-with-chroot', # gethostbyname function calls gethostbyname - '(E|W): binary-or-shlib-calls-gethostbyname /usr/lib(64)?/python3\.\d+/lib-dynload/_socket\.', + '(E|W): binary-or-shlib-calls-gethostbyname /usr/lib(64)?/python3\.\d+t?/lib-dynload/_socket\.', # intentionally unversioned and selfobsoleted 'unversioned-explicit-obsoletes python', @@ -28,18 +28,18 @@ Filters = [ 'only-non-binary-in-usr-lib', # some devel files that are deliberately needed - 'devel-file-in-non-devel-package /usr/include/python3\.\d+m?/pyconfig-(32|64)\.h', - 'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+/distutils/tests/xxmodule\.c', + 'devel-file-in-non-devel-package /usr/include/python3\.\d+m?t?/pyconfig-(32|64)\.h', + 'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+t?/distutils/tests/xxmodule\.c', # ...or are used as test data - 'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+/test', + 'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+t?/test', # some bytecode is shipped without sources on purpose, as a space optimization # if this regex needs to be relaxed in the future, make sure it **does not** match pyc files in __pycache__ - 'python-bytecode-without-source /usr/lib(64)?/python3\.\d+/(encodings|pydoc_data)/[^/]+.pyc', + 'python-bytecode-without-source /usr/lib(64)?/python3\.\d+t?/(encodings|pydoc_data)/[^/]+.pyc', # DUPLICATE FILES # test data are often duplicated - '(E|W): files-duplicate /usr/lib(64)?/python3\.\d+/(test|__phello__)/', + '(E|W): files-duplicate /usr/lib(64)?/python3\.\d+t?/(test|__phello__)/', # duplicated inits or mains are also common '(E|W): files-duplicate .+__init__\.py.+__init__\.py', '(E|W): files-duplicate .+__main__\.py.+__main__\.py', diff --git a/sources b/sources index 58ea498..aa5263c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0b3.tar.xz) = 1f0ef2d6f5d450664ad4104b92193b5a2dbe9c79add0a79c35ad9508f9fc7f1a5561efd5e4367defddf45457291524d353705d9a60b3550065920e204c77357d -SHA512 (Python-3.13.0b3.tar.xz.asc) = 3d8bdc8c26441a12518940d264e93a8897042e297ccf9cd2ddec725716a58486475be9462582ee489bd189a4d028b43504f979298174c1b008d521b7ab5fbf1b +SHA512 (Python-3.13.0b4.tar.xz) = e556f7a4e54b688d0424b0bd84f9849b52f4f7e04c68d4d5b877d86b4f9ded92c9efaa2b7ab33f345235f35e8d544833542f7a4cb100d0ff15b7d98b8367b935 +SHA512 (Python-3.13.0b4.tar.xz.asc) = 243637efff94965aa4d997fe26c91a7c1aa7dcfdf7f78d35d6f4fc408b654dfa9d075d1c73bc5a90d145f6e5029ee395a86faf7e027c24a55fabfea6ca20fbd4 From 745ccf026157726f08aca426ea8d28b3f3d3e8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 4 Jul 2024 14:29:41 +0200 Subject: [PATCH 035/115] Reduce and conditionalize BuildRequires - bzip2 is not used directly, only via bzip2-devel - tar is not used directly either, %autosetup uses rpmuncompress - desktop-file-utils is only used to install idle desktop file with main_python - libappstream-glib is only used to validate idle appdata file with main_python - /usr/sbin/ifconfig is no longer needed for test_uuid - gcc-c++, glibc-all-langpacks, tzdata are only used in tests (although something pulls in tzdata even with bootstrap without tests, so this one is hard to verify) - gmp-devel in not needed since Python 2.4 (mpz module was removed) - libGL-devel appears unused (and hard to find why it ever was needed) Courtesy of https://github.com/mkoncek/unbreq --- python3.13.spec | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 084f339..fb6894c 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -273,28 +273,34 @@ Obsoletes: python%{pybasever}%{?1:-%{1}}\ BuildRequires: autoconf BuildRequires: bluez-libs-devel -BuildRequires: bzip2 BuildRequires: bzip2-devel +%if %{with main_python} BuildRequires: desktop-file-utils +%endif # See the runtime requirement in the -libs subpackage BuildRequires: expat-devel >= 2.6 BuildRequires: findutils +BuildRequires: gcc +%if %{with tests} BuildRequires: gcc-c++ +%endif %if %{with gdbm} BuildRequires: gdbm-devel %endif BuildRequires: git-core +%if %{with tests} BuildRequires: glibc-all-langpacks +%endif BuildRequires: glibc-devel -BuildRequires: gmp-devel BuildRequires: gnupg2 +%if %{with main_python} BuildRequires: libappstream-glib +%endif %if %{undefined rhel} BuildRequires: libb2-devel %endif BuildRequires: libffi-devel -BuildRequires: libGL-devel BuildRequires: libuuid-devel BuildRequires: libX11-devel BuildRequires: make @@ -307,12 +313,15 @@ BuildRequires: python-rpm-macros BuildRequires: readline-devel BuildRequires: redhat-rpm-config >= 127 BuildRequires: sqlite-devel +%if %{with tests} BuildRequires: gdb +%endif -BuildRequires: tar BuildRequires: tcl-devel BuildRequires: tk-devel +%if %{with tests} BuildRequires: tzdata +%endif %if %{with jit} BuildRequires: clang(major) = 18 @@ -328,9 +337,6 @@ BuildRequires: zlib-devel BuildRequires: /usr/bin/dtrace -# workaround http://bugs.python.org/issue19804 (test_uuid requires ifconfig) -BuildRequires: /usr/sbin/ifconfig - %if %{with rpmwheels} # Python 3.12 removed the deprecated imp module, # the first compatible version of pip is 23.1.2. From d1242289d7d8a356e8ba9a453bc385e9b780df3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 4 Jul 2024 16:21:25 +0200 Subject: [PATCH 036/115] Group BuildRequires based in %ifs, sort within --- python3.13.spec | 49 ++++++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index fb6894c..b47b2ab 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -269,57 +269,44 @@ Obsoletes: python%{pybasever}%{?1:-%{1}}\ # Build-time requirements # ======================= -# (keep this list alphabetized) +# (keep this list alphabetized within the %%if blocks) BuildRequires: autoconf BuildRequires: bluez-libs-devel BuildRequires: bzip2-devel -%if %{with main_python} -BuildRequires: desktop-file-utils -%endif # See the runtime requirement in the -libs subpackage BuildRequires: expat-devel >= 2.6 - BuildRequires: findutils BuildRequires: gcc -%if %{with tests} -BuildRequires: gcc-c++ -%endif -%if %{with gdbm} -BuildRequires: gdbm-devel -%endif BuildRequires: git-core -%if %{with tests} -BuildRequires: glibc-all-langpacks -%endif BuildRequires: glibc-devel BuildRequires: gnupg2 -%if %{with main_python} -BuildRequires: libappstream-glib -%endif -%if %{undefined rhel} -BuildRequires: libb2-devel -%endif +BuildRequires: libX11-devel BuildRequires: libffi-devel BuildRequires: libuuid-devel -BuildRequires: libX11-devel BuildRequires: make BuildRequires: mpdecimal-devel BuildRequires: ncurses-devel - BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: readline-devel BuildRequires: redhat-rpm-config >= 127 BuildRequires: sqlite-devel -%if %{with tests} -BuildRequires: gdb -%endif - BuildRequires: tcl-devel BuildRequires: tk-devel +BuildRequires: xz-devel +BuildRequires: zlib-devel +BuildRequires: /usr/bin/dtrace + +%if %{undefined rhel} +BuildRequires: libb2-devel +%endif + %if %{with tests} +BuildRequires: gcc-c++ +BuildRequires: gdb +BuildRequires: glibc-all-langpacks BuildRequires: tzdata %endif @@ -332,10 +319,14 @@ BuildRequires: llvm(major) = 18 BuildRequires: valgrind-devel %endif -BuildRequires: xz-devel -BuildRequires: zlib-devel +%if %{with gdbm} +BuildRequires: gdbm-devel +%endif -BuildRequires: /usr/bin/dtrace +%if %{with main_python} +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib +%endif %if %{with rpmwheels} # Python 3.12 removed the deprecated imp module, From 7ed344344cba351b8fe0553031bc8f52f444280d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 23 Jul 2024 13:12:19 +0200 Subject: [PATCH 037/115] Explicitly BuildRequire systemtap-sdt-devel This is for https://fedoraproject.org/wiki/Changes/Separate_dtrace_package This already BuildRequired /usr/bin/dtrace, but it also needs the headers: In file included from /builddir/build/BUILD/python3.13-3.13.0_b4-build/Python-3.13.0b4/Include/pydtrace.h:11, from /builddir/build/BUILD/python3.13-3.13.0_b4-build/Python-3.13.0b4/Python/ceval.c:40: Include/pydtrace_probes.h:10:10: fatal error: sys/sdt.h: No such file or directory 10 | #include | ^~~~~~~~~~~ compilation terminated. --- python3.13.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index b47b2ab..b6863ce 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b4 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -293,6 +293,7 @@ BuildRequires: python-rpm-macros BuildRequires: readline-devel BuildRequires: redhat-rpm-config >= 127 BuildRequires: sqlite-devel +BuildRequires: systemtap-sdt-devel BuildRequires: tcl-devel BuildRequires: tk-devel BuildRequires: xz-devel @@ -1745,6 +1746,10 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Jul 23 2024 Miro Hrončok - 3.13.0~b4-2 +- Explicitly BuildRequire systemtap-sdt-devel + https://fedoraproject.org/wiki/Changes/Separate_dtrace_package + * Fri Jul 19 2024 Miro Hrončok - 3.13.0~b4-1 - Update to Python 3.13.0b4 From c27761fddacc7d73c172e2c13a5021e1b342369b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 22 Jul 2024 20:44:07 +0200 Subject: [PATCH 038/115] Revert "Skip test_gdb for now" This reverts commit db3aa2889c791c175c5346a05d1c1a71d484969b. gdb was fixed in gdb-14.2-13.fc41 --- python3.13.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index b6863ce..29d448d 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1299,7 +1299,6 @@ CheckPython() { # test_check_probes is failing since it was introduced in 3.12.0rc1, # the test is skipped until it is fixed in upstream. # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 - # test_gdb is skipped due to https://bugzilla.redhat.com/2275274#c11 # test_signal is skipped due to https://github.com/python/cpython/issues/118989 # test.test_concurrent_futures.test_deadlock tends to time out on s390x in # freethreading{,-debug} build, skipping it to shorten the build time @@ -1307,7 +1306,6 @@ CheckPython() { -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ -i test_check_probes \ - -x test_gdb \ %ifarch %{mips64} -x test_ctypes \ %endif From 90526d6169b8976589fbc6520b4393983e9ad174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 22 Jul 2024 20:16:29 +0200 Subject: [PATCH 039/115] rpmlint: Exclude unittest and gil from spelling-error python3-test.x86_64: E: spelling-error ('unittest', '%description -l en_US unittest -> unit test, unit-test, unities') python3.13-freethreading.x86_64: E: spelling-error ('gil', '%description -l en_US gil -> Gil, girl, gilt') python3.13-freethreading-debug.x86_64: E: spelling-error ('gil', '%description -l en_US gil -> Gil, girl, gilt') --- rpmlint.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpmlint.toml b/rpmlint.toml index 231aec5..0864a1c 100644 --- a/rpmlint.toml +++ b/rpmlint.toml @@ -101,6 +101,6 @@ Filters = [ '\bpython3(\.\d+)?\.(src|spec): (E|W): specfile-error\s+$', # SPELLING ERRORS - 'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest) ', + 'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest|unittest|gil) ', ] From f01f38eff5b3ddfe3b4fd657022bfada485a8832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 22 Jul 2024 20:42:18 +0200 Subject: [PATCH 040/115] CI: Skip test_abort_clients, failure reported upstream https://github.com/python/cpython/issues/122136 --- tests/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/tests.yml b/tests/tests.yml index fb2659f..2ba326a 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -30,10 +30,11 @@ run: "PYTHON=python{{ pybasever }}d TOX=false VERSION={{ pybasever }} CYTHON=false ./venv.sh" - selftest: dir: python/selftest - run: "VERSION={{ pybasever }} X='-i test_check_probes' ./parallel.sh" + # test_abort_clients: https://github.com/python/cpython/issues/122136 + run: "VERSION={{ pybasever }} X='-i test_check_probes -i test_abort_clients' ./parallel.sh" - debugtest: dir: python/selftest - run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes' ./parallel.sh" + run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes -i test_abort_clients' ./parallel.sh" - optimizedflags: dir: python/flags run: "python{{ pybasever }} ./assertflags.py -O3" From b25f06562ba8ebd7d804cbacc821fc6dd1ad7c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 30 Jul 2024 12:18:00 +0200 Subject: [PATCH 041/115] Preserve AST nodes for f-string with single-element format specifiers - Fixes https://github.com/python/cpython/issues/122300 --- ...rmat-specifiers-with-single-elements.patch | 3177 +++++++++++++++++ python3.13.spec | 10 +- 2 files changed, 3186 insertions(+), 1 deletion(-) create mode 100644 00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch diff --git a/00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch b/00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch new file mode 100644 index 0000000..34d301d --- /dev/null +++ b/00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch @@ -0,0 +1,3177 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Pablo Galindo Salgado +Date: Sat, 27 Jul 2024 20:27:01 +0100 +Subject: [PATCH] 00433: Preserve AST nodes for format specifiers with single + elements + +(cherry picked from commit db2d8b6db1b56c2bd3802b86f9b76da33e8898d7) +--- + Doc/library/ast.rst | 4 +- + Lib/test/test_ast.py | 3111 +---------------- + ...-07-26-14-05-51.gh-issue-122300.SVIF-l.rst | 2 + + Parser/action_helpers.c | 3 +- + 4 files changed, 138 insertions(+), 2982 deletions(-) + create mode 100644 Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst + +diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst +index 727d44df0c..c5daa6e243 100644 +--- a/Doc/library/ast.rst ++++ b/Doc/library/ast.rst +@@ -316,7 +316,9 @@ Literals + args=[ + Name(id='a', ctx=Load())]), + conversion=-1, +- format_spec=Constant(value='.3'))])) ++ format_spec=JoinedStr( ++ values=[ ++ Constant(value='.3')]))])) + + + .. class:: List(elts, ctx) +diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py +index e3383355d3..99666ba100 100644 +--- a/Lib/test/test_ast.py ++++ b/Lib/test/test_ast.py +@@ -3461,2989 +3461,140 @@ def main(): + + #### EVERYTHING BELOW IS GENERATED BY python Lib/test/test_ast.py -g ##### + exec_results = [ +- ("Module", [("Expr", (1, 0, 1, 4), ("Constant", (1, 0, 1, 4), None, None))], []), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 18), +- ("Constant", (1, 0, 1, 18), "module docstring", None), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 13), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 9, 1, 13))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 29), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [ +- ( +- "Expr", +- (1, 9, 1, 29), +- ("Constant", (1, 9, 1, 29), "function docstring", None), +- ) +- ], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 14), +- "f", +- ( +- "arguments", +- [], +- [("arg", (1, 6, 1, 7), "a", None, None)], +- None, +- [], +- [], +- None, +- [], +- ), +- [("Pass", (1, 10, 1, 14))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 16), +- "f", +- ( +- "arguments", +- [], +- [("arg", (1, 6, 1, 7), "a", None, None)], +- None, +- [], +- [], +- None, +- [("Constant", (1, 8, 1, 9), 0, None)], +- ), +- [("Pass", (1, 12, 1, 16))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 18), +- "f", +- ( +- "arguments", +- [], +- [], +- ("arg", (1, 7, 1, 11), "args", None, None), +- [], +- [], +- None, +- [], +- ), +- [("Pass", (1, 14, 1, 18))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 23), +- "f", +- ( +- "arguments", +- [], +- [], +- ( +- "arg", +- (1, 7, 1, 16), +- "args", +- ( +- "Starred", +- (1, 13, 1, 16), +- ("Name", (1, 14, 1, 16), "Ts", ("Load",)), +- ("Load",), +- ), +- None, +- ), +- [], +- [], +- None, +- [], +- ), +- [("Pass", (1, 19, 1, 23))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 36), +- "f", +- ( +- "arguments", +- [], +- [], +- ( +- "arg", +- (1, 7, 1, 29), +- "args", +- ( +- "Starred", +- (1, 13, 1, 29), +- ( +- "Subscript", +- (1, 14, 1, 29), +- ("Name", (1, 14, 1, 19), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 20, 1, 28), +- [ +- ("Name", (1, 20, 1, 23), "int", ("Load",)), +- ("Constant", (1, 25, 1, 28), Ellipsis, None), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- ), +- [], +- [], +- None, +- [], +- ), +- [("Pass", (1, 32, 1, 36))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 36), +- "f", +- ( +- "arguments", +- [], +- [], +- ( +- "arg", +- (1, 7, 1, 29), +- "args", +- ( +- "Starred", +- (1, 13, 1, 29), +- ( +- "Subscript", +- (1, 14, 1, 29), +- ("Name", (1, 14, 1, 19), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 20, 1, 28), +- [ +- ("Name", (1, 20, 1, 23), "int", ("Load",)), +- ( +- "Starred", +- (1, 25, 1, 28), +- ("Name", (1, 26, 1, 28), "Ts", ("Load",)), +- ("Load",), +- ), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- ), +- [], +- [], +- None, +- [], +- ), +- [("Pass", (1, 32, 1, 36))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 21), +- "f", +- ( +- "arguments", +- [], +- [], +- None, +- [], +- [], +- ("arg", (1, 8, 1, 14), "kwargs", None, None), +- [], +- ), +- [("Pass", (1, 17, 1, 21))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 71), +- "f", +- ( +- "arguments", +- [], +- [ +- ("arg", (1, 6, 1, 7), "a", None, None), +- ("arg", (1, 9, 1, 10), "b", None, None), +- ("arg", (1, 14, 1, 15), "c", None, None), +- ("arg", (1, 22, 1, 23), "d", None, None), +- ("arg", (1, 28, 1, 29), "e", None, None), +- ], +- ("arg", (1, 35, 1, 39), "args", None, None), +- [("arg", (1, 41, 1, 42), "f", None, None)], +- [("Constant", (1, 43, 1, 45), 42, None)], +- ("arg", (1, 49, 1, 55), "kwargs", None, None), +- [ +- ("Constant", (1, 11, 1, 12), 1, None), +- ("Constant", (1, 16, 1, 20), None, None), +- ("List", (1, 24, 1, 26), [], ("Load",)), +- ("Dict", (1, 30, 1, 32), [], []), +- ], +- ), +- [ +- ( +- "Expr", +- (1, 58, 1, 71), +- ("Constant", (1, 58, 1, 71), "doc for f()", None), +- ) +- ], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 27), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 23, 1, 27))], +- [], +- ( +- "Subscript", +- (1, 11, 1, 21), +- ("Name", (1, 11, 1, 16), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 17, 1, 20), +- [ +- ( +- "Starred", +- (1, 17, 1, 20), +- ("Name", (1, 18, 1, 20), "Ts", ("Load",)), +- ("Load",), +- ) +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 32), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 28, 1, 32))], +- [], +- ( +- "Subscript", +- (1, 11, 1, 26), +- ("Name", (1, 11, 1, 16), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 17, 1, 25), +- [ +- ("Name", (1, 17, 1, 20), "int", ("Load",)), +- ( +- "Starred", +- (1, 22, 1, 25), +- ("Name", (1, 23, 1, 25), "Ts", ("Load",)), +- ("Load",), +- ), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 45), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 41, 1, 45))], +- [], +- ( +- "Subscript", +- (1, 11, 1, 39), +- ("Name", (1, 11, 1, 16), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 17, 1, 38), +- [ +- ("Name", (1, 17, 1, 20), "int", ("Load",)), +- ( +- "Starred", +- (1, 22, 1, 38), +- ( +- "Subscript", +- (1, 23, 1, 38), +- ("Name", (1, 23, 1, 28), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 29, 1, 37), +- [ +- ("Name", (1, 29, 1, 32), "int", ("Load",)), +- ( +- "Constant", +- (1, 34, 1, 37), +- Ellipsis, +- None, +- ), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- ("Load",), +- ), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [("ClassDef", (1, 0, 1, 12), "C", [], [], [("Pass", (1, 8, 1, 12))], [], [])], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (1, 0, 1, 32), +- "C", +- [], +- [], +- [ +- ( +- "Expr", +- (1, 9, 1, 32), +- ("Constant", (1, 9, 1, 32), "docstring for class C", None), +- ) +- ], +- [], +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (1, 0, 1, 21), +- "C", +- [("Name", (1, 8, 1, 14), "object", ("Load",))], +- [], +- [("Pass", (1, 17, 1, 21))], +- [], +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 16), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Return", (1, 8, 1, 16), ("Constant", (1, 15, 1, 16), 1, None))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ("Module", [("Delete", (1, 0, 1, 5), [("Name", (1, 4, 1, 5), "v", ("Del",))])], []), +- ( +- "Module", +- [ +- ( +- "Assign", +- (1, 0, 1, 5), +- [("Name", (1, 0, 1, 1), "v", ("Store",))], +- ("Constant", (1, 4, 1, 5), 1, None), +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Assign", +- (1, 0, 1, 7), +- [ +- ( +- "Tuple", +- (1, 0, 1, 3), +- [ +- ("Name", (1, 0, 1, 1), "a", ("Store",)), +- ("Name", (1, 2, 1, 3), "b", ("Store",)), +- ], +- ("Store",), +- ) +- ], +- ("Name", (1, 6, 1, 7), "c", ("Load",)), +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Assign", +- (1, 0, 1, 9), +- [ +- ( +- "Tuple", +- (1, 0, 1, 5), +- [ +- ("Name", (1, 1, 1, 2), "a", ("Store",)), +- ("Name", (1, 3, 1, 4), "b", ("Store",)), +- ], +- ("Store",), +- ) +- ], +- ("Name", (1, 8, 1, 9), "c", ("Load",)), +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Assign", +- (1, 0, 1, 9), +- [ +- ( +- "List", +- (1, 0, 1, 5), +- [ +- ("Name", (1, 1, 1, 2), "a", ("Store",)), +- ("Name", (1, 3, 1, 4), "b", ("Store",)), +- ], +- ("Store",), +- ) +- ], +- ("Name", (1, 8, 1, 9), "c", ("Load",)), +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AnnAssign", +- (1, 0, 1, 13), +- ("Name", (1, 0, 1, 1), "x", ("Store",)), +- ( +- "Subscript", +- (1, 3, 1, 13), +- ("Name", (1, 3, 1, 8), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 9, 1, 12), +- [ +- ( +- "Starred", +- (1, 9, 1, 12), +- ("Name", (1, 10, 1, 12), "Ts", ("Load",)), +- ("Load",), +- ) +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- 1, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AnnAssign", +- (1, 0, 1, 18), +- ("Name", (1, 0, 1, 1), "x", ("Store",)), +- ( +- "Subscript", +- (1, 3, 1, 18), +- ("Name", (1, 3, 1, 8), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 9, 1, 17), +- [ +- ("Name", (1, 9, 1, 12), "int", ("Load",)), +- ( +- "Starred", +- (1, 14, 1, 17), +- ("Name", (1, 15, 1, 17), "Ts", ("Load",)), +- ("Load",), +- ), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- 1, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AnnAssign", +- (1, 0, 1, 31), +- ("Name", (1, 0, 1, 1), "x", ("Store",)), +- ( +- "Subscript", +- (1, 3, 1, 31), +- ("Name", (1, 3, 1, 8), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 9, 1, 30), +- [ +- ("Name", (1, 9, 1, 12), "int", ("Load",)), +- ( +- "Starred", +- (1, 14, 1, 30), +- ( +- "Subscript", +- (1, 15, 1, 30), +- ("Name", (1, 15, 1, 20), "tuple", ("Load",)), +- ( +- "Tuple", +- (1, 21, 1, 29), +- [ +- ("Name", (1, 21, 1, 24), "str", ("Load",)), +- ( +- "Constant", +- (1, 26, 1, 29), +- Ellipsis, +- None, +- ), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- ("Load",), +- ), +- ], +- ("Load",), +- ), +- ("Load",), +- ), +- None, +- 1, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AugAssign", +- (1, 0, 1, 6), +- ("Name", (1, 0, 1, 1), "v", ("Store",)), +- ("Add",), +- ("Constant", (1, 5, 1, 6), 1, None), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "For", +- (1, 0, 1, 15), +- ("Name", (1, 4, 1, 5), "v", ("Store",)), +- ("Name", (1, 9, 1, 10), "v", ("Load",)), +- [("Pass", (1, 11, 1, 15))], +- [], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "While", +- (1, 0, 1, 12), +- ("Name", (1, 6, 1, 7), "v", ("Load",)), +- [("Pass", (1, 8, 1, 12))], +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "If", +- (1, 0, 1, 9), +- ("Name", (1, 3, 1, 4), "v", ("Load",)), +- [("Pass", (1, 5, 1, 9))], +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "If", +- (1, 0, 4, 6), +- ("Name", (1, 3, 1, 4), "a", ("Load",)), +- [("Pass", (2, 2, 2, 6))], +- [ +- ( +- "If", +- (3, 0, 4, 6), +- ("Name", (3, 5, 3, 6), "b", ("Load",)), +- [("Pass", (4, 2, 4, 6))], +- [], +- ) +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "If", +- (1, 0, 6, 6), +- ("Name", (1, 3, 1, 4), "a", ("Load",)), +- [("Pass", (2, 2, 2, 6))], +- [ +- ( +- "If", +- (3, 0, 6, 6), +- ("Name", (3, 5, 3, 6), "b", ("Load",)), +- [("Pass", (4, 2, 4, 6))], +- [("Pass", (6, 2, 6, 6))], +- ) +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "With", +- (1, 0, 1, 17), +- [ +- ( +- "withitem", +- ("Name", (1, 5, 1, 6), "x", ("Load",)), +- ("Name", (1, 10, 1, 11), "y", ("Store",)), +- ) +- ], +- [("Pass", (1, 13, 1, 17))], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "With", +- (1, 0, 1, 25), +- [ +- ( +- "withitem", +- ("Name", (1, 5, 1, 6), "x", ("Load",)), +- ("Name", (1, 10, 1, 11), "y", ("Store",)), +- ), +- ( +- "withitem", +- ("Name", (1, 13, 1, 14), "z", ("Load",)), +- ("Name", (1, 18, 1, 19), "q", ("Store",)), +- ), +- ], +- [("Pass", (1, 21, 1, 25))], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "With", +- (1, 0, 1, 19), +- [ +- ( +- "withitem", +- ("Name", (1, 6, 1, 7), "x", ("Load",)), +- ("Name", (1, 11, 1, 12), "y", ("Store",)), +- ) +- ], +- [("Pass", (1, 15, 1, 19))], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "With", +- (1, 0, 1, 17), +- [ +- ("withitem", ("Name", (1, 6, 1, 7), "x", ("Load",)), None), +- ("withitem", ("Name", (1, 9, 1, 10), "y", ("Load",)), None), +- ], +- [("Pass", (1, 13, 1, 17))], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Raise", +- (1, 0, 1, 25), +- ( +- "Call", +- (1, 6, 1, 25), +- ("Name", (1, 6, 1, 15), "Exception", ("Load",)), +- [("Constant", (1, 16, 1, 24), "string", None)], +- [], +- ), +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Try", +- (1, 0, 4, 6), +- [("Pass", (2, 2, 2, 6))], +- [ +- ( +- "ExceptHandler", +- (3, 0, 4, 6), +- ("Name", (3, 7, 3, 16), "Exception", ("Load",)), +- None, +- [("Pass", (4, 2, 4, 6))], +- ) +- ], +- [], +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Try", +- (1, 0, 4, 6), +- [("Pass", (2, 2, 2, 6))], +- [], +- [], +- [("Pass", (4, 2, 4, 6))], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "TryStar", +- (1, 0, 4, 6), +- [("Pass", (2, 2, 2, 6))], +- [ +- ( +- "ExceptHandler", +- (3, 0, 4, 6), +- ("Name", (3, 8, 3, 17), "Exception", ("Load",)), +- None, +- [("Pass", (4, 2, 4, 6))], +- ) +- ], +- [], +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [("Assert", (1, 0, 1, 8), ("Name", (1, 7, 1, 8), "v", ("Load",)), None)], +- [], +- ), +- ( +- "Module", +- [("Import", (1, 0, 1, 10), [("alias", (1, 7, 1, 10), "sys", None)])], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ImportFrom", +- (1, 0, 1, 17), +- "sys", +- [("alias", (1, 16, 1, 17), "v", None)], +- 0, +- ) +- ], +- [], +- ), +- ("Module", [("Global", (1, 0, 1, 8), ["v"])], []), +- ("Module", [("Expr", (1, 0, 1, 1), ("Constant", (1, 0, 1, 1), 1, None))], []), +- ("Module", [("Pass", (1, 0, 1, 4))], []), +- ( +- "Module", +- [ +- ( +- "For", +- (1, 0, 1, 16), +- ("Name", (1, 4, 1, 5), "v", ("Store",)), +- ("Name", (1, 9, 1, 10), "v", ("Load",)), +- [("Break", (1, 11, 1, 16))], +- [], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "For", +- (1, 0, 1, 19), +- ("Name", (1, 4, 1, 5), "v", ("Store",)), +- ("Name", (1, 9, 1, 10), "v", ("Load",)), +- [("Continue", (1, 11, 1, 19))], +- [], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "For", +- (1, 0, 1, 18), +- ( +- "Tuple", +- (1, 4, 1, 7), +- [ +- ("Name", (1, 4, 1, 5), "a", ("Store",)), +- ("Name", (1, 6, 1, 7), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 11, 1, 12), "c", ("Load",)), +- [("Pass", (1, 14, 1, 18))], +- [], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "For", +- (1, 0, 1, 20), +- ( +- "Tuple", +- (1, 4, 1, 9), +- [ +- ("Name", (1, 5, 1, 6), "a", ("Store",)), +- ("Name", (1, 7, 1, 8), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 13, 1, 14), "c", ("Load",)), +- [("Pass", (1, 16, 1, 20))], +- [], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "For", +- (1, 0, 1, 20), +- ( +- "List", +- (1, 4, 1, 9), +- [ +- ("Name", (1, 5, 1, 6), "a", ("Store",)), +- ("Name", (1, 7, 1, 8), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 13, 1, 14), "c", ("Load",)), +- [("Pass", (1, 16, 1, 20))], +- [], +- None, +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 11, 5), +- ( +- "GeneratorExp", +- (1, 0, 11, 5), +- ( +- "Tuple", +- (2, 4, 6, 5), +- [ +- ("Name", (3, 4, 3, 6), "Aa", ("Load",)), +- ("Name", (5, 7, 5, 9), "Bb", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (8, 4, 10, 6), +- [ +- ("Name", (8, 4, 8, 6), "Aa", ("Store",)), +- ("Name", (10, 4, 10, 6), "Bb", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (10, 10, 10, 12), "Cc", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 34), +- ( +- "DictComp", +- (1, 0, 1, 34), +- ("Name", (1, 1, 1, 2), "a", ("Load",)), +- ("Name", (1, 5, 1, 6), "b", ("Load",)), +- [ +- ( +- "comprehension", +- ("Name", (1, 11, 1, 12), "w", ("Store",)), +- ("Name", (1, 16, 1, 17), "x", ("Load",)), +- [], +- 0, +- ), +- ( +- "comprehension", +- ("Name", (1, 22, 1, 23), "m", ("Store",)), +- ("Name", (1, 27, 1, 28), "p", ("Load",)), +- [("Name", (1, 32, 1, 33), "g", ("Load",))], +- 0, +- ), +- ], +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 20), +- ( +- "DictComp", +- (1, 0, 1, 20), +- ("Name", (1, 1, 1, 2), "a", ("Load",)), +- ("Name", (1, 5, 1, 6), "b", ("Load",)), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 11, 1, 14), +- [ +- ("Name", (1, 11, 1, 12), "v", ("Store",)), +- ("Name", (1, 13, 1, 14), "w", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 18, 1, 19), "x", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 19), +- ( +- "SetComp", +- (1, 0, 1, 19), +- ("Name", (1, 1, 1, 2), "r", ("Load",)), +- [ +- ( +- "comprehension", +- ("Name", (1, 7, 1, 8), "l", ("Store",)), +- ("Name", (1, 12, 1, 13), "x", ("Load",)), +- [("Name", (1, 17, 1, 18), "g", ("Load",))], +- 0, +- ) +- ], +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 16), +- ( +- "SetComp", +- (1, 0, 1, 16), +- ("Name", (1, 1, 1, 2), "r", ("Load",)), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 7, 1, 10), +- [ +- ("Name", (1, 7, 1, 8), "l", ("Store",)), +- ("Name", (1, 9, 1, 10), "m", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 14, 1, 15), "x", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AsyncFunctionDef", +- (1, 0, 3, 18), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [ +- ( +- "Expr", +- (2, 1, 2, 17), +- ("Constant", (2, 1, 2, 17), "async function", None), +- ), +- ( +- "Expr", +- (3, 1, 3, 18), +- ( +- "Await", +- (3, 1, 3, 18), +- ( +- "Call", +- (3, 7, 3, 18), +- ("Name", (3, 7, 3, 16), "something", ("Load",)), +- [], +- [], +- ), +- ), +- ), +- ], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AsyncFunctionDef", +- (1, 0, 3, 8), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [ +- ( +- "AsyncFor", +- (2, 1, 3, 8), +- ("Name", (2, 11, 2, 12), "e", ("Store",)), +- ("Name", (2, 16, 2, 17), "i", ("Load",)), +- [ +- ( +- "Expr", +- (2, 19, 2, 20), +- ("Constant", (2, 19, 2, 20), 1, None), +- ) +- ], +- [("Expr", (3, 7, 3, 8), ("Constant", (3, 7, 3, 8), 2, None))], +- None, +- ) +- ], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AsyncFunctionDef", +- (1, 0, 2, 21), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [ +- ( +- "AsyncWith", +- (2, 1, 2, 21), +- [ +- ( +- "withitem", +- ("Name", (2, 12, 2, 13), "a", ("Load",)), +- ("Name", (2, 17, 2, 18), "b", ("Store",)), +- ) +- ], +- [ +- ( +- "Expr", +- (2, 20, 2, 21), +- ("Constant", (2, 20, 2, 21), 1, None), +- ) +- ], +- None, +- ) +- ], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 14), +- ( +- "Dict", +- (1, 0, 1, 14), +- [None, ("Constant", (1, 10, 1, 11), 2, None)], +- [ +- ( +- "Dict", +- (1, 3, 1, 8), +- [("Constant", (1, 4, 1, 5), 1, None)], +- [("Constant", (1, 6, 1, 7), 2, None)], +- ), +- ("Constant", (1, 12, 1, 13), 3, None), +- ], +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 12), +- ( +- "Set", +- (1, 0, 1, 12), +- [ +- ( +- "Starred", +- (1, 1, 1, 8), +- ( +- "Set", +- (1, 2, 1, 8), +- [ +- ("Constant", (1, 3, 1, 4), 1, None), +- ("Constant", (1, 6, 1, 7), 2, None), +- ], +- ), +- ("Load",), +- ), +- ("Constant", (1, 10, 1, 11), 3, None), +- ], +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AsyncFunctionDef", +- (1, 0, 2, 21), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [ +- ( +- "Expr", +- (2, 1, 2, 21), +- ( +- "ListComp", +- (2, 1, 2, 21), +- ("Name", (2, 2, 2, 3), "i", ("Load",)), +- [ +- ( +- "comprehension", +- ("Name", (2, 14, 2, 15), "b", ("Store",)), +- ("Name", (2, 19, 2, 20), "c", ("Load",)), +- [], +- 1, +- ) +- ], +- ), +- ) +- ], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (4, 0, 4, 13), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (4, 9, 4, 13))], +- [ +- ("Name", (1, 1, 1, 6), "deco1", ("Load",)), +- ( +- "Call", +- (2, 1, 2, 8), +- ("Name", (2, 1, 2, 6), "deco2", ("Load",)), +- [], +- [], +- ), +- ( +- "Call", +- (3, 1, 3, 9), +- ("Name", (3, 1, 3, 6), "deco3", ("Load",)), +- [("Constant", (3, 7, 3, 8), 1, None)], +- [], +- ), +- ], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "AsyncFunctionDef", +- (4, 0, 4, 19), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (4, 15, 4, 19))], +- [ +- ("Name", (1, 1, 1, 6), "deco1", ("Load",)), +- ( +- "Call", +- (2, 1, 2, 8), +- ("Name", (2, 1, 2, 6), "deco2", ("Load",)), +- [], +- [], +- ), +- ( +- "Call", +- (3, 1, 3, 9), +- ("Name", (3, 1, 3, 6), "deco3", ("Load",)), +- [("Constant", (3, 7, 3, 8), 1, None)], +- [], +- ), +- ], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (4, 0, 4, 13), +- "C", +- [], +- [], +- [("Pass", (4, 9, 4, 13))], +- [ +- ("Name", (1, 1, 1, 6), "deco1", ("Load",)), +- ( +- "Call", +- (2, 1, 2, 8), +- ("Name", (2, 1, 2, 6), "deco2", ("Load",)), +- [], +- [], +- ), +- ( +- "Call", +- (3, 1, 3, 9), +- ("Name", (3, 1, 3, 6), "deco3", ("Load",)), +- [("Constant", (3, 7, 3, 8), 1, None)], +- [], +- ), +- ], +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (2, 0, 2, 13), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (2, 9, 2, 13))], +- [ +- ( +- "Call", +- (1, 1, 1, 19), +- ("Name", (1, 1, 1, 5), "deco", ("Load",)), +- [ +- ( +- "GeneratorExp", +- (1, 5, 1, 19), +- ("Name", (1, 6, 1, 7), "a", ("Load",)), +- [ +- ( +- "comprehension", +- ("Name", (1, 12, 1, 13), "a", ("Store",)), +- ("Name", (1, 17, 1, 18), "b", ("Load",)), +- [], +- 0, +- ) +- ], +- ) +- ], +- [], +- ) +- ], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (2, 0, 2, 13), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (2, 9, 2, 13))], +- [ +- ( +- "Attribute", +- (1, 1, 1, 6), +- ( +- "Attribute", +- (1, 1, 1, 4), +- ("Name", (1, 1, 1, 2), "a", ("Load",)), +- "b", +- ("Load",), +- ), +- "c", +- ("Load",), +- ) +- ], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "Expr", +- (1, 0, 1, 8), +- ( +- "NamedExpr", +- (1, 1, 1, 7), +- ("Name", (1, 1, 1, 2), "a", ("Store",)), +- ("Constant", (1, 6, 1, 7), 1, None), +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 18), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [], +- None, +- [], +- [], +- None, +- [], +- ), +- [("Pass", (1, 14, 1, 18))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 26), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [ +- ("arg", (1, 12, 1, 13), "c", None, None), +- ("arg", (1, 15, 1, 16), "d", None, None), +- ("arg", (1, 18, 1, 19), "e", None, None), +- ], +- None, +- [], +- [], +- None, +- [], +- ), +- [("Pass", (1, 22, 1, 26))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 29), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [("arg", (1, 12, 1, 13), "c", None, None)], +- None, +- [ +- ("arg", (1, 18, 1, 19), "d", None, None), +- ("arg", (1, 21, 1, 22), "e", None, None), +- ], +- [None, None], +- None, +- [], +- ), +- [("Pass", (1, 25, 1, 29))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 39), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [("arg", (1, 12, 1, 13), "c", None, None)], +- None, +- [ +- ("arg", (1, 18, 1, 19), "d", None, None), +- ("arg", (1, 21, 1, 22), "e", None, None), +- ], +- [None, None], +- ("arg", (1, 26, 1, 32), "kwargs", None, None), +- [], +- ), +- [("Pass", (1, 35, 1, 39))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 20), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [], +- None, +- [], +- [], +- None, +- [("Constant", (1, 8, 1, 9), 1, None)], +- ), +- [("Pass", (1, 16, 1, 20))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 29), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [ +- ("arg", (1, 14, 1, 15), "b", None, None), +- ("arg", (1, 19, 1, 20), "c", None, None), +- ], +- None, +- [], +- [], +- None, +- [ +- ("Constant", (1, 8, 1, 9), 1, None), +- ("Constant", (1, 16, 1, 17), 2, None), +- ("Constant", (1, 21, 1, 22), 4, None), +- ], +- ), +- [("Pass", (1, 25, 1, 29))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 32), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [("arg", (1, 14, 1, 15), "b", None, None)], +- None, +- [("arg", (1, 22, 1, 23), "c", None, None)], +- [("Constant", (1, 24, 1, 25), 4, None)], +- None, +- [ +- ("Constant", (1, 8, 1, 9), 1, None), +- ("Constant", (1, 16, 1, 17), 2, None), +- ], +- ), +- [("Pass", (1, 28, 1, 32))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 30), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [("arg", (1, 14, 1, 15), "b", None, None)], +- None, +- [("arg", (1, 22, 1, 23), "c", None, None)], +- [None], +- None, +- [ +- ("Constant", (1, 8, 1, 9), 1, None), +- ("Constant", (1, 16, 1, 17), 2, None), +- ], +- ), +- [("Pass", (1, 26, 1, 30))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 42), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [("arg", (1, 14, 1, 15), "b", None, None)], +- None, +- [("arg", (1, 22, 1, 23), "c", None, None)], +- [("Constant", (1, 24, 1, 25), 4, None)], +- ("arg", (1, 29, 1, 35), "kwargs", None, None), +- [ +- ("Constant", (1, 8, 1, 9), 1, None), +- ("Constant", (1, 16, 1, 17), 2, None), +- ], +- ), +- [("Pass", (1, 38, 1, 42))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 40), +- "f", +- ( +- "arguments", +- [("arg", (1, 6, 1, 7), "a", None, None)], +- [("arg", (1, 14, 1, 15), "b", None, None)], +- None, +- [("arg", (1, 22, 1, 23), "c", None, None)], +- [None], +- ("arg", (1, 27, 1, 33), "kwargs", None, None), +- [ +- ("Constant", (1, 8, 1, 9), 1, None), +- ("Constant", (1, 16, 1, 17), 2, None), +- ], +- ), +- [("Pass", (1, 36, 1, 40))], +- [], +- None, +- None, +- [], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "TypeAlias", +- (1, 0, 1, 12), +- ("Name", (1, 5, 1, 6), "X", ("Store",)), +- [], +- ("Name", (1, 9, 1, 12), "int", ("Load",)), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "TypeAlias", +- (1, 0, 1, 15), +- ("Name", (1, 5, 1, 6), "X", ("Store",)), +- [("TypeVar", (1, 7, 1, 8), "T", None, None)], +- ("Name", (1, 12, 1, 15), "int", ("Load",)), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "TypeAlias", +- (1, 0, 1, 32), +- ("Name", (1, 5, 1, 6), "X", ("Store",)), +- [ +- ("TypeVar", (1, 7, 1, 8), "T", None, None), +- ("TypeVarTuple", (1, 10, 1, 13), "Ts", None), +- ("ParamSpec", (1, 15, 1, 18), "P", None), +- ], +- ( +- "Tuple", +- (1, 22, 1, 32), +- [ +- ("Name", (1, 23, 1, 24), "T", ("Load",)), +- ("Name", (1, 26, 1, 28), "Ts", ("Load",)), +- ("Name", (1, 30, 1, 31), "P", ("Load",)), +- ], +- ("Load",), +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "TypeAlias", +- (1, 0, 1, 37), +- ("Name", (1, 5, 1, 6), "X", ("Store",)), +- [ +- ( +- "TypeVar", +- (1, 7, 1, 13), +- "T", +- ("Name", (1, 10, 1, 13), "int", ("Load",)), +- None, +- ), +- ("TypeVarTuple", (1, 15, 1, 18), "Ts", None), +- ("ParamSpec", (1, 20, 1, 23), "P", None), +- ], +- ( +- "Tuple", +- (1, 27, 1, 37), +- [ +- ("Name", (1, 28, 1, 29), "T", ("Load",)), +- ("Name", (1, 31, 1, 33), "Ts", ("Load",)), +- ("Name", (1, 35, 1, 36), "P", ("Load",)), +- ], +- ("Load",), +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "TypeAlias", +- (1, 0, 1, 44), +- ("Name", (1, 5, 1, 6), "X", ("Store",)), +- [ +- ( +- "TypeVar", +- (1, 7, 1, 20), +- "T", +- ( +- "Tuple", +- (1, 10, 1, 20), +- [ +- ("Name", (1, 11, 1, 14), "int", ("Load",)), +- ("Name", (1, 16, 1, 19), "str", ("Load",)), +- ], +- ("Load",), +- ), +- None, +- ), +- ("TypeVarTuple", (1, 22, 1, 25), "Ts", None), +- ("ParamSpec", (1, 27, 1, 30), "P", None), +- ], +- ( +- "Tuple", +- (1, 34, 1, 44), +- [ +- ("Name", (1, 35, 1, 36), "T", ("Load",)), +- ("Name", (1, 38, 1, 40), "Ts", ("Load",)), +- ("Name", (1, 42, 1, 43), "P", ("Load",)), +- ], +- ("Load",), +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "TypeAlias", +- (1, 0, 1, 48), +- ("Name", (1, 5, 1, 6), "X", ("Store",)), +- [ +- ( +- "TypeVar", +- (1, 7, 1, 17), +- "T", +- ("Name", (1, 10, 1, 13), "int", ("Load",)), +- ("Constant", (1, 16, 1, 17), 1, None), +- ), +- ( +- "TypeVarTuple", +- (1, 19, 1, 26), +- "Ts", +- ("Constant", (1, 25, 1, 26), 2, None), +- ), +- ( +- "ParamSpec", +- (1, 28, 1, 34), +- "P", +- ("Constant", (1, 33, 1, 34), 3, None), +- ), +- ], +- ( +- "Tuple", +- (1, 38, 1, 48), +- [ +- ("Name", (1, 39, 1, 40), "T", ("Load",)), +- ("Name", (1, 42, 1, 44), "Ts", ("Load",)), +- ("Name", (1, 46, 1, 47), "P", ("Load",)), +- ], +- ("Load",), +- ), +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (1, 0, 1, 16), +- "X", +- [], +- [], +- [("Pass", (1, 12, 1, 16))], +- [], +- [("TypeVar", (1, 8, 1, 9), "T", None, None)], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (1, 0, 1, 26), +- "X", +- [], +- [], +- [("Pass", (1, 22, 1, 26))], +- [], +- [ +- ("TypeVar", (1, 8, 1, 9), "T", None, None), +- ("TypeVarTuple", (1, 11, 1, 14), "Ts", None), +- ("ParamSpec", (1, 16, 1, 19), "P", None), +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (1, 0, 1, 31), +- "X", +- [], +- [], +- [("Pass", (1, 27, 1, 31))], +- [], +- [ +- ( +- "TypeVar", +- (1, 8, 1, 14), +- "T", +- ("Name", (1, 11, 1, 14), "int", ("Load",)), +- None, +- ), +- ("TypeVarTuple", (1, 16, 1, 19), "Ts", None), +- ("ParamSpec", (1, 21, 1, 24), "P", None), +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (1, 0, 1, 38), +- "X", +- [], +- [], +- [("Pass", (1, 34, 1, 38))], +- [], +- [ +- ( +- "TypeVar", +- (1, 8, 1, 21), +- "T", +- ( +- "Tuple", +- (1, 11, 1, 21), +- [ +- ("Name", (1, 12, 1, 15), "int", ("Load",)), +- ("Name", (1, 17, 1, 20), "str", ("Load",)), +- ], +- ("Load",), +- ), +- None, +- ), +- ("TypeVarTuple", (1, 23, 1, 26), "Ts", None), +- ("ParamSpec", (1, 28, 1, 31), "P", None), +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "ClassDef", +- (1, 0, 1, 43), +- "X", +- [], +- [], +- [("Pass", (1, 39, 1, 43))], +- [], +- [ +- ( +- "TypeVar", +- (1, 8, 1, 18), +- "T", +- ("Name", (1, 11, 1, 14), "int", ("Load",)), +- ("Constant", (1, 17, 1, 18), 1, None), +- ), +- ( +- "TypeVarTuple", +- (1, 20, 1, 27), +- "Ts", +- ("Constant", (1, 26, 1, 27), 2, None), +- ), +- ( +- "ParamSpec", +- (1, 29, 1, 36), +- "P", +- ("Constant", (1, 35, 1, 36), 3, None), +- ), +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 16), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 12, 1, 16))], +- [], +- None, +- None, +- [("TypeVar", (1, 6, 1, 7), "T", None, None)], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 26), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 22, 1, 26))], +- [], +- None, +- None, +- [ +- ("TypeVar", (1, 6, 1, 7), "T", None, None), +- ("TypeVarTuple", (1, 9, 1, 12), "Ts", None), +- ("ParamSpec", (1, 14, 1, 17), "P", None), +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 31), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 27, 1, 31))], +- [], +- None, +- None, +- [ +- ( +- "TypeVar", +- (1, 6, 1, 12), +- "T", +- ("Name", (1, 9, 1, 12), "int", ("Load",)), +- None, +- ), +- ("TypeVarTuple", (1, 14, 1, 17), "Ts", None), +- ("ParamSpec", (1, 19, 1, 22), "P", None), +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 38), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 34, 1, 38))], +- [], +- None, +- None, +- [ +- ( +- "TypeVar", +- (1, 6, 1, 19), +- "T", +- ( +- "Tuple", +- (1, 9, 1, 19), +- [ +- ("Name", (1, 10, 1, 13), "int", ("Load",)), +- ("Name", (1, 15, 1, 18), "str", ("Load",)), +- ], +- ("Load",), +- ), +- None, +- ), +- ("TypeVarTuple", (1, 21, 1, 24), "Ts", None), +- ("ParamSpec", (1, 26, 1, 29), "P", None), +- ], +- ) +- ], +- [], +- ), +- ( +- "Module", +- [ +- ( +- "FunctionDef", +- (1, 0, 1, 43), +- "f", +- ("arguments", [], [], None, [], [], None, []), +- [("Pass", (1, 39, 1, 43))], +- [], +- None, +- None, +- [ +- ( +- "TypeVar", +- (1, 6, 1, 16), +- "T", +- ("Name", (1, 9, 1, 12), "int", ("Load",)), +- ("Constant", (1, 15, 1, 16), 1, None), +- ), +- ( +- "TypeVarTuple", +- (1, 18, 1, 25), +- "Ts", +- ("Constant", (1, 24, 1, 25), 2, None), +- ), +- ( +- "ParamSpec", +- (1, 27, 1, 34), +- "P", +- ("Constant", (1, 33, 1, 34), 3, None), +- ), +- ], +- ) +- ], +- [], +- ), ++('Module', [('Expr', (1, 0, 1, 4), ('Constant', (1, 0, 1, 4), None, None))], []), ++('Module', [('Expr', (1, 0, 1, 18), ('Constant', (1, 0, 1, 18), 'module docstring', None))], []), ++('Module', [('FunctionDef', (1, 0, 1, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 9, 1, 13))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 29), 'f', ('arguments', [], [], None, [], [], None, []), [('Expr', (1, 9, 1, 29), ('Constant', (1, 9, 1, 29), 'function docstring', None))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 14), 'f', ('arguments', [], [('arg', (1, 6, 1, 7), 'a', None, None)], None, [], [], None, []), [('Pass', (1, 10, 1, 14))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 16), 'f', ('arguments', [], [('arg', (1, 6, 1, 7), 'a', None, None)], None, [], [], None, [('Constant', (1, 8, 1, 9), 0, None)]), [('Pass', (1, 12, 1, 16))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 18), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 11), 'args', None, None), [], [], None, []), [('Pass', (1, 14, 1, 18))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 23), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 16), 'args', ('Starred', (1, 13, 1, 16), ('Name', (1, 14, 1, 16), 'Ts', ('Load',)), ('Load',)), None), [], [], None, []), [('Pass', (1, 19, 1, 23))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 36), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 29), 'args', ('Starred', (1, 13, 1, 29), ('Subscript', (1, 14, 1, 29), ('Name', (1, 14, 1, 19), 'tuple', ('Load',)), ('Tuple', (1, 20, 1, 28), [('Name', (1, 20, 1, 23), 'int', ('Load',)), ('Constant', (1, 25, 1, 28), Ellipsis, None)], ('Load',)), ('Load',)), ('Load',)), None), [], [], None, []), [('Pass', (1, 32, 1, 36))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 36), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 29), 'args', ('Starred', (1, 13, 1, 29), ('Subscript', (1, 14, 1, 29), ('Name', (1, 14, 1, 19), 'tuple', ('Load',)), ('Tuple', (1, 20, 1, 28), [('Name', (1, 20, 1, 23), 'int', ('Load',)), ('Starred', (1, 25, 1, 28), ('Name', (1, 26, 1, 28), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), ('Load',)), None), [], [], None, []), [('Pass', (1, 32, 1, 36))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 21), 'f', ('arguments', [], [], None, [], [], ('arg', (1, 8, 1, 14), 'kwargs', None, None), []), [('Pass', (1, 17, 1, 21))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 71), 'f', ('arguments', [], [('arg', (1, 6, 1, 7), 'a', None, None), ('arg', (1, 9, 1, 10), 'b', None, None), ('arg', (1, 14, 1, 15), 'c', None, None), ('arg', (1, 22, 1, 23), 'd', None, None), ('arg', (1, 28, 1, 29), 'e', None, None)], ('arg', (1, 35, 1, 39), 'args', None, None), [('arg', (1, 41, 1, 42), 'f', None, None)], [('Constant', (1, 43, 1, 45), 42, None)], ('arg', (1, 49, 1, 55), 'kwargs', None, None), [('Constant', (1, 11, 1, 12), 1, None), ('Constant', (1, 16, 1, 20), None, None), ('List', (1, 24, 1, 26), [], ('Load',)), ('Dict', (1, 30, 1, 32), [], [])]), [('Expr', (1, 58, 1, 71), ('Constant', (1, 58, 1, 71), 'doc for f()', None))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 27), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 23, 1, 27))], [], ('Subscript', (1, 11, 1, 21), ('Name', (1, 11, 1, 16), 'tuple', ('Load',)), ('Tuple', (1, 17, 1, 20), [('Starred', (1, 17, 1, 20), ('Name', (1, 18, 1, 20), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 32), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 28, 1, 32))], [], ('Subscript', (1, 11, 1, 26), ('Name', (1, 11, 1, 16), 'tuple', ('Load',)), ('Tuple', (1, 17, 1, 25), [('Name', (1, 17, 1, 20), 'int', ('Load',)), ('Starred', (1, 22, 1, 25), ('Name', (1, 23, 1, 25), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 45), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 41, 1, 45))], [], ('Subscript', (1, 11, 1, 39), ('Name', (1, 11, 1, 16), 'tuple', ('Load',)), ('Tuple', (1, 17, 1, 38), [('Name', (1, 17, 1, 20), 'int', ('Load',)), ('Starred', (1, 22, 1, 38), ('Subscript', (1, 23, 1, 38), ('Name', (1, 23, 1, 28), 'tuple', ('Load',)), ('Tuple', (1, 29, 1, 37), [('Name', (1, 29, 1, 32), 'int', ('Load',)), ('Constant', (1, 34, 1, 37), Ellipsis, None)], ('Load',)), ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, [])], []), ++('Module', [('ClassDef', (1, 0, 1, 12), 'C', [], [], [('Pass', (1, 8, 1, 12))], [], [])], []), ++('Module', [('ClassDef', (1, 0, 1, 32), 'C', [], [], [('Expr', (1, 9, 1, 32), ('Constant', (1, 9, 1, 32), 'docstring for class C', None))], [], [])], []), ++('Module', [('ClassDef', (1, 0, 1, 21), 'C', [('Name', (1, 8, 1, 14), 'object', ('Load',))], [], [('Pass', (1, 17, 1, 21))], [], [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 16), 'f', ('arguments', [], [], None, [], [], None, []), [('Return', (1, 8, 1, 16), ('Constant', (1, 15, 1, 16), 1, None))], [], None, None, [])], []), ++('Module', [('Delete', (1, 0, 1, 5), [('Name', (1, 4, 1, 5), 'v', ('Del',))])], []), ++('Module', [('Assign', (1, 0, 1, 5), [('Name', (1, 0, 1, 1), 'v', ('Store',))], ('Constant', (1, 4, 1, 5), 1, None), None)], []), ++('Module', [('Assign', (1, 0, 1, 7), [('Tuple', (1, 0, 1, 3), [('Name', (1, 0, 1, 1), 'a', ('Store',)), ('Name', (1, 2, 1, 3), 'b', ('Store',))], ('Store',))], ('Name', (1, 6, 1, 7), 'c', ('Load',)), None)], []), ++('Module', [('Assign', (1, 0, 1, 9), [('Tuple', (1, 0, 1, 5), [('Name', (1, 1, 1, 2), 'a', ('Store',)), ('Name', (1, 3, 1, 4), 'b', ('Store',))], ('Store',))], ('Name', (1, 8, 1, 9), 'c', ('Load',)), None)], []), ++('Module', [('Assign', (1, 0, 1, 9), [('List', (1, 0, 1, 5), [('Name', (1, 1, 1, 2), 'a', ('Store',)), ('Name', (1, 3, 1, 4), 'b', ('Store',))], ('Store',))], ('Name', (1, 8, 1, 9), 'c', ('Load',)), None)], []), ++('Module', [('AnnAssign', (1, 0, 1, 13), ('Name', (1, 0, 1, 1), 'x', ('Store',)), ('Subscript', (1, 3, 1, 13), ('Name', (1, 3, 1, 8), 'tuple', ('Load',)), ('Tuple', (1, 9, 1, 12), [('Starred', (1, 9, 1, 12), ('Name', (1, 10, 1, 12), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, 1)], []), ++('Module', [('AnnAssign', (1, 0, 1, 18), ('Name', (1, 0, 1, 1), 'x', ('Store',)), ('Subscript', (1, 3, 1, 18), ('Name', (1, 3, 1, 8), 'tuple', ('Load',)), ('Tuple', (1, 9, 1, 17), [('Name', (1, 9, 1, 12), 'int', ('Load',)), ('Starred', (1, 14, 1, 17), ('Name', (1, 15, 1, 17), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, 1)], []), ++('Module', [('AnnAssign', (1, 0, 1, 31), ('Name', (1, 0, 1, 1), 'x', ('Store',)), ('Subscript', (1, 3, 1, 31), ('Name', (1, 3, 1, 8), 'tuple', ('Load',)), ('Tuple', (1, 9, 1, 30), [('Name', (1, 9, 1, 12), 'int', ('Load',)), ('Starred', (1, 14, 1, 30), ('Subscript', (1, 15, 1, 30), ('Name', (1, 15, 1, 20), 'tuple', ('Load',)), ('Tuple', (1, 21, 1, 29), [('Name', (1, 21, 1, 24), 'str', ('Load',)), ('Constant', (1, 26, 1, 29), Ellipsis, None)], ('Load',)), ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, 1)], []), ++('Module', [('AugAssign', (1, 0, 1, 6), ('Name', (1, 0, 1, 1), 'v', ('Store',)), ('Add',), ('Constant', (1, 5, 1, 6), 1, None))], []), ++('Module', [('For', (1, 0, 1, 15), ('Name', (1, 4, 1, 5), 'v', ('Store',)), ('Name', (1, 9, 1, 10), 'v', ('Load',)), [('Pass', (1, 11, 1, 15))], [], None)], []), ++('Module', [('While', (1, 0, 1, 12), ('Name', (1, 6, 1, 7), 'v', ('Load',)), [('Pass', (1, 8, 1, 12))], [])], []), ++('Module', [('If', (1, 0, 1, 9), ('Name', (1, 3, 1, 4), 'v', ('Load',)), [('Pass', (1, 5, 1, 9))], [])], []), ++('Module', [('If', (1, 0, 4, 6), ('Name', (1, 3, 1, 4), 'a', ('Load',)), [('Pass', (2, 2, 2, 6))], [('If', (3, 0, 4, 6), ('Name', (3, 5, 3, 6), 'b', ('Load',)), [('Pass', (4, 2, 4, 6))], [])])], []), ++('Module', [('If', (1, 0, 6, 6), ('Name', (1, 3, 1, 4), 'a', ('Load',)), [('Pass', (2, 2, 2, 6))], [('If', (3, 0, 6, 6), ('Name', (3, 5, 3, 6), 'b', ('Load',)), [('Pass', (4, 2, 4, 6))], [('Pass', (6, 2, 6, 6))])])], []), ++('Module', [('With', (1, 0, 1, 17), [('withitem', ('Name', (1, 5, 1, 6), 'x', ('Load',)), ('Name', (1, 10, 1, 11), 'y', ('Store',)))], [('Pass', (1, 13, 1, 17))], None)], []), ++('Module', [('With', (1, 0, 1, 25), [('withitem', ('Name', (1, 5, 1, 6), 'x', ('Load',)), ('Name', (1, 10, 1, 11), 'y', ('Store',))), ('withitem', ('Name', (1, 13, 1, 14), 'z', ('Load',)), ('Name', (1, 18, 1, 19), 'q', ('Store',)))], [('Pass', (1, 21, 1, 25))], None)], []), ++('Module', [('With', (1, 0, 1, 19), [('withitem', ('Name', (1, 6, 1, 7), 'x', ('Load',)), ('Name', (1, 11, 1, 12), 'y', ('Store',)))], [('Pass', (1, 15, 1, 19))], None)], []), ++('Module', [('With', (1, 0, 1, 17), [('withitem', ('Name', (1, 6, 1, 7), 'x', ('Load',)), None), ('withitem', ('Name', (1, 9, 1, 10), 'y', ('Load',)), None)], [('Pass', (1, 13, 1, 17))], None)], []), ++('Module', [('Raise', (1, 0, 1, 25), ('Call', (1, 6, 1, 25), ('Name', (1, 6, 1, 15), 'Exception', ('Load',)), [('Constant', (1, 16, 1, 24), 'string', None)], []), None)], []), ++('Module', [('Try', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [('ExceptHandler', (3, 0, 4, 6), ('Name', (3, 7, 3, 16), 'Exception', ('Load',)), None, [('Pass', (4, 2, 4, 6))])], [], [])], []), ++('Module', [('Try', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [], [], [('Pass', (4, 2, 4, 6))])], []), ++('Module', [('TryStar', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [('ExceptHandler', (3, 0, 4, 6), ('Name', (3, 8, 3, 17), 'Exception', ('Load',)), None, [('Pass', (4, 2, 4, 6))])], [], [])], []), ++('Module', [('Assert', (1, 0, 1, 8), ('Name', (1, 7, 1, 8), 'v', ('Load',)), None)], []), ++('Module', [('Import', (1, 0, 1, 10), [('alias', (1, 7, 1, 10), 'sys', None)])], []), ++('Module', [('ImportFrom', (1, 0, 1, 17), 'sys', [('alias', (1, 16, 1, 17), 'v', None)], 0)], []), ++('Module', [('Global', (1, 0, 1, 8), ['v'])], []), ++('Module', [('Expr', (1, 0, 1, 1), ('Constant', (1, 0, 1, 1), 1, None))], []), ++('Module', [('Pass', (1, 0, 1, 4))], []), ++('Module', [('For', (1, 0, 1, 16), ('Name', (1, 4, 1, 5), 'v', ('Store',)), ('Name', (1, 9, 1, 10), 'v', ('Load',)), [('Break', (1, 11, 1, 16))], [], None)], []), ++('Module', [('For', (1, 0, 1, 19), ('Name', (1, 4, 1, 5), 'v', ('Store',)), ('Name', (1, 9, 1, 10), 'v', ('Load',)), [('Continue', (1, 11, 1, 19))], [], None)], []), ++('Module', [('For', (1, 0, 1, 18), ('Tuple', (1, 4, 1, 7), [('Name', (1, 4, 1, 5), 'a', ('Store',)), ('Name', (1, 6, 1, 7), 'b', ('Store',))], ('Store',)), ('Name', (1, 11, 1, 12), 'c', ('Load',)), [('Pass', (1, 14, 1, 18))], [], None)], []), ++('Module', [('For', (1, 0, 1, 20), ('Tuple', (1, 4, 1, 9), [('Name', (1, 5, 1, 6), 'a', ('Store',)), ('Name', (1, 7, 1, 8), 'b', ('Store',))], ('Store',)), ('Name', (1, 13, 1, 14), 'c', ('Load',)), [('Pass', (1, 16, 1, 20))], [], None)], []), ++('Module', [('For', (1, 0, 1, 20), ('List', (1, 4, 1, 9), [('Name', (1, 5, 1, 6), 'a', ('Store',)), ('Name', (1, 7, 1, 8), 'b', ('Store',))], ('Store',)), ('Name', (1, 13, 1, 14), 'c', ('Load',)), [('Pass', (1, 16, 1, 20))], [], None)], []), ++('Module', [('Expr', (1, 0, 11, 5), ('GeneratorExp', (1, 0, 11, 5), ('Tuple', (2, 4, 6, 5), [('Name', (3, 4, 3, 6), 'Aa', ('Load',)), ('Name', (5, 7, 5, 9), 'Bb', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (8, 4, 10, 6), [('Name', (8, 4, 8, 6), 'Aa', ('Store',)), ('Name', (10, 4, 10, 6), 'Bb', ('Store',))], ('Store',)), ('Name', (10, 10, 10, 12), 'Cc', ('Load',)), [], 0)]))], []), ++('Module', [('Expr', (1, 0, 1, 34), ('DictComp', (1, 0, 1, 34), ('Name', (1, 1, 1, 2), 'a', ('Load',)), ('Name', (1, 5, 1, 6), 'b', ('Load',)), [('comprehension', ('Name', (1, 11, 1, 12), 'w', ('Store',)), ('Name', (1, 16, 1, 17), 'x', ('Load',)), [], 0), ('comprehension', ('Name', (1, 22, 1, 23), 'm', ('Store',)), ('Name', (1, 27, 1, 28), 'p', ('Load',)), [('Name', (1, 32, 1, 33), 'g', ('Load',))], 0)]))], []), ++('Module', [('Expr', (1, 0, 1, 20), ('DictComp', (1, 0, 1, 20), ('Name', (1, 1, 1, 2), 'a', ('Load',)), ('Name', (1, 5, 1, 6), 'b', ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'v', ('Store',)), ('Name', (1, 13, 1, 14), 'w', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'x', ('Load',)), [], 0)]))], []), ++('Module', [('Expr', (1, 0, 1, 19), ('SetComp', (1, 0, 1, 19), ('Name', (1, 1, 1, 2), 'r', ('Load',)), [('comprehension', ('Name', (1, 7, 1, 8), 'l', ('Store',)), ('Name', (1, 12, 1, 13), 'x', ('Load',)), [('Name', (1, 17, 1, 18), 'g', ('Load',))], 0)]))], []), ++('Module', [('Expr', (1, 0, 1, 16), ('SetComp', (1, 0, 1, 16), ('Name', (1, 1, 1, 2), 'r', ('Load',)), [('comprehension', ('Tuple', (1, 7, 1, 10), [('Name', (1, 7, 1, 8), 'l', ('Store',)), ('Name', (1, 9, 1, 10), 'm', ('Store',))], ('Store',)), ('Name', (1, 14, 1, 15), 'x', ('Load',)), [], 0)]))], []), ++('Module', [('AsyncFunctionDef', (1, 0, 3, 18), 'f', ('arguments', [], [], None, [], [], None, []), [('Expr', (2, 1, 2, 17), ('Constant', (2, 1, 2, 17), 'async function', None)), ('Expr', (3, 1, 3, 18), ('Await', (3, 1, 3, 18), ('Call', (3, 7, 3, 18), ('Name', (3, 7, 3, 16), 'something', ('Load',)), [], [])))], [], None, None, [])], []), ++('Module', [('AsyncFunctionDef', (1, 0, 3, 8), 'f', ('arguments', [], [], None, [], [], None, []), [('AsyncFor', (2, 1, 3, 8), ('Name', (2, 11, 2, 12), 'e', ('Store',)), ('Name', (2, 16, 2, 17), 'i', ('Load',)), [('Expr', (2, 19, 2, 20), ('Constant', (2, 19, 2, 20), 1, None))], [('Expr', (3, 7, 3, 8), ('Constant', (3, 7, 3, 8), 2, None))], None)], [], None, None, [])], []), ++('Module', [('AsyncFunctionDef', (1, 0, 2, 21), 'f', ('arguments', [], [], None, [], [], None, []), [('AsyncWith', (2, 1, 2, 21), [('withitem', ('Name', (2, 12, 2, 13), 'a', ('Load',)), ('Name', (2, 17, 2, 18), 'b', ('Store',)))], [('Expr', (2, 20, 2, 21), ('Constant', (2, 20, 2, 21), 1, None))], None)], [], None, None, [])], []), ++('Module', [('Expr', (1, 0, 1, 14), ('Dict', (1, 0, 1, 14), [None, ('Constant', (1, 10, 1, 11), 2, None)], [('Dict', (1, 3, 1, 8), [('Constant', (1, 4, 1, 5), 1, None)], [('Constant', (1, 6, 1, 7), 2, None)]), ('Constant', (1, 12, 1, 13), 3, None)]))], []), ++('Module', [('Expr', (1, 0, 1, 12), ('Set', (1, 0, 1, 12), [('Starred', (1, 1, 1, 8), ('Set', (1, 2, 1, 8), [('Constant', (1, 3, 1, 4), 1, None), ('Constant', (1, 6, 1, 7), 2, None)]), ('Load',)), ('Constant', (1, 10, 1, 11), 3, None)]))], []), ++('Module', [('AsyncFunctionDef', (1, 0, 2, 21), 'f', ('arguments', [], [], None, [], [], None, []), [('Expr', (2, 1, 2, 21), ('ListComp', (2, 1, 2, 21), ('Name', (2, 2, 2, 3), 'i', ('Load',)), [('comprehension', ('Name', (2, 14, 2, 15), 'b', ('Store',)), ('Name', (2, 19, 2, 20), 'c', ('Load',)), [], 1)]))], [], None, None, [])], []), ++('Module', [('FunctionDef', (4, 0, 4, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (4, 9, 4, 13))], [('Name', (1, 1, 1, 6), 'deco1', ('Load',)), ('Call', (2, 1, 2, 8), ('Name', (2, 1, 2, 6), 'deco2', ('Load',)), [], []), ('Call', (3, 1, 3, 9), ('Name', (3, 1, 3, 6), 'deco3', ('Load',)), [('Constant', (3, 7, 3, 8), 1, None)], [])], None, None, [])], []), ++('Module', [('AsyncFunctionDef', (4, 0, 4, 19), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (4, 15, 4, 19))], [('Name', (1, 1, 1, 6), 'deco1', ('Load',)), ('Call', (2, 1, 2, 8), ('Name', (2, 1, 2, 6), 'deco2', ('Load',)), [], []), ('Call', (3, 1, 3, 9), ('Name', (3, 1, 3, 6), 'deco3', ('Load',)), [('Constant', (3, 7, 3, 8), 1, None)], [])], None, None, [])], []), ++('Module', [('ClassDef', (4, 0, 4, 13), 'C', [], [], [('Pass', (4, 9, 4, 13))], [('Name', (1, 1, 1, 6), 'deco1', ('Load',)), ('Call', (2, 1, 2, 8), ('Name', (2, 1, 2, 6), 'deco2', ('Load',)), [], []), ('Call', (3, 1, 3, 9), ('Name', (3, 1, 3, 6), 'deco3', ('Load',)), [('Constant', (3, 7, 3, 8), 1, None)], [])], [])], []), ++('Module', [('FunctionDef', (2, 0, 2, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (2, 9, 2, 13))], [('Call', (1, 1, 1, 19), ('Name', (1, 1, 1, 5), 'deco', ('Load',)), [('GeneratorExp', (1, 5, 1, 19), ('Name', (1, 6, 1, 7), 'a', ('Load',)), [('comprehension', ('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 17, 1, 18), 'b', ('Load',)), [], 0)])], [])], None, None, [])], []), ++('Module', [('FunctionDef', (2, 0, 2, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (2, 9, 2, 13))], [('Attribute', (1, 1, 1, 6), ('Attribute', (1, 1, 1, 4), ('Name', (1, 1, 1, 2), 'a', ('Load',)), 'b', ('Load',)), 'c', ('Load',))], None, None, [])], []), ++('Module', [('Expr', (1, 0, 1, 8), ('NamedExpr', (1, 1, 1, 7), ('Name', (1, 1, 1, 2), 'a', ('Store',)), ('Constant', (1, 6, 1, 7), 1, None)))], []), ++('Module', [('FunctionDef', (1, 0, 1, 18), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [], None, [], [], None, []), [('Pass', (1, 14, 1, 18))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 26), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 12, 1, 13), 'c', None, None), ('arg', (1, 15, 1, 16), 'd', None, None), ('arg', (1, 18, 1, 19), 'e', None, None)], None, [], [], None, []), [('Pass', (1, 22, 1, 26))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 29), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 12, 1, 13), 'c', None, None)], None, [('arg', (1, 18, 1, 19), 'd', None, None), ('arg', (1, 21, 1, 22), 'e', None, None)], [None, None], None, []), [('Pass', (1, 25, 1, 29))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 39), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 12, 1, 13), 'c', None, None)], None, [('arg', (1, 18, 1, 19), 'd', None, None), ('arg', (1, 21, 1, 22), 'e', None, None)], [None, None], ('arg', (1, 26, 1, 32), 'kwargs', None, None), []), [('Pass', (1, 35, 1, 39))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 20), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [], None, [], [], None, [('Constant', (1, 8, 1, 9), 1, None)]), [('Pass', (1, 16, 1, 20))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 29), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None), ('arg', (1, 19, 1, 20), 'c', None, None)], None, [], [], None, [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None), ('Constant', (1, 21, 1, 22), 4, None)]), [('Pass', (1, 25, 1, 29))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 32), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [('Constant', (1, 24, 1, 25), 4, None)], None, [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 28, 1, 32))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 30), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [None], None, [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 26, 1, 30))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 42), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [('Constant', (1, 24, 1, 25), 4, None)], ('arg', (1, 29, 1, 35), 'kwargs', None, None), [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 38, 1, 42))], [], None, None, [])], []), ++('Module', [('FunctionDef', (1, 0, 1, 40), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [None], ('arg', (1, 27, 1, 33), 'kwargs', None, None), [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 36, 1, 40))], [], None, None, [])], []), ++('Module', [('TypeAlias', (1, 0, 1, 12), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [], ('Name', (1, 9, 1, 12), 'int', ('Load',)))], []), ++('Module', [('TypeAlias', (1, 0, 1, 15), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 8), 'T', None, None)], ('Name', (1, 12, 1, 15), 'int', ('Load',)))], []), ++('Module', [('TypeAlias', (1, 0, 1, 32), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 8), 'T', None, None), ('TypeVarTuple', (1, 10, 1, 13), 'Ts', None), ('ParamSpec', (1, 15, 1, 18), 'P', None)], ('Tuple', (1, 22, 1, 32), [('Name', (1, 23, 1, 24), 'T', ('Load',)), ('Name', (1, 26, 1, 28), 'Ts', ('Load',)), ('Name', (1, 30, 1, 31), 'P', ('Load',))], ('Load',)))], []), ++('Module', [('TypeAlias', (1, 0, 1, 37), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 13), 'T', ('Name', (1, 10, 1, 13), 'int', ('Load',)), None), ('TypeVarTuple', (1, 15, 1, 18), 'Ts', None), ('ParamSpec', (1, 20, 1, 23), 'P', None)], ('Tuple', (1, 27, 1, 37), [('Name', (1, 28, 1, 29), 'T', ('Load',)), ('Name', (1, 31, 1, 33), 'Ts', ('Load',)), ('Name', (1, 35, 1, 36), 'P', ('Load',))], ('Load',)))], []), ++('Module', [('TypeAlias', (1, 0, 1, 44), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 20), 'T', ('Tuple', (1, 10, 1, 20), [('Name', (1, 11, 1, 14), 'int', ('Load',)), ('Name', (1, 16, 1, 19), 'str', ('Load',))], ('Load',)), None), ('TypeVarTuple', (1, 22, 1, 25), 'Ts', None), ('ParamSpec', (1, 27, 1, 30), 'P', None)], ('Tuple', (1, 34, 1, 44), [('Name', (1, 35, 1, 36), 'T', ('Load',)), ('Name', (1, 38, 1, 40), 'Ts', ('Load',)), ('Name', (1, 42, 1, 43), 'P', ('Load',))], ('Load',)))], []), ++('Module', [('TypeAlias', (1, 0, 1, 48), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 17), 'T', ('Name', (1, 10, 1, 13), 'int', ('Load',)), ('Constant', (1, 16, 1, 17), 1, None)), ('TypeVarTuple', (1, 19, 1, 26), 'Ts', ('Constant', (1, 25, 1, 26), 2, None)), ('ParamSpec', (1, 28, 1, 34), 'P', ('Constant', (1, 33, 1, 34), 3, None))], ('Tuple', (1, 38, 1, 48), [('Name', (1, 39, 1, 40), 'T', ('Load',)), ('Name', (1, 42, 1, 44), 'Ts', ('Load',)), ('Name', (1, 46, 1, 47), 'P', ('Load',))], ('Load',)))], []), ++('Module', [('ClassDef', (1, 0, 1, 16), 'X', [], [], [('Pass', (1, 12, 1, 16))], [], [('TypeVar', (1, 8, 1, 9), 'T', None, None)])], []), ++('Module', [('ClassDef', (1, 0, 1, 26), 'X', [], [], [('Pass', (1, 22, 1, 26))], [], [('TypeVar', (1, 8, 1, 9), 'T', None, None), ('TypeVarTuple', (1, 11, 1, 14), 'Ts', None), ('ParamSpec', (1, 16, 1, 19), 'P', None)])], []), ++('Module', [('ClassDef', (1, 0, 1, 31), 'X', [], [], [('Pass', (1, 27, 1, 31))], [], [('TypeVar', (1, 8, 1, 14), 'T', ('Name', (1, 11, 1, 14), 'int', ('Load',)), None), ('TypeVarTuple', (1, 16, 1, 19), 'Ts', None), ('ParamSpec', (1, 21, 1, 24), 'P', None)])], []), ++('Module', [('ClassDef', (1, 0, 1, 38), 'X', [], [], [('Pass', (1, 34, 1, 38))], [], [('TypeVar', (1, 8, 1, 21), 'T', ('Tuple', (1, 11, 1, 21), [('Name', (1, 12, 1, 15), 'int', ('Load',)), ('Name', (1, 17, 1, 20), 'str', ('Load',))], ('Load',)), None), ('TypeVarTuple', (1, 23, 1, 26), 'Ts', None), ('ParamSpec', (1, 28, 1, 31), 'P', None)])], []), ++('Module', [('ClassDef', (1, 0, 1, 43), 'X', [], [], [('Pass', (1, 39, 1, 43))], [], [('TypeVar', (1, 8, 1, 18), 'T', ('Name', (1, 11, 1, 14), 'int', ('Load',)), ('Constant', (1, 17, 1, 18), 1, None)), ('TypeVarTuple', (1, 20, 1, 27), 'Ts', ('Constant', (1, 26, 1, 27), 2, None)), ('ParamSpec', (1, 29, 1, 36), 'P', ('Constant', (1, 35, 1, 36), 3, None))])], []), ++('Module', [('FunctionDef', (1, 0, 1, 16), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 12, 1, 16))], [], None, None, [('TypeVar', (1, 6, 1, 7), 'T', None, None)])], []), ++('Module', [('FunctionDef', (1, 0, 1, 26), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 22, 1, 26))], [], None, None, [('TypeVar', (1, 6, 1, 7), 'T', None, None), ('TypeVarTuple', (1, 9, 1, 12), 'Ts', None), ('ParamSpec', (1, 14, 1, 17), 'P', None)])], []), ++('Module', [('FunctionDef', (1, 0, 1, 31), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 27, 1, 31))], [], None, None, [('TypeVar', (1, 6, 1, 12), 'T', ('Name', (1, 9, 1, 12), 'int', ('Load',)), None), ('TypeVarTuple', (1, 14, 1, 17), 'Ts', None), ('ParamSpec', (1, 19, 1, 22), 'P', None)])], []), ++('Module', [('FunctionDef', (1, 0, 1, 38), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 34, 1, 38))], [], None, None, [('TypeVar', (1, 6, 1, 19), 'T', ('Tuple', (1, 9, 1, 19), [('Name', (1, 10, 1, 13), 'int', ('Load',)), ('Name', (1, 15, 1, 18), 'str', ('Load',))], ('Load',)), None), ('TypeVarTuple', (1, 21, 1, 24), 'Ts', None), ('ParamSpec', (1, 26, 1, 29), 'P', None)])], []), ++('Module', [('FunctionDef', (1, 0, 1, 43), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 39, 1, 43))], [], None, None, [('TypeVar', (1, 6, 1, 16), 'T', ('Name', (1, 9, 1, 12), 'int', ('Load',)), ('Constant', (1, 15, 1, 16), 1, None)), ('TypeVarTuple', (1, 18, 1, 25), 'Ts', ('Constant', (1, 24, 1, 25), 2, None)), ('ParamSpec', (1, 27, 1, 34), 'P', ('Constant', (1, 33, 1, 34), 3, None))])], []), + ] + single_results = [ +- ( +- "Interactive", +- [ +- ( +- "Expr", +- (1, 0, 1, 3), +- ( +- "BinOp", +- (1, 0, 1, 3), +- ("Constant", (1, 0, 1, 1), 1, None), +- ("Add",), +- ("Constant", (1, 2, 1, 3), 2, None), +- ), +- ) +- ], +- ), ++('Interactive', [('Expr', (1, 0, 1, 3), ('BinOp', (1, 0, 1, 3), ('Constant', (1, 0, 1, 1), 1, None), ('Add',), ('Constant', (1, 2, 1, 3), 2, None)))]), + ] + eval_results = [ +- ("Expression", ("Constant", (1, 0, 1, 4), None, None)), +- ( +- "Expression", +- ( +- "BoolOp", +- (1, 0, 1, 7), +- ("And",), +- [ +- ("Name", (1, 0, 1, 1), "a", ("Load",)), +- ("Name", (1, 6, 1, 7), "b", ("Load",)), +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "BinOp", +- (1, 0, 1, 5), +- ("Name", (1, 0, 1, 1), "a", ("Load",)), +- ("Add",), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ), +- ), +- ( +- "Expression", +- ("UnaryOp", (1, 0, 1, 5), ("Not",), ("Name", (1, 4, 1, 5), "v", ("Load",))), +- ), +- ( +- "Expression", +- ( +- "Lambda", +- (1, 0, 1, 11), +- ("arguments", [], [], None, [], [], None, []), +- ("Constant", (1, 7, 1, 11), None, None), +- ), +- ), +- ( +- "Expression", +- ( +- "Dict", +- (1, 0, 1, 7), +- [("Constant", (1, 2, 1, 3), 1, None)], +- [("Constant", (1, 4, 1, 5), 2, None)], +- ), +- ), +- ("Expression", ("Dict", (1, 0, 1, 2), [], [])), +- ("Expression", ("Set", (1, 0, 1, 7), [("Constant", (1, 1, 1, 5), None, None)])), +- ( +- "Expression", +- ( +- "Dict", +- (1, 0, 5, 6), +- [("Constant", (2, 6, 2, 7), 1, None)], +- [("Constant", (4, 10, 4, 11), 2, None)], +- ), +- ), +- ( +- "Expression", +- ( +- "ListComp", +- (1, 0, 1, 19), +- ("Name", (1, 1, 1, 2), "a", ("Load",)), +- [ +- ( +- "comprehension", +- ("Name", (1, 7, 1, 8), "b", ("Store",)), +- ("Name", (1, 12, 1, 13), "c", ("Load",)), +- [("Name", (1, 17, 1, 18), "d", ("Load",))], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "GeneratorExp", +- (1, 0, 1, 19), +- ("Name", (1, 1, 1, 2), "a", ("Load",)), +- [ +- ( +- "comprehension", +- ("Name", (1, 7, 1, 8), "b", ("Store",)), +- ("Name", (1, 12, 1, 13), "c", ("Load",)), +- [("Name", (1, 17, 1, 18), "d", ("Load",))], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "ListComp", +- (1, 0, 1, 20), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 11, 1, 14), +- [ +- ("Name", (1, 11, 1, 12), "a", ("Store",)), +- ("Name", (1, 13, 1, 14), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 18, 1, 19), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "ListComp", +- (1, 0, 1, 22), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 11, 1, 16), +- [ +- ("Name", (1, 12, 1, 13), "a", ("Store",)), +- ("Name", (1, 14, 1, 15), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 20, 1, 21), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "ListComp", +- (1, 0, 1, 22), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "List", +- (1, 11, 1, 16), +- [ +- ("Name", (1, 12, 1, 13), "a", ("Store",)), +- ("Name", (1, 14, 1, 15), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 20, 1, 21), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "SetComp", +- (1, 0, 1, 20), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 11, 1, 14), +- [ +- ("Name", (1, 11, 1, 12), "a", ("Store",)), +- ("Name", (1, 13, 1, 14), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 18, 1, 19), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "SetComp", +- (1, 0, 1, 22), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 11, 1, 16), +- [ +- ("Name", (1, 12, 1, 13), "a", ("Store",)), +- ("Name", (1, 14, 1, 15), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 20, 1, 21), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "SetComp", +- (1, 0, 1, 22), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "List", +- (1, 11, 1, 16), +- [ +- ("Name", (1, 12, 1, 13), "a", ("Store",)), +- ("Name", (1, 14, 1, 15), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 20, 1, 21), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "GeneratorExp", +- (1, 0, 1, 20), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 11, 1, 14), +- [ +- ("Name", (1, 11, 1, 12), "a", ("Store",)), +- ("Name", (1, 13, 1, 14), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 18, 1, 19), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "GeneratorExp", +- (1, 0, 1, 22), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "Tuple", +- (1, 11, 1, 16), +- [ +- ("Name", (1, 12, 1, 13), "a", ("Store",)), +- ("Name", (1, 14, 1, 15), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 20, 1, 21), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "GeneratorExp", +- (1, 0, 1, 22), +- ( +- "Tuple", +- (1, 1, 1, 6), +- [ +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- ("Name", (1, 4, 1, 5), "b", ("Load",)), +- ], +- ("Load",), +- ), +- [ +- ( +- "comprehension", +- ( +- "List", +- (1, 11, 1, 16), +- [ +- ("Name", (1, 12, 1, 13), "a", ("Store",)), +- ("Name", (1, 14, 1, 15), "b", ("Store",)), +- ], +- ("Store",), +- ), +- ("Name", (1, 20, 1, 21), "c", ("Load",)), +- [], +- 0, +- ) +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "Compare", +- (1, 0, 1, 9), +- ("Constant", (1, 0, 1, 1), 1, None), +- [("Lt",), ("Lt",)], +- [("Constant", (1, 4, 1, 5), 2, None), ("Constant", (1, 8, 1, 9), 3, None)], +- ), +- ), +- ( +- "Expression", +- ( +- "Call", +- (1, 0, 1, 17), +- ("Name", (1, 0, 1, 1), "f", ("Load",)), +- [ +- ("Constant", (1, 2, 1, 3), 1, None), +- ("Constant", (1, 4, 1, 5), 2, None), +- ( +- "Starred", +- (1, 10, 1, 12), +- ("Name", (1, 11, 1, 12), "d", ("Load",)), +- ("Load",), +- ), +- ], +- [ +- ("keyword", (1, 6, 1, 9), "c", ("Constant", (1, 8, 1, 9), 3, None)), +- ( +- "keyword", +- (1, 13, 1, 16), +- None, +- ("Name", (1, 15, 1, 16), "e", ("Load",)), +- ), +- ], +- ), +- ), +- ( +- "Expression", +- ( +- "Call", +- (1, 0, 1, 10), +- ("Name", (1, 0, 1, 1), "f", ("Load",)), +- [ +- ( +- "Starred", +- (1, 2, 1, 9), +- ( +- "List", +- (1, 3, 1, 9), +- [ +- ("Constant", (1, 4, 1, 5), 0, None), +- ("Constant", (1, 7, 1, 8), 1, None), +- ], +- ("Load",), +- ), +- ("Load",), +- ) +- ], +- [], +- ), +- ), +- ( +- "Expression", +- ( +- "Call", +- (1, 0, 1, 15), +- ("Name", (1, 0, 1, 1), "f", ("Load",)), +- [ +- ( +- "GeneratorExp", +- (1, 1, 1, 15), +- ("Name", (1, 2, 1, 3), "a", ("Load",)), +- [ +- ( +- "comprehension", +- ("Name", (1, 8, 1, 9), "a", ("Store",)), +- ("Name", (1, 13, 1, 14), "b", ("Load",)), +- [], +- 0, +- ) +- ], +- ) +- ], +- [], +- ), +- ), +- ("Expression", ("Constant", (1, 0, 1, 2), 10, None)), +- ("Expression", ("Constant", (1, 0, 1, 8), "string", None)), +- ( +- "Expression", +- ( +- "Attribute", +- (1, 0, 1, 3), +- ("Name", (1, 0, 1, 1), "a", ("Load",)), +- "b", +- ("Load",), +- ), +- ), +- ( +- "Expression", +- ( +- "Subscript", +- (1, 0, 1, 6), +- ("Name", (1, 0, 1, 1), "a", ("Load",)), +- ( +- "Slice", +- (1, 2, 1, 5), +- ("Name", (1, 2, 1, 3), "b", ("Load",)), +- ("Name", (1, 4, 1, 5), "c", ("Load",)), +- None, +- ), +- ("Load",), +- ), +- ), +- ("Expression", ("Name", (1, 0, 1, 1), "v", ("Load",))), +- ( +- "Expression", +- ( +- "List", +- (1, 0, 1, 7), +- [ +- ("Constant", (1, 1, 1, 2), 1, None), +- ("Constant", (1, 3, 1, 4), 2, None), +- ("Constant", (1, 5, 1, 6), 3, None), +- ], +- ("Load",), +- ), +- ), +- ("Expression", ("List", (1, 0, 1, 2), [], ("Load",))), +- ( +- "Expression", +- ( +- "Tuple", +- (1, 0, 1, 5), +- [ +- ("Constant", (1, 0, 1, 1), 1, None), +- ("Constant", (1, 2, 1, 3), 2, None), +- ("Constant", (1, 4, 1, 5), 3, None), +- ], +- ("Load",), +- ), +- ), +- ( +- "Expression", +- ( +- "Tuple", +- (1, 0, 1, 7), +- [ +- ("Constant", (1, 1, 1, 2), 1, None), +- ("Constant", (1, 3, 1, 4), 2, None), +- ("Constant", (1, 5, 1, 6), 3, None), +- ], +- ("Load",), +- ), +- ), +- ("Expression", ("Tuple", (1, 0, 1, 2), [], ("Load",))), +- ( +- "Expression", +- ( +- "Call", +- (1, 0, 1, 17), +- ( +- "Attribute", +- (1, 0, 1, 7), +- ( +- "Attribute", +- (1, 0, 1, 5), +- ( +- "Attribute", +- (1, 0, 1, 3), +- ("Name", (1, 0, 1, 1), "a", ("Load",)), +- "b", +- ("Load",), +- ), +- "c", +- ("Load",), +- ), +- "d", +- ("Load",), +- ), +- [ +- ( +- "Subscript", +- (1, 8, 1, 16), +- ( +- "Attribute", +- (1, 8, 1, 11), +- ("Name", (1, 8, 1, 9), "a", ("Load",)), +- "b", +- ("Load",), +- ), +- ( +- "Slice", +- (1, 12, 1, 15), +- ("Constant", (1, 12, 1, 13), 1, None), +- ("Constant", (1, 14, 1, 15), 2, None), +- None, +- ), +- ("Load",), +- ) +- ], +- [], +- ), +- ), ++('Expression', ('Constant', (1, 0, 1, 4), None, None)), ++('Expression', ('BoolOp', (1, 0, 1, 7), ('And',), [('Name', (1, 0, 1, 1), 'a', ('Load',)), ('Name', (1, 6, 1, 7), 'b', ('Load',))])), ++('Expression', ('BinOp', (1, 0, 1, 5), ('Name', (1, 0, 1, 1), 'a', ('Load',)), ('Add',), ('Name', (1, 4, 1, 5), 'b', ('Load',)))), ++('Expression', ('UnaryOp', (1, 0, 1, 5), ('Not',), ('Name', (1, 4, 1, 5), 'v', ('Load',)))), ++('Expression', ('Lambda', (1, 0, 1, 11), ('arguments', [], [], None, [], [], None, []), ('Constant', (1, 7, 1, 11), None, None))), ++('Expression', ('Dict', (1, 0, 1, 7), [('Constant', (1, 2, 1, 3), 1, None)], [('Constant', (1, 4, 1, 5), 2, None)])), ++('Expression', ('Dict', (1, 0, 1, 2), [], [])), ++('Expression', ('Set', (1, 0, 1, 7), [('Constant', (1, 1, 1, 5), None, None)])), ++('Expression', ('Dict', (1, 0, 5, 6), [('Constant', (2, 6, 2, 7), 1, None)], [('Constant', (4, 10, 4, 11), 2, None)])), ++('Expression', ('ListComp', (1, 0, 1, 19), ('Name', (1, 1, 1, 2), 'a', ('Load',)), [('comprehension', ('Name', (1, 7, 1, 8), 'b', ('Store',)), ('Name', (1, 12, 1, 13), 'c', ('Load',)), [('Name', (1, 17, 1, 18), 'd', ('Load',))], 0)])), ++('Expression', ('GeneratorExp', (1, 0, 1, 19), ('Name', (1, 1, 1, 2), 'a', ('Load',)), [('comprehension', ('Name', (1, 7, 1, 8), 'b', ('Store',)), ('Name', (1, 12, 1, 13), 'c', ('Load',)), [('Name', (1, 17, 1, 18), 'd', ('Load',))], 0)])), ++('Expression', ('ListComp', (1, 0, 1, 20), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'c', ('Load',)), [], 0)])), ++('Expression', ('ListComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ++('Expression', ('ListComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ++('Expression', ('SetComp', (1, 0, 1, 20), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'c', ('Load',)), [], 0)])), ++('Expression', ('SetComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ++('Expression', ('SetComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ++('Expression', ('GeneratorExp', (1, 0, 1, 20), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'c', ('Load',)), [], 0)])), ++('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ++('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ++('Expression', ('Compare', (1, 0, 1, 9), ('Constant', (1, 0, 1, 1), 1, None), [('Lt',), ('Lt',)], [('Constant', (1, 4, 1, 5), 2, None), ('Constant', (1, 8, 1, 9), 3, None)])), ++('Expression', ('Call', (1, 0, 1, 17), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Constant', (1, 2, 1, 3), 1, None), ('Constant', (1, 4, 1, 5), 2, None), ('Starred', (1, 10, 1, 12), ('Name', (1, 11, 1, 12), 'd', ('Load',)), ('Load',))], [('keyword', (1, 6, 1, 9), 'c', ('Constant', (1, 8, 1, 9), 3, None)), ('keyword', (1, 13, 1, 16), None, ('Name', (1, 15, 1, 16), 'e', ('Load',)))])), ++('Expression', ('Call', (1, 0, 1, 10), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Starred', (1, 2, 1, 9), ('List', (1, 3, 1, 9), [('Constant', (1, 4, 1, 5), 0, None), ('Constant', (1, 7, 1, 8), 1, None)], ('Load',)), ('Load',))], [])), ++('Expression', ('Call', (1, 0, 1, 15), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('GeneratorExp', (1, 1, 1, 15), ('Name', (1, 2, 1, 3), 'a', ('Load',)), [('comprehension', ('Name', (1, 8, 1, 9), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Load',)), [], 0)])], [])), ++('Expression', ('Constant', (1, 0, 1, 2), 10, None)), ++('Expression', ('Constant', (1, 0, 1, 8), 'string', None)), ++('Expression', ('Attribute', (1, 0, 1, 3), ('Name', (1, 0, 1, 1), 'a', ('Load',)), 'b', ('Load',))), ++('Expression', ('Subscript', (1, 0, 1, 6), ('Name', (1, 0, 1, 1), 'a', ('Load',)), ('Slice', (1, 2, 1, 5), ('Name', (1, 2, 1, 3), 'b', ('Load',)), ('Name', (1, 4, 1, 5), 'c', ('Load',)), None), ('Load',))), ++('Expression', ('Name', (1, 0, 1, 1), 'v', ('Load',))), ++('Expression', ('List', (1, 0, 1, 7), [('Constant', (1, 1, 1, 2), 1, None), ('Constant', (1, 3, 1, 4), 2, None), ('Constant', (1, 5, 1, 6), 3, None)], ('Load',))), ++('Expression', ('List', (1, 0, 1, 2), [], ('Load',))), ++('Expression', ('Tuple', (1, 0, 1, 5), [('Constant', (1, 0, 1, 1), 1, None), ('Constant', (1, 2, 1, 3), 2, None), ('Constant', (1, 4, 1, 5), 3, None)], ('Load',))), ++('Expression', ('Tuple', (1, 0, 1, 7), [('Constant', (1, 1, 1, 2), 1, None), ('Constant', (1, 3, 1, 4), 2, None), ('Constant', (1, 5, 1, 6), 3, None)], ('Load',))), ++('Expression', ('Tuple', (1, 0, 1, 2), [], ('Load',))), ++('Expression', ('Call', (1, 0, 1, 17), ('Attribute', (1, 0, 1, 7), ('Attribute', (1, 0, 1, 5), ('Attribute', (1, 0, 1, 3), ('Name', (1, 0, 1, 1), 'a', ('Load',)), 'b', ('Load',)), 'c', ('Load',)), 'd', ('Load',)), [('Subscript', (1, 8, 1, 16), ('Attribute', (1, 8, 1, 11), ('Name', (1, 8, 1, 9), 'a', ('Load',)), 'b', ('Load',)), ('Slice', (1, 12, 1, 15), ('Constant', (1, 12, 1, 13), 1, None), ('Constant', (1, 14, 1, 15), 2, None), None), ('Load',))], [])), + ] + main() +diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst b/Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst +new file mode 100644 +index 0000000000..6b58f89247 +--- /dev/null ++++ b/Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst +@@ -0,0 +1,2 @@ ++Preserve AST nodes for f-string with single-element format specifiers. Patch ++by Pablo Galindo +diff --git a/Parser/action_helpers.c b/Parser/action_helpers.c +index 1354ef7505..34f744516c 100644 +--- a/Parser/action_helpers.c ++++ b/Parser/action_helpers.c +@@ -1002,7 +1002,8 @@ _PyPegen_setup_full_format_spec(Parser *p, Token *colon, asdl_expr_seq *spec, in + spec = resized_spec; + } + expr_ty res; +- if (asdl_seq_LEN(spec) == 0) { ++ Py_ssize_t n = asdl_seq_LEN(spec); ++ if (n == 0 || (n == 1 && asdl_seq_GET(spec, 0)->kind == Constant_kind)) { + res = _PyAST_JoinedStr(spec, lineno, col_offset, end_lineno, + end_col_offset, p->arena); + } else { diff --git a/python3.13.spec b/python3.13.spec index 29d448d..5567126 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel b4 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -403,6 +403,10 @@ Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencil # From https://github.com/python/cpython/pull/122017 Patch432: 00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch +# 00433 # 1c8b255f8c5430714b6860058880529a95a6bae7 +# Preserve AST nodes for format specifiers with single elements +Patch433: 00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1744,6 +1748,10 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Jul 30 2024 Miro Hrončok - 3.13.0~b4-3 +- Preserve AST nodes for f-string with single-element format specifiers +- Fixes https://github.com/python/cpython/issues/122300 + * Tue Jul 23 2024 Miro Hrončok - 3.13.0~b4-2 - Explicitly BuildRequire systemtap-sdt-devel https://fedoraproject.org/wiki/Changes/Separate_dtrace_package From 5ff1fff3e0a5580207c01ca134696c17db183351 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 1 Aug 2024 12:28:33 +0200 Subject: [PATCH 042/115] Update to Python 3.13.0rc1 --- 00251-change-user-install-location.patch | 4 +- ...-in-test_sysconfig-test_user_similar.patch | 30 - ...rmat-specifiers-with-single-elements.patch | 3177 ----------------- python3.13.spec | 17 +- sources | 4 +- 5 files changed, 9 insertions(+), 3223 deletions(-) delete mode 100644 00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch delete mode 100644 00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 9edee00..df3baea 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -51,7 +51,7 @@ index 0a0dc47b17..bb42e1cf5a 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 83e057c177..8b167dca31 100644 +index 80aef34471..4e4ea6aeea 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -130,7 +130,7 @@ index 83e057c177..8b167dca31 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 37cee92768..ffb63452be 100644 +index 1ade49281b..e21ca34733 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -121,8 +121,19 @@ def test_get_path(self): diff --git a/00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch b/00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch deleted file mode 100644 index b023c47..0000000 --- a/00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Fri, 19 Jul 2024 11:20:27 +0200 -Subject: [PATCH] 00432: Account with abi_thread in - test_sysconfig.test_user_similar - -From https://github.com/python/cpython/pull/122017 ---- - Lib/test/test_sysconfig.py | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index ffb63452be..43cab7ba21 100644 ---- a/Lib/test/test_sysconfig.py -+++ b/Lib/test/test_sysconfig.py -@@ -428,10 +428,10 @@ def test_user_similar(self): - # bpo-44860: platlib of posix_user doesn't use sys.platlibdir, - # whereas posix_prefix does. - if name == 'platlib': -- # Replace "/lib64/python3.11/site-packages" suffix -- # with "/lib/python3.11/site-packages". -- py_version_short = sysconfig.get_python_version() -- suffix = f'python{py_version_short}/site-packages' -+ # Replace "/lib64/python3.11{abi_thread}/site-packages" suffix -+ # with "/lib/python3.11{abi_thread}/site-packages". -+ py_version_abi = sysconfig._get_python_version_abi() -+ suffix = f'python{py_version_abi}/site-packages' - expected = expected.replace(f'/{sys.platlibdir}/{suffix}', - f'/lib/{suffix}') - self.assertEqual(user_path, expected) diff --git a/00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch b/00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch deleted file mode 100644 index 34d301d..0000000 --- a/00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch +++ /dev/null @@ -1,3177 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Pablo Galindo Salgado -Date: Sat, 27 Jul 2024 20:27:01 +0100 -Subject: [PATCH] 00433: Preserve AST nodes for format specifiers with single - elements - -(cherry picked from commit db2d8b6db1b56c2bd3802b86f9b76da33e8898d7) ---- - Doc/library/ast.rst | 4 +- - Lib/test/test_ast.py | 3111 +---------------- - ...-07-26-14-05-51.gh-issue-122300.SVIF-l.rst | 2 + - Parser/action_helpers.c | 3 +- - 4 files changed, 138 insertions(+), 2982 deletions(-) - create mode 100644 Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst - -diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst -index 727d44df0c..c5daa6e243 100644 ---- a/Doc/library/ast.rst -+++ b/Doc/library/ast.rst -@@ -316,7 +316,9 @@ Literals - args=[ - Name(id='a', ctx=Load())]), - conversion=-1, -- format_spec=Constant(value='.3'))])) -+ format_spec=JoinedStr( -+ values=[ -+ Constant(value='.3')]))])) - - - .. class:: List(elts, ctx) -diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py -index e3383355d3..99666ba100 100644 ---- a/Lib/test/test_ast.py -+++ b/Lib/test/test_ast.py -@@ -3461,2989 +3461,140 @@ def main(): - - #### EVERYTHING BELOW IS GENERATED BY python Lib/test/test_ast.py -g ##### - exec_results = [ -- ("Module", [("Expr", (1, 0, 1, 4), ("Constant", (1, 0, 1, 4), None, None))], []), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 18), -- ("Constant", (1, 0, 1, 18), "module docstring", None), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 13), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 9, 1, 13))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 29), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [ -- ( -- "Expr", -- (1, 9, 1, 29), -- ("Constant", (1, 9, 1, 29), "function docstring", None), -- ) -- ], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 14), -- "f", -- ( -- "arguments", -- [], -- [("arg", (1, 6, 1, 7), "a", None, None)], -- None, -- [], -- [], -- None, -- [], -- ), -- [("Pass", (1, 10, 1, 14))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 16), -- "f", -- ( -- "arguments", -- [], -- [("arg", (1, 6, 1, 7), "a", None, None)], -- None, -- [], -- [], -- None, -- [("Constant", (1, 8, 1, 9), 0, None)], -- ), -- [("Pass", (1, 12, 1, 16))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 18), -- "f", -- ( -- "arguments", -- [], -- [], -- ("arg", (1, 7, 1, 11), "args", None, None), -- [], -- [], -- None, -- [], -- ), -- [("Pass", (1, 14, 1, 18))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 23), -- "f", -- ( -- "arguments", -- [], -- [], -- ( -- "arg", -- (1, 7, 1, 16), -- "args", -- ( -- "Starred", -- (1, 13, 1, 16), -- ("Name", (1, 14, 1, 16), "Ts", ("Load",)), -- ("Load",), -- ), -- None, -- ), -- [], -- [], -- None, -- [], -- ), -- [("Pass", (1, 19, 1, 23))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 36), -- "f", -- ( -- "arguments", -- [], -- [], -- ( -- "arg", -- (1, 7, 1, 29), -- "args", -- ( -- "Starred", -- (1, 13, 1, 29), -- ( -- "Subscript", -- (1, 14, 1, 29), -- ("Name", (1, 14, 1, 19), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 20, 1, 28), -- [ -- ("Name", (1, 20, 1, 23), "int", ("Load",)), -- ("Constant", (1, 25, 1, 28), Ellipsis, None), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- ), -- [], -- [], -- None, -- [], -- ), -- [("Pass", (1, 32, 1, 36))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 36), -- "f", -- ( -- "arguments", -- [], -- [], -- ( -- "arg", -- (1, 7, 1, 29), -- "args", -- ( -- "Starred", -- (1, 13, 1, 29), -- ( -- "Subscript", -- (1, 14, 1, 29), -- ("Name", (1, 14, 1, 19), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 20, 1, 28), -- [ -- ("Name", (1, 20, 1, 23), "int", ("Load",)), -- ( -- "Starred", -- (1, 25, 1, 28), -- ("Name", (1, 26, 1, 28), "Ts", ("Load",)), -- ("Load",), -- ), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- ), -- [], -- [], -- None, -- [], -- ), -- [("Pass", (1, 32, 1, 36))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 21), -- "f", -- ( -- "arguments", -- [], -- [], -- None, -- [], -- [], -- ("arg", (1, 8, 1, 14), "kwargs", None, None), -- [], -- ), -- [("Pass", (1, 17, 1, 21))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 71), -- "f", -- ( -- "arguments", -- [], -- [ -- ("arg", (1, 6, 1, 7), "a", None, None), -- ("arg", (1, 9, 1, 10), "b", None, None), -- ("arg", (1, 14, 1, 15), "c", None, None), -- ("arg", (1, 22, 1, 23), "d", None, None), -- ("arg", (1, 28, 1, 29), "e", None, None), -- ], -- ("arg", (1, 35, 1, 39), "args", None, None), -- [("arg", (1, 41, 1, 42), "f", None, None)], -- [("Constant", (1, 43, 1, 45), 42, None)], -- ("arg", (1, 49, 1, 55), "kwargs", None, None), -- [ -- ("Constant", (1, 11, 1, 12), 1, None), -- ("Constant", (1, 16, 1, 20), None, None), -- ("List", (1, 24, 1, 26), [], ("Load",)), -- ("Dict", (1, 30, 1, 32), [], []), -- ], -- ), -- [ -- ( -- "Expr", -- (1, 58, 1, 71), -- ("Constant", (1, 58, 1, 71), "doc for f()", None), -- ) -- ], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 27), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 23, 1, 27))], -- [], -- ( -- "Subscript", -- (1, 11, 1, 21), -- ("Name", (1, 11, 1, 16), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 17, 1, 20), -- [ -- ( -- "Starred", -- (1, 17, 1, 20), -- ("Name", (1, 18, 1, 20), "Ts", ("Load",)), -- ("Load",), -- ) -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 32), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 28, 1, 32))], -- [], -- ( -- "Subscript", -- (1, 11, 1, 26), -- ("Name", (1, 11, 1, 16), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 17, 1, 25), -- [ -- ("Name", (1, 17, 1, 20), "int", ("Load",)), -- ( -- "Starred", -- (1, 22, 1, 25), -- ("Name", (1, 23, 1, 25), "Ts", ("Load",)), -- ("Load",), -- ), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 45), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 41, 1, 45))], -- [], -- ( -- "Subscript", -- (1, 11, 1, 39), -- ("Name", (1, 11, 1, 16), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 17, 1, 38), -- [ -- ("Name", (1, 17, 1, 20), "int", ("Load",)), -- ( -- "Starred", -- (1, 22, 1, 38), -- ( -- "Subscript", -- (1, 23, 1, 38), -- ("Name", (1, 23, 1, 28), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 29, 1, 37), -- [ -- ("Name", (1, 29, 1, 32), "int", ("Load",)), -- ( -- "Constant", -- (1, 34, 1, 37), -- Ellipsis, -- None, -- ), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- ("Load",), -- ), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [("ClassDef", (1, 0, 1, 12), "C", [], [], [("Pass", (1, 8, 1, 12))], [], [])], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (1, 0, 1, 32), -- "C", -- [], -- [], -- [ -- ( -- "Expr", -- (1, 9, 1, 32), -- ("Constant", (1, 9, 1, 32), "docstring for class C", None), -- ) -- ], -- [], -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (1, 0, 1, 21), -- "C", -- [("Name", (1, 8, 1, 14), "object", ("Load",))], -- [], -- [("Pass", (1, 17, 1, 21))], -- [], -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 16), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Return", (1, 8, 1, 16), ("Constant", (1, 15, 1, 16), 1, None))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ("Module", [("Delete", (1, 0, 1, 5), [("Name", (1, 4, 1, 5), "v", ("Del",))])], []), -- ( -- "Module", -- [ -- ( -- "Assign", -- (1, 0, 1, 5), -- [("Name", (1, 0, 1, 1), "v", ("Store",))], -- ("Constant", (1, 4, 1, 5), 1, None), -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Assign", -- (1, 0, 1, 7), -- [ -- ( -- "Tuple", -- (1, 0, 1, 3), -- [ -- ("Name", (1, 0, 1, 1), "a", ("Store",)), -- ("Name", (1, 2, 1, 3), "b", ("Store",)), -- ], -- ("Store",), -- ) -- ], -- ("Name", (1, 6, 1, 7), "c", ("Load",)), -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Assign", -- (1, 0, 1, 9), -- [ -- ( -- "Tuple", -- (1, 0, 1, 5), -- [ -- ("Name", (1, 1, 1, 2), "a", ("Store",)), -- ("Name", (1, 3, 1, 4), "b", ("Store",)), -- ], -- ("Store",), -- ) -- ], -- ("Name", (1, 8, 1, 9), "c", ("Load",)), -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Assign", -- (1, 0, 1, 9), -- [ -- ( -- "List", -- (1, 0, 1, 5), -- [ -- ("Name", (1, 1, 1, 2), "a", ("Store",)), -- ("Name", (1, 3, 1, 4), "b", ("Store",)), -- ], -- ("Store",), -- ) -- ], -- ("Name", (1, 8, 1, 9), "c", ("Load",)), -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AnnAssign", -- (1, 0, 1, 13), -- ("Name", (1, 0, 1, 1), "x", ("Store",)), -- ( -- "Subscript", -- (1, 3, 1, 13), -- ("Name", (1, 3, 1, 8), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 9, 1, 12), -- [ -- ( -- "Starred", -- (1, 9, 1, 12), -- ("Name", (1, 10, 1, 12), "Ts", ("Load",)), -- ("Load",), -- ) -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- 1, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AnnAssign", -- (1, 0, 1, 18), -- ("Name", (1, 0, 1, 1), "x", ("Store",)), -- ( -- "Subscript", -- (1, 3, 1, 18), -- ("Name", (1, 3, 1, 8), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 9, 1, 17), -- [ -- ("Name", (1, 9, 1, 12), "int", ("Load",)), -- ( -- "Starred", -- (1, 14, 1, 17), -- ("Name", (1, 15, 1, 17), "Ts", ("Load",)), -- ("Load",), -- ), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- 1, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AnnAssign", -- (1, 0, 1, 31), -- ("Name", (1, 0, 1, 1), "x", ("Store",)), -- ( -- "Subscript", -- (1, 3, 1, 31), -- ("Name", (1, 3, 1, 8), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 9, 1, 30), -- [ -- ("Name", (1, 9, 1, 12), "int", ("Load",)), -- ( -- "Starred", -- (1, 14, 1, 30), -- ( -- "Subscript", -- (1, 15, 1, 30), -- ("Name", (1, 15, 1, 20), "tuple", ("Load",)), -- ( -- "Tuple", -- (1, 21, 1, 29), -- [ -- ("Name", (1, 21, 1, 24), "str", ("Load",)), -- ( -- "Constant", -- (1, 26, 1, 29), -- Ellipsis, -- None, -- ), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- ("Load",), -- ), -- ], -- ("Load",), -- ), -- ("Load",), -- ), -- None, -- 1, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AugAssign", -- (1, 0, 1, 6), -- ("Name", (1, 0, 1, 1), "v", ("Store",)), -- ("Add",), -- ("Constant", (1, 5, 1, 6), 1, None), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "For", -- (1, 0, 1, 15), -- ("Name", (1, 4, 1, 5), "v", ("Store",)), -- ("Name", (1, 9, 1, 10), "v", ("Load",)), -- [("Pass", (1, 11, 1, 15))], -- [], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "While", -- (1, 0, 1, 12), -- ("Name", (1, 6, 1, 7), "v", ("Load",)), -- [("Pass", (1, 8, 1, 12))], -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "If", -- (1, 0, 1, 9), -- ("Name", (1, 3, 1, 4), "v", ("Load",)), -- [("Pass", (1, 5, 1, 9))], -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "If", -- (1, 0, 4, 6), -- ("Name", (1, 3, 1, 4), "a", ("Load",)), -- [("Pass", (2, 2, 2, 6))], -- [ -- ( -- "If", -- (3, 0, 4, 6), -- ("Name", (3, 5, 3, 6), "b", ("Load",)), -- [("Pass", (4, 2, 4, 6))], -- [], -- ) -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "If", -- (1, 0, 6, 6), -- ("Name", (1, 3, 1, 4), "a", ("Load",)), -- [("Pass", (2, 2, 2, 6))], -- [ -- ( -- "If", -- (3, 0, 6, 6), -- ("Name", (3, 5, 3, 6), "b", ("Load",)), -- [("Pass", (4, 2, 4, 6))], -- [("Pass", (6, 2, 6, 6))], -- ) -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "With", -- (1, 0, 1, 17), -- [ -- ( -- "withitem", -- ("Name", (1, 5, 1, 6), "x", ("Load",)), -- ("Name", (1, 10, 1, 11), "y", ("Store",)), -- ) -- ], -- [("Pass", (1, 13, 1, 17))], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "With", -- (1, 0, 1, 25), -- [ -- ( -- "withitem", -- ("Name", (1, 5, 1, 6), "x", ("Load",)), -- ("Name", (1, 10, 1, 11), "y", ("Store",)), -- ), -- ( -- "withitem", -- ("Name", (1, 13, 1, 14), "z", ("Load",)), -- ("Name", (1, 18, 1, 19), "q", ("Store",)), -- ), -- ], -- [("Pass", (1, 21, 1, 25))], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "With", -- (1, 0, 1, 19), -- [ -- ( -- "withitem", -- ("Name", (1, 6, 1, 7), "x", ("Load",)), -- ("Name", (1, 11, 1, 12), "y", ("Store",)), -- ) -- ], -- [("Pass", (1, 15, 1, 19))], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "With", -- (1, 0, 1, 17), -- [ -- ("withitem", ("Name", (1, 6, 1, 7), "x", ("Load",)), None), -- ("withitem", ("Name", (1, 9, 1, 10), "y", ("Load",)), None), -- ], -- [("Pass", (1, 13, 1, 17))], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Raise", -- (1, 0, 1, 25), -- ( -- "Call", -- (1, 6, 1, 25), -- ("Name", (1, 6, 1, 15), "Exception", ("Load",)), -- [("Constant", (1, 16, 1, 24), "string", None)], -- [], -- ), -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Try", -- (1, 0, 4, 6), -- [("Pass", (2, 2, 2, 6))], -- [ -- ( -- "ExceptHandler", -- (3, 0, 4, 6), -- ("Name", (3, 7, 3, 16), "Exception", ("Load",)), -- None, -- [("Pass", (4, 2, 4, 6))], -- ) -- ], -- [], -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Try", -- (1, 0, 4, 6), -- [("Pass", (2, 2, 2, 6))], -- [], -- [], -- [("Pass", (4, 2, 4, 6))], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "TryStar", -- (1, 0, 4, 6), -- [("Pass", (2, 2, 2, 6))], -- [ -- ( -- "ExceptHandler", -- (3, 0, 4, 6), -- ("Name", (3, 8, 3, 17), "Exception", ("Load",)), -- None, -- [("Pass", (4, 2, 4, 6))], -- ) -- ], -- [], -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [("Assert", (1, 0, 1, 8), ("Name", (1, 7, 1, 8), "v", ("Load",)), None)], -- [], -- ), -- ( -- "Module", -- [("Import", (1, 0, 1, 10), [("alias", (1, 7, 1, 10), "sys", None)])], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ImportFrom", -- (1, 0, 1, 17), -- "sys", -- [("alias", (1, 16, 1, 17), "v", None)], -- 0, -- ) -- ], -- [], -- ), -- ("Module", [("Global", (1, 0, 1, 8), ["v"])], []), -- ("Module", [("Expr", (1, 0, 1, 1), ("Constant", (1, 0, 1, 1), 1, None))], []), -- ("Module", [("Pass", (1, 0, 1, 4))], []), -- ( -- "Module", -- [ -- ( -- "For", -- (1, 0, 1, 16), -- ("Name", (1, 4, 1, 5), "v", ("Store",)), -- ("Name", (1, 9, 1, 10), "v", ("Load",)), -- [("Break", (1, 11, 1, 16))], -- [], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "For", -- (1, 0, 1, 19), -- ("Name", (1, 4, 1, 5), "v", ("Store",)), -- ("Name", (1, 9, 1, 10), "v", ("Load",)), -- [("Continue", (1, 11, 1, 19))], -- [], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "For", -- (1, 0, 1, 18), -- ( -- "Tuple", -- (1, 4, 1, 7), -- [ -- ("Name", (1, 4, 1, 5), "a", ("Store",)), -- ("Name", (1, 6, 1, 7), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 11, 1, 12), "c", ("Load",)), -- [("Pass", (1, 14, 1, 18))], -- [], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "For", -- (1, 0, 1, 20), -- ( -- "Tuple", -- (1, 4, 1, 9), -- [ -- ("Name", (1, 5, 1, 6), "a", ("Store",)), -- ("Name", (1, 7, 1, 8), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 13, 1, 14), "c", ("Load",)), -- [("Pass", (1, 16, 1, 20))], -- [], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "For", -- (1, 0, 1, 20), -- ( -- "List", -- (1, 4, 1, 9), -- [ -- ("Name", (1, 5, 1, 6), "a", ("Store",)), -- ("Name", (1, 7, 1, 8), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 13, 1, 14), "c", ("Load",)), -- [("Pass", (1, 16, 1, 20))], -- [], -- None, -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 11, 5), -- ( -- "GeneratorExp", -- (1, 0, 11, 5), -- ( -- "Tuple", -- (2, 4, 6, 5), -- [ -- ("Name", (3, 4, 3, 6), "Aa", ("Load",)), -- ("Name", (5, 7, 5, 9), "Bb", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (8, 4, 10, 6), -- [ -- ("Name", (8, 4, 8, 6), "Aa", ("Store",)), -- ("Name", (10, 4, 10, 6), "Bb", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (10, 10, 10, 12), "Cc", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 34), -- ( -- "DictComp", -- (1, 0, 1, 34), -- ("Name", (1, 1, 1, 2), "a", ("Load",)), -- ("Name", (1, 5, 1, 6), "b", ("Load",)), -- [ -- ( -- "comprehension", -- ("Name", (1, 11, 1, 12), "w", ("Store",)), -- ("Name", (1, 16, 1, 17), "x", ("Load",)), -- [], -- 0, -- ), -- ( -- "comprehension", -- ("Name", (1, 22, 1, 23), "m", ("Store",)), -- ("Name", (1, 27, 1, 28), "p", ("Load",)), -- [("Name", (1, 32, 1, 33), "g", ("Load",))], -- 0, -- ), -- ], -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 20), -- ( -- "DictComp", -- (1, 0, 1, 20), -- ("Name", (1, 1, 1, 2), "a", ("Load",)), -- ("Name", (1, 5, 1, 6), "b", ("Load",)), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 11, 1, 14), -- [ -- ("Name", (1, 11, 1, 12), "v", ("Store",)), -- ("Name", (1, 13, 1, 14), "w", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 18, 1, 19), "x", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 19), -- ( -- "SetComp", -- (1, 0, 1, 19), -- ("Name", (1, 1, 1, 2), "r", ("Load",)), -- [ -- ( -- "comprehension", -- ("Name", (1, 7, 1, 8), "l", ("Store",)), -- ("Name", (1, 12, 1, 13), "x", ("Load",)), -- [("Name", (1, 17, 1, 18), "g", ("Load",))], -- 0, -- ) -- ], -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 16), -- ( -- "SetComp", -- (1, 0, 1, 16), -- ("Name", (1, 1, 1, 2), "r", ("Load",)), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 7, 1, 10), -- [ -- ("Name", (1, 7, 1, 8), "l", ("Store",)), -- ("Name", (1, 9, 1, 10), "m", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 14, 1, 15), "x", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AsyncFunctionDef", -- (1, 0, 3, 18), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [ -- ( -- "Expr", -- (2, 1, 2, 17), -- ("Constant", (2, 1, 2, 17), "async function", None), -- ), -- ( -- "Expr", -- (3, 1, 3, 18), -- ( -- "Await", -- (3, 1, 3, 18), -- ( -- "Call", -- (3, 7, 3, 18), -- ("Name", (3, 7, 3, 16), "something", ("Load",)), -- [], -- [], -- ), -- ), -- ), -- ], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AsyncFunctionDef", -- (1, 0, 3, 8), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [ -- ( -- "AsyncFor", -- (2, 1, 3, 8), -- ("Name", (2, 11, 2, 12), "e", ("Store",)), -- ("Name", (2, 16, 2, 17), "i", ("Load",)), -- [ -- ( -- "Expr", -- (2, 19, 2, 20), -- ("Constant", (2, 19, 2, 20), 1, None), -- ) -- ], -- [("Expr", (3, 7, 3, 8), ("Constant", (3, 7, 3, 8), 2, None))], -- None, -- ) -- ], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AsyncFunctionDef", -- (1, 0, 2, 21), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [ -- ( -- "AsyncWith", -- (2, 1, 2, 21), -- [ -- ( -- "withitem", -- ("Name", (2, 12, 2, 13), "a", ("Load",)), -- ("Name", (2, 17, 2, 18), "b", ("Store",)), -- ) -- ], -- [ -- ( -- "Expr", -- (2, 20, 2, 21), -- ("Constant", (2, 20, 2, 21), 1, None), -- ) -- ], -- None, -- ) -- ], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 14), -- ( -- "Dict", -- (1, 0, 1, 14), -- [None, ("Constant", (1, 10, 1, 11), 2, None)], -- [ -- ( -- "Dict", -- (1, 3, 1, 8), -- [("Constant", (1, 4, 1, 5), 1, None)], -- [("Constant", (1, 6, 1, 7), 2, None)], -- ), -- ("Constant", (1, 12, 1, 13), 3, None), -- ], -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 12), -- ( -- "Set", -- (1, 0, 1, 12), -- [ -- ( -- "Starred", -- (1, 1, 1, 8), -- ( -- "Set", -- (1, 2, 1, 8), -- [ -- ("Constant", (1, 3, 1, 4), 1, None), -- ("Constant", (1, 6, 1, 7), 2, None), -- ], -- ), -- ("Load",), -- ), -- ("Constant", (1, 10, 1, 11), 3, None), -- ], -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AsyncFunctionDef", -- (1, 0, 2, 21), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [ -- ( -- "Expr", -- (2, 1, 2, 21), -- ( -- "ListComp", -- (2, 1, 2, 21), -- ("Name", (2, 2, 2, 3), "i", ("Load",)), -- [ -- ( -- "comprehension", -- ("Name", (2, 14, 2, 15), "b", ("Store",)), -- ("Name", (2, 19, 2, 20), "c", ("Load",)), -- [], -- 1, -- ) -- ], -- ), -- ) -- ], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (4, 0, 4, 13), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (4, 9, 4, 13))], -- [ -- ("Name", (1, 1, 1, 6), "deco1", ("Load",)), -- ( -- "Call", -- (2, 1, 2, 8), -- ("Name", (2, 1, 2, 6), "deco2", ("Load",)), -- [], -- [], -- ), -- ( -- "Call", -- (3, 1, 3, 9), -- ("Name", (3, 1, 3, 6), "deco3", ("Load",)), -- [("Constant", (3, 7, 3, 8), 1, None)], -- [], -- ), -- ], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "AsyncFunctionDef", -- (4, 0, 4, 19), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (4, 15, 4, 19))], -- [ -- ("Name", (1, 1, 1, 6), "deco1", ("Load",)), -- ( -- "Call", -- (2, 1, 2, 8), -- ("Name", (2, 1, 2, 6), "deco2", ("Load",)), -- [], -- [], -- ), -- ( -- "Call", -- (3, 1, 3, 9), -- ("Name", (3, 1, 3, 6), "deco3", ("Load",)), -- [("Constant", (3, 7, 3, 8), 1, None)], -- [], -- ), -- ], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (4, 0, 4, 13), -- "C", -- [], -- [], -- [("Pass", (4, 9, 4, 13))], -- [ -- ("Name", (1, 1, 1, 6), "deco1", ("Load",)), -- ( -- "Call", -- (2, 1, 2, 8), -- ("Name", (2, 1, 2, 6), "deco2", ("Load",)), -- [], -- [], -- ), -- ( -- "Call", -- (3, 1, 3, 9), -- ("Name", (3, 1, 3, 6), "deco3", ("Load",)), -- [("Constant", (3, 7, 3, 8), 1, None)], -- [], -- ), -- ], -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (2, 0, 2, 13), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (2, 9, 2, 13))], -- [ -- ( -- "Call", -- (1, 1, 1, 19), -- ("Name", (1, 1, 1, 5), "deco", ("Load",)), -- [ -- ( -- "GeneratorExp", -- (1, 5, 1, 19), -- ("Name", (1, 6, 1, 7), "a", ("Load",)), -- [ -- ( -- "comprehension", -- ("Name", (1, 12, 1, 13), "a", ("Store",)), -- ("Name", (1, 17, 1, 18), "b", ("Load",)), -- [], -- 0, -- ) -- ], -- ) -- ], -- [], -- ) -- ], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (2, 0, 2, 13), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (2, 9, 2, 13))], -- [ -- ( -- "Attribute", -- (1, 1, 1, 6), -- ( -- "Attribute", -- (1, 1, 1, 4), -- ("Name", (1, 1, 1, 2), "a", ("Load",)), -- "b", -- ("Load",), -- ), -- "c", -- ("Load",), -- ) -- ], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "Expr", -- (1, 0, 1, 8), -- ( -- "NamedExpr", -- (1, 1, 1, 7), -- ("Name", (1, 1, 1, 2), "a", ("Store",)), -- ("Constant", (1, 6, 1, 7), 1, None), -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 18), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [], -- None, -- [], -- [], -- None, -- [], -- ), -- [("Pass", (1, 14, 1, 18))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 26), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [ -- ("arg", (1, 12, 1, 13), "c", None, None), -- ("arg", (1, 15, 1, 16), "d", None, None), -- ("arg", (1, 18, 1, 19), "e", None, None), -- ], -- None, -- [], -- [], -- None, -- [], -- ), -- [("Pass", (1, 22, 1, 26))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 29), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [("arg", (1, 12, 1, 13), "c", None, None)], -- None, -- [ -- ("arg", (1, 18, 1, 19), "d", None, None), -- ("arg", (1, 21, 1, 22), "e", None, None), -- ], -- [None, None], -- None, -- [], -- ), -- [("Pass", (1, 25, 1, 29))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 39), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [("arg", (1, 12, 1, 13), "c", None, None)], -- None, -- [ -- ("arg", (1, 18, 1, 19), "d", None, None), -- ("arg", (1, 21, 1, 22), "e", None, None), -- ], -- [None, None], -- ("arg", (1, 26, 1, 32), "kwargs", None, None), -- [], -- ), -- [("Pass", (1, 35, 1, 39))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 20), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [], -- None, -- [], -- [], -- None, -- [("Constant", (1, 8, 1, 9), 1, None)], -- ), -- [("Pass", (1, 16, 1, 20))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 29), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [ -- ("arg", (1, 14, 1, 15), "b", None, None), -- ("arg", (1, 19, 1, 20), "c", None, None), -- ], -- None, -- [], -- [], -- None, -- [ -- ("Constant", (1, 8, 1, 9), 1, None), -- ("Constant", (1, 16, 1, 17), 2, None), -- ("Constant", (1, 21, 1, 22), 4, None), -- ], -- ), -- [("Pass", (1, 25, 1, 29))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 32), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [("arg", (1, 14, 1, 15), "b", None, None)], -- None, -- [("arg", (1, 22, 1, 23), "c", None, None)], -- [("Constant", (1, 24, 1, 25), 4, None)], -- None, -- [ -- ("Constant", (1, 8, 1, 9), 1, None), -- ("Constant", (1, 16, 1, 17), 2, None), -- ], -- ), -- [("Pass", (1, 28, 1, 32))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 30), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [("arg", (1, 14, 1, 15), "b", None, None)], -- None, -- [("arg", (1, 22, 1, 23), "c", None, None)], -- [None], -- None, -- [ -- ("Constant", (1, 8, 1, 9), 1, None), -- ("Constant", (1, 16, 1, 17), 2, None), -- ], -- ), -- [("Pass", (1, 26, 1, 30))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 42), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [("arg", (1, 14, 1, 15), "b", None, None)], -- None, -- [("arg", (1, 22, 1, 23), "c", None, None)], -- [("Constant", (1, 24, 1, 25), 4, None)], -- ("arg", (1, 29, 1, 35), "kwargs", None, None), -- [ -- ("Constant", (1, 8, 1, 9), 1, None), -- ("Constant", (1, 16, 1, 17), 2, None), -- ], -- ), -- [("Pass", (1, 38, 1, 42))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 40), -- "f", -- ( -- "arguments", -- [("arg", (1, 6, 1, 7), "a", None, None)], -- [("arg", (1, 14, 1, 15), "b", None, None)], -- None, -- [("arg", (1, 22, 1, 23), "c", None, None)], -- [None], -- ("arg", (1, 27, 1, 33), "kwargs", None, None), -- [ -- ("Constant", (1, 8, 1, 9), 1, None), -- ("Constant", (1, 16, 1, 17), 2, None), -- ], -- ), -- [("Pass", (1, 36, 1, 40))], -- [], -- None, -- None, -- [], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "TypeAlias", -- (1, 0, 1, 12), -- ("Name", (1, 5, 1, 6), "X", ("Store",)), -- [], -- ("Name", (1, 9, 1, 12), "int", ("Load",)), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "TypeAlias", -- (1, 0, 1, 15), -- ("Name", (1, 5, 1, 6), "X", ("Store",)), -- [("TypeVar", (1, 7, 1, 8), "T", None, None)], -- ("Name", (1, 12, 1, 15), "int", ("Load",)), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "TypeAlias", -- (1, 0, 1, 32), -- ("Name", (1, 5, 1, 6), "X", ("Store",)), -- [ -- ("TypeVar", (1, 7, 1, 8), "T", None, None), -- ("TypeVarTuple", (1, 10, 1, 13), "Ts", None), -- ("ParamSpec", (1, 15, 1, 18), "P", None), -- ], -- ( -- "Tuple", -- (1, 22, 1, 32), -- [ -- ("Name", (1, 23, 1, 24), "T", ("Load",)), -- ("Name", (1, 26, 1, 28), "Ts", ("Load",)), -- ("Name", (1, 30, 1, 31), "P", ("Load",)), -- ], -- ("Load",), -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "TypeAlias", -- (1, 0, 1, 37), -- ("Name", (1, 5, 1, 6), "X", ("Store",)), -- [ -- ( -- "TypeVar", -- (1, 7, 1, 13), -- "T", -- ("Name", (1, 10, 1, 13), "int", ("Load",)), -- None, -- ), -- ("TypeVarTuple", (1, 15, 1, 18), "Ts", None), -- ("ParamSpec", (1, 20, 1, 23), "P", None), -- ], -- ( -- "Tuple", -- (1, 27, 1, 37), -- [ -- ("Name", (1, 28, 1, 29), "T", ("Load",)), -- ("Name", (1, 31, 1, 33), "Ts", ("Load",)), -- ("Name", (1, 35, 1, 36), "P", ("Load",)), -- ], -- ("Load",), -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "TypeAlias", -- (1, 0, 1, 44), -- ("Name", (1, 5, 1, 6), "X", ("Store",)), -- [ -- ( -- "TypeVar", -- (1, 7, 1, 20), -- "T", -- ( -- "Tuple", -- (1, 10, 1, 20), -- [ -- ("Name", (1, 11, 1, 14), "int", ("Load",)), -- ("Name", (1, 16, 1, 19), "str", ("Load",)), -- ], -- ("Load",), -- ), -- None, -- ), -- ("TypeVarTuple", (1, 22, 1, 25), "Ts", None), -- ("ParamSpec", (1, 27, 1, 30), "P", None), -- ], -- ( -- "Tuple", -- (1, 34, 1, 44), -- [ -- ("Name", (1, 35, 1, 36), "T", ("Load",)), -- ("Name", (1, 38, 1, 40), "Ts", ("Load",)), -- ("Name", (1, 42, 1, 43), "P", ("Load",)), -- ], -- ("Load",), -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "TypeAlias", -- (1, 0, 1, 48), -- ("Name", (1, 5, 1, 6), "X", ("Store",)), -- [ -- ( -- "TypeVar", -- (1, 7, 1, 17), -- "T", -- ("Name", (1, 10, 1, 13), "int", ("Load",)), -- ("Constant", (1, 16, 1, 17), 1, None), -- ), -- ( -- "TypeVarTuple", -- (1, 19, 1, 26), -- "Ts", -- ("Constant", (1, 25, 1, 26), 2, None), -- ), -- ( -- "ParamSpec", -- (1, 28, 1, 34), -- "P", -- ("Constant", (1, 33, 1, 34), 3, None), -- ), -- ], -- ( -- "Tuple", -- (1, 38, 1, 48), -- [ -- ("Name", (1, 39, 1, 40), "T", ("Load",)), -- ("Name", (1, 42, 1, 44), "Ts", ("Load",)), -- ("Name", (1, 46, 1, 47), "P", ("Load",)), -- ], -- ("Load",), -- ), -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (1, 0, 1, 16), -- "X", -- [], -- [], -- [("Pass", (1, 12, 1, 16))], -- [], -- [("TypeVar", (1, 8, 1, 9), "T", None, None)], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (1, 0, 1, 26), -- "X", -- [], -- [], -- [("Pass", (1, 22, 1, 26))], -- [], -- [ -- ("TypeVar", (1, 8, 1, 9), "T", None, None), -- ("TypeVarTuple", (1, 11, 1, 14), "Ts", None), -- ("ParamSpec", (1, 16, 1, 19), "P", None), -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (1, 0, 1, 31), -- "X", -- [], -- [], -- [("Pass", (1, 27, 1, 31))], -- [], -- [ -- ( -- "TypeVar", -- (1, 8, 1, 14), -- "T", -- ("Name", (1, 11, 1, 14), "int", ("Load",)), -- None, -- ), -- ("TypeVarTuple", (1, 16, 1, 19), "Ts", None), -- ("ParamSpec", (1, 21, 1, 24), "P", None), -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (1, 0, 1, 38), -- "X", -- [], -- [], -- [("Pass", (1, 34, 1, 38))], -- [], -- [ -- ( -- "TypeVar", -- (1, 8, 1, 21), -- "T", -- ( -- "Tuple", -- (1, 11, 1, 21), -- [ -- ("Name", (1, 12, 1, 15), "int", ("Load",)), -- ("Name", (1, 17, 1, 20), "str", ("Load",)), -- ], -- ("Load",), -- ), -- None, -- ), -- ("TypeVarTuple", (1, 23, 1, 26), "Ts", None), -- ("ParamSpec", (1, 28, 1, 31), "P", None), -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "ClassDef", -- (1, 0, 1, 43), -- "X", -- [], -- [], -- [("Pass", (1, 39, 1, 43))], -- [], -- [ -- ( -- "TypeVar", -- (1, 8, 1, 18), -- "T", -- ("Name", (1, 11, 1, 14), "int", ("Load",)), -- ("Constant", (1, 17, 1, 18), 1, None), -- ), -- ( -- "TypeVarTuple", -- (1, 20, 1, 27), -- "Ts", -- ("Constant", (1, 26, 1, 27), 2, None), -- ), -- ( -- "ParamSpec", -- (1, 29, 1, 36), -- "P", -- ("Constant", (1, 35, 1, 36), 3, None), -- ), -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 16), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 12, 1, 16))], -- [], -- None, -- None, -- [("TypeVar", (1, 6, 1, 7), "T", None, None)], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 26), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 22, 1, 26))], -- [], -- None, -- None, -- [ -- ("TypeVar", (1, 6, 1, 7), "T", None, None), -- ("TypeVarTuple", (1, 9, 1, 12), "Ts", None), -- ("ParamSpec", (1, 14, 1, 17), "P", None), -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 31), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 27, 1, 31))], -- [], -- None, -- None, -- [ -- ( -- "TypeVar", -- (1, 6, 1, 12), -- "T", -- ("Name", (1, 9, 1, 12), "int", ("Load",)), -- None, -- ), -- ("TypeVarTuple", (1, 14, 1, 17), "Ts", None), -- ("ParamSpec", (1, 19, 1, 22), "P", None), -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 38), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 34, 1, 38))], -- [], -- None, -- None, -- [ -- ( -- "TypeVar", -- (1, 6, 1, 19), -- "T", -- ( -- "Tuple", -- (1, 9, 1, 19), -- [ -- ("Name", (1, 10, 1, 13), "int", ("Load",)), -- ("Name", (1, 15, 1, 18), "str", ("Load",)), -- ], -- ("Load",), -- ), -- None, -- ), -- ("TypeVarTuple", (1, 21, 1, 24), "Ts", None), -- ("ParamSpec", (1, 26, 1, 29), "P", None), -- ], -- ) -- ], -- [], -- ), -- ( -- "Module", -- [ -- ( -- "FunctionDef", -- (1, 0, 1, 43), -- "f", -- ("arguments", [], [], None, [], [], None, []), -- [("Pass", (1, 39, 1, 43))], -- [], -- None, -- None, -- [ -- ( -- "TypeVar", -- (1, 6, 1, 16), -- "T", -- ("Name", (1, 9, 1, 12), "int", ("Load",)), -- ("Constant", (1, 15, 1, 16), 1, None), -- ), -- ( -- "TypeVarTuple", -- (1, 18, 1, 25), -- "Ts", -- ("Constant", (1, 24, 1, 25), 2, None), -- ), -- ( -- "ParamSpec", -- (1, 27, 1, 34), -- "P", -- ("Constant", (1, 33, 1, 34), 3, None), -- ), -- ], -- ) -- ], -- [], -- ), -+('Module', [('Expr', (1, 0, 1, 4), ('Constant', (1, 0, 1, 4), None, None))], []), -+('Module', [('Expr', (1, 0, 1, 18), ('Constant', (1, 0, 1, 18), 'module docstring', None))], []), -+('Module', [('FunctionDef', (1, 0, 1, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 9, 1, 13))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 29), 'f', ('arguments', [], [], None, [], [], None, []), [('Expr', (1, 9, 1, 29), ('Constant', (1, 9, 1, 29), 'function docstring', None))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 14), 'f', ('arguments', [], [('arg', (1, 6, 1, 7), 'a', None, None)], None, [], [], None, []), [('Pass', (1, 10, 1, 14))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 16), 'f', ('arguments', [], [('arg', (1, 6, 1, 7), 'a', None, None)], None, [], [], None, [('Constant', (1, 8, 1, 9), 0, None)]), [('Pass', (1, 12, 1, 16))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 18), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 11), 'args', None, None), [], [], None, []), [('Pass', (1, 14, 1, 18))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 23), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 16), 'args', ('Starred', (1, 13, 1, 16), ('Name', (1, 14, 1, 16), 'Ts', ('Load',)), ('Load',)), None), [], [], None, []), [('Pass', (1, 19, 1, 23))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 36), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 29), 'args', ('Starred', (1, 13, 1, 29), ('Subscript', (1, 14, 1, 29), ('Name', (1, 14, 1, 19), 'tuple', ('Load',)), ('Tuple', (1, 20, 1, 28), [('Name', (1, 20, 1, 23), 'int', ('Load',)), ('Constant', (1, 25, 1, 28), Ellipsis, None)], ('Load',)), ('Load',)), ('Load',)), None), [], [], None, []), [('Pass', (1, 32, 1, 36))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 36), 'f', ('arguments', [], [], ('arg', (1, 7, 1, 29), 'args', ('Starred', (1, 13, 1, 29), ('Subscript', (1, 14, 1, 29), ('Name', (1, 14, 1, 19), 'tuple', ('Load',)), ('Tuple', (1, 20, 1, 28), [('Name', (1, 20, 1, 23), 'int', ('Load',)), ('Starred', (1, 25, 1, 28), ('Name', (1, 26, 1, 28), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), ('Load',)), None), [], [], None, []), [('Pass', (1, 32, 1, 36))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 21), 'f', ('arguments', [], [], None, [], [], ('arg', (1, 8, 1, 14), 'kwargs', None, None), []), [('Pass', (1, 17, 1, 21))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 71), 'f', ('arguments', [], [('arg', (1, 6, 1, 7), 'a', None, None), ('arg', (1, 9, 1, 10), 'b', None, None), ('arg', (1, 14, 1, 15), 'c', None, None), ('arg', (1, 22, 1, 23), 'd', None, None), ('arg', (1, 28, 1, 29), 'e', None, None)], ('arg', (1, 35, 1, 39), 'args', None, None), [('arg', (1, 41, 1, 42), 'f', None, None)], [('Constant', (1, 43, 1, 45), 42, None)], ('arg', (1, 49, 1, 55), 'kwargs', None, None), [('Constant', (1, 11, 1, 12), 1, None), ('Constant', (1, 16, 1, 20), None, None), ('List', (1, 24, 1, 26), [], ('Load',)), ('Dict', (1, 30, 1, 32), [], [])]), [('Expr', (1, 58, 1, 71), ('Constant', (1, 58, 1, 71), 'doc for f()', None))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 27), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 23, 1, 27))], [], ('Subscript', (1, 11, 1, 21), ('Name', (1, 11, 1, 16), 'tuple', ('Load',)), ('Tuple', (1, 17, 1, 20), [('Starred', (1, 17, 1, 20), ('Name', (1, 18, 1, 20), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 32), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 28, 1, 32))], [], ('Subscript', (1, 11, 1, 26), ('Name', (1, 11, 1, 16), 'tuple', ('Load',)), ('Tuple', (1, 17, 1, 25), [('Name', (1, 17, 1, 20), 'int', ('Load',)), ('Starred', (1, 22, 1, 25), ('Name', (1, 23, 1, 25), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 45), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 41, 1, 45))], [], ('Subscript', (1, 11, 1, 39), ('Name', (1, 11, 1, 16), 'tuple', ('Load',)), ('Tuple', (1, 17, 1, 38), [('Name', (1, 17, 1, 20), 'int', ('Load',)), ('Starred', (1, 22, 1, 38), ('Subscript', (1, 23, 1, 38), ('Name', (1, 23, 1, 28), 'tuple', ('Load',)), ('Tuple', (1, 29, 1, 37), [('Name', (1, 29, 1, 32), 'int', ('Load',)), ('Constant', (1, 34, 1, 37), Ellipsis, None)], ('Load',)), ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, [])], []), -+('Module', [('ClassDef', (1, 0, 1, 12), 'C', [], [], [('Pass', (1, 8, 1, 12))], [], [])], []), -+('Module', [('ClassDef', (1, 0, 1, 32), 'C', [], [], [('Expr', (1, 9, 1, 32), ('Constant', (1, 9, 1, 32), 'docstring for class C', None))], [], [])], []), -+('Module', [('ClassDef', (1, 0, 1, 21), 'C', [('Name', (1, 8, 1, 14), 'object', ('Load',))], [], [('Pass', (1, 17, 1, 21))], [], [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 16), 'f', ('arguments', [], [], None, [], [], None, []), [('Return', (1, 8, 1, 16), ('Constant', (1, 15, 1, 16), 1, None))], [], None, None, [])], []), -+('Module', [('Delete', (1, 0, 1, 5), [('Name', (1, 4, 1, 5), 'v', ('Del',))])], []), -+('Module', [('Assign', (1, 0, 1, 5), [('Name', (1, 0, 1, 1), 'v', ('Store',))], ('Constant', (1, 4, 1, 5), 1, None), None)], []), -+('Module', [('Assign', (1, 0, 1, 7), [('Tuple', (1, 0, 1, 3), [('Name', (1, 0, 1, 1), 'a', ('Store',)), ('Name', (1, 2, 1, 3), 'b', ('Store',))], ('Store',))], ('Name', (1, 6, 1, 7), 'c', ('Load',)), None)], []), -+('Module', [('Assign', (1, 0, 1, 9), [('Tuple', (1, 0, 1, 5), [('Name', (1, 1, 1, 2), 'a', ('Store',)), ('Name', (1, 3, 1, 4), 'b', ('Store',))], ('Store',))], ('Name', (1, 8, 1, 9), 'c', ('Load',)), None)], []), -+('Module', [('Assign', (1, 0, 1, 9), [('List', (1, 0, 1, 5), [('Name', (1, 1, 1, 2), 'a', ('Store',)), ('Name', (1, 3, 1, 4), 'b', ('Store',))], ('Store',))], ('Name', (1, 8, 1, 9), 'c', ('Load',)), None)], []), -+('Module', [('AnnAssign', (1, 0, 1, 13), ('Name', (1, 0, 1, 1), 'x', ('Store',)), ('Subscript', (1, 3, 1, 13), ('Name', (1, 3, 1, 8), 'tuple', ('Load',)), ('Tuple', (1, 9, 1, 12), [('Starred', (1, 9, 1, 12), ('Name', (1, 10, 1, 12), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, 1)], []), -+('Module', [('AnnAssign', (1, 0, 1, 18), ('Name', (1, 0, 1, 1), 'x', ('Store',)), ('Subscript', (1, 3, 1, 18), ('Name', (1, 3, 1, 8), 'tuple', ('Load',)), ('Tuple', (1, 9, 1, 17), [('Name', (1, 9, 1, 12), 'int', ('Load',)), ('Starred', (1, 14, 1, 17), ('Name', (1, 15, 1, 17), 'Ts', ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, 1)], []), -+('Module', [('AnnAssign', (1, 0, 1, 31), ('Name', (1, 0, 1, 1), 'x', ('Store',)), ('Subscript', (1, 3, 1, 31), ('Name', (1, 3, 1, 8), 'tuple', ('Load',)), ('Tuple', (1, 9, 1, 30), [('Name', (1, 9, 1, 12), 'int', ('Load',)), ('Starred', (1, 14, 1, 30), ('Subscript', (1, 15, 1, 30), ('Name', (1, 15, 1, 20), 'tuple', ('Load',)), ('Tuple', (1, 21, 1, 29), [('Name', (1, 21, 1, 24), 'str', ('Load',)), ('Constant', (1, 26, 1, 29), Ellipsis, None)], ('Load',)), ('Load',)), ('Load',))], ('Load',)), ('Load',)), None, 1)], []), -+('Module', [('AugAssign', (1, 0, 1, 6), ('Name', (1, 0, 1, 1), 'v', ('Store',)), ('Add',), ('Constant', (1, 5, 1, 6), 1, None))], []), -+('Module', [('For', (1, 0, 1, 15), ('Name', (1, 4, 1, 5), 'v', ('Store',)), ('Name', (1, 9, 1, 10), 'v', ('Load',)), [('Pass', (1, 11, 1, 15))], [], None)], []), -+('Module', [('While', (1, 0, 1, 12), ('Name', (1, 6, 1, 7), 'v', ('Load',)), [('Pass', (1, 8, 1, 12))], [])], []), -+('Module', [('If', (1, 0, 1, 9), ('Name', (1, 3, 1, 4), 'v', ('Load',)), [('Pass', (1, 5, 1, 9))], [])], []), -+('Module', [('If', (1, 0, 4, 6), ('Name', (1, 3, 1, 4), 'a', ('Load',)), [('Pass', (2, 2, 2, 6))], [('If', (3, 0, 4, 6), ('Name', (3, 5, 3, 6), 'b', ('Load',)), [('Pass', (4, 2, 4, 6))], [])])], []), -+('Module', [('If', (1, 0, 6, 6), ('Name', (1, 3, 1, 4), 'a', ('Load',)), [('Pass', (2, 2, 2, 6))], [('If', (3, 0, 6, 6), ('Name', (3, 5, 3, 6), 'b', ('Load',)), [('Pass', (4, 2, 4, 6))], [('Pass', (6, 2, 6, 6))])])], []), -+('Module', [('With', (1, 0, 1, 17), [('withitem', ('Name', (1, 5, 1, 6), 'x', ('Load',)), ('Name', (1, 10, 1, 11), 'y', ('Store',)))], [('Pass', (1, 13, 1, 17))], None)], []), -+('Module', [('With', (1, 0, 1, 25), [('withitem', ('Name', (1, 5, 1, 6), 'x', ('Load',)), ('Name', (1, 10, 1, 11), 'y', ('Store',))), ('withitem', ('Name', (1, 13, 1, 14), 'z', ('Load',)), ('Name', (1, 18, 1, 19), 'q', ('Store',)))], [('Pass', (1, 21, 1, 25))], None)], []), -+('Module', [('With', (1, 0, 1, 19), [('withitem', ('Name', (1, 6, 1, 7), 'x', ('Load',)), ('Name', (1, 11, 1, 12), 'y', ('Store',)))], [('Pass', (1, 15, 1, 19))], None)], []), -+('Module', [('With', (1, 0, 1, 17), [('withitem', ('Name', (1, 6, 1, 7), 'x', ('Load',)), None), ('withitem', ('Name', (1, 9, 1, 10), 'y', ('Load',)), None)], [('Pass', (1, 13, 1, 17))], None)], []), -+('Module', [('Raise', (1, 0, 1, 25), ('Call', (1, 6, 1, 25), ('Name', (1, 6, 1, 15), 'Exception', ('Load',)), [('Constant', (1, 16, 1, 24), 'string', None)], []), None)], []), -+('Module', [('Try', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [('ExceptHandler', (3, 0, 4, 6), ('Name', (3, 7, 3, 16), 'Exception', ('Load',)), None, [('Pass', (4, 2, 4, 6))])], [], [])], []), -+('Module', [('Try', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [], [], [('Pass', (4, 2, 4, 6))])], []), -+('Module', [('TryStar', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [('ExceptHandler', (3, 0, 4, 6), ('Name', (3, 8, 3, 17), 'Exception', ('Load',)), None, [('Pass', (4, 2, 4, 6))])], [], [])], []), -+('Module', [('Assert', (1, 0, 1, 8), ('Name', (1, 7, 1, 8), 'v', ('Load',)), None)], []), -+('Module', [('Import', (1, 0, 1, 10), [('alias', (1, 7, 1, 10), 'sys', None)])], []), -+('Module', [('ImportFrom', (1, 0, 1, 17), 'sys', [('alias', (1, 16, 1, 17), 'v', None)], 0)], []), -+('Module', [('Global', (1, 0, 1, 8), ['v'])], []), -+('Module', [('Expr', (1, 0, 1, 1), ('Constant', (1, 0, 1, 1), 1, None))], []), -+('Module', [('Pass', (1, 0, 1, 4))], []), -+('Module', [('For', (1, 0, 1, 16), ('Name', (1, 4, 1, 5), 'v', ('Store',)), ('Name', (1, 9, 1, 10), 'v', ('Load',)), [('Break', (1, 11, 1, 16))], [], None)], []), -+('Module', [('For', (1, 0, 1, 19), ('Name', (1, 4, 1, 5), 'v', ('Store',)), ('Name', (1, 9, 1, 10), 'v', ('Load',)), [('Continue', (1, 11, 1, 19))], [], None)], []), -+('Module', [('For', (1, 0, 1, 18), ('Tuple', (1, 4, 1, 7), [('Name', (1, 4, 1, 5), 'a', ('Store',)), ('Name', (1, 6, 1, 7), 'b', ('Store',))], ('Store',)), ('Name', (1, 11, 1, 12), 'c', ('Load',)), [('Pass', (1, 14, 1, 18))], [], None)], []), -+('Module', [('For', (1, 0, 1, 20), ('Tuple', (1, 4, 1, 9), [('Name', (1, 5, 1, 6), 'a', ('Store',)), ('Name', (1, 7, 1, 8), 'b', ('Store',))], ('Store',)), ('Name', (1, 13, 1, 14), 'c', ('Load',)), [('Pass', (1, 16, 1, 20))], [], None)], []), -+('Module', [('For', (1, 0, 1, 20), ('List', (1, 4, 1, 9), [('Name', (1, 5, 1, 6), 'a', ('Store',)), ('Name', (1, 7, 1, 8), 'b', ('Store',))], ('Store',)), ('Name', (1, 13, 1, 14), 'c', ('Load',)), [('Pass', (1, 16, 1, 20))], [], None)], []), -+('Module', [('Expr', (1, 0, 11, 5), ('GeneratorExp', (1, 0, 11, 5), ('Tuple', (2, 4, 6, 5), [('Name', (3, 4, 3, 6), 'Aa', ('Load',)), ('Name', (5, 7, 5, 9), 'Bb', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (8, 4, 10, 6), [('Name', (8, 4, 8, 6), 'Aa', ('Store',)), ('Name', (10, 4, 10, 6), 'Bb', ('Store',))], ('Store',)), ('Name', (10, 10, 10, 12), 'Cc', ('Load',)), [], 0)]))], []), -+('Module', [('Expr', (1, 0, 1, 34), ('DictComp', (1, 0, 1, 34), ('Name', (1, 1, 1, 2), 'a', ('Load',)), ('Name', (1, 5, 1, 6), 'b', ('Load',)), [('comprehension', ('Name', (1, 11, 1, 12), 'w', ('Store',)), ('Name', (1, 16, 1, 17), 'x', ('Load',)), [], 0), ('comprehension', ('Name', (1, 22, 1, 23), 'm', ('Store',)), ('Name', (1, 27, 1, 28), 'p', ('Load',)), [('Name', (1, 32, 1, 33), 'g', ('Load',))], 0)]))], []), -+('Module', [('Expr', (1, 0, 1, 20), ('DictComp', (1, 0, 1, 20), ('Name', (1, 1, 1, 2), 'a', ('Load',)), ('Name', (1, 5, 1, 6), 'b', ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'v', ('Store',)), ('Name', (1, 13, 1, 14), 'w', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'x', ('Load',)), [], 0)]))], []), -+('Module', [('Expr', (1, 0, 1, 19), ('SetComp', (1, 0, 1, 19), ('Name', (1, 1, 1, 2), 'r', ('Load',)), [('comprehension', ('Name', (1, 7, 1, 8), 'l', ('Store',)), ('Name', (1, 12, 1, 13), 'x', ('Load',)), [('Name', (1, 17, 1, 18), 'g', ('Load',))], 0)]))], []), -+('Module', [('Expr', (1, 0, 1, 16), ('SetComp', (1, 0, 1, 16), ('Name', (1, 1, 1, 2), 'r', ('Load',)), [('comprehension', ('Tuple', (1, 7, 1, 10), [('Name', (1, 7, 1, 8), 'l', ('Store',)), ('Name', (1, 9, 1, 10), 'm', ('Store',))], ('Store',)), ('Name', (1, 14, 1, 15), 'x', ('Load',)), [], 0)]))], []), -+('Module', [('AsyncFunctionDef', (1, 0, 3, 18), 'f', ('arguments', [], [], None, [], [], None, []), [('Expr', (2, 1, 2, 17), ('Constant', (2, 1, 2, 17), 'async function', None)), ('Expr', (3, 1, 3, 18), ('Await', (3, 1, 3, 18), ('Call', (3, 7, 3, 18), ('Name', (3, 7, 3, 16), 'something', ('Load',)), [], [])))], [], None, None, [])], []), -+('Module', [('AsyncFunctionDef', (1, 0, 3, 8), 'f', ('arguments', [], [], None, [], [], None, []), [('AsyncFor', (2, 1, 3, 8), ('Name', (2, 11, 2, 12), 'e', ('Store',)), ('Name', (2, 16, 2, 17), 'i', ('Load',)), [('Expr', (2, 19, 2, 20), ('Constant', (2, 19, 2, 20), 1, None))], [('Expr', (3, 7, 3, 8), ('Constant', (3, 7, 3, 8), 2, None))], None)], [], None, None, [])], []), -+('Module', [('AsyncFunctionDef', (1, 0, 2, 21), 'f', ('arguments', [], [], None, [], [], None, []), [('AsyncWith', (2, 1, 2, 21), [('withitem', ('Name', (2, 12, 2, 13), 'a', ('Load',)), ('Name', (2, 17, 2, 18), 'b', ('Store',)))], [('Expr', (2, 20, 2, 21), ('Constant', (2, 20, 2, 21), 1, None))], None)], [], None, None, [])], []), -+('Module', [('Expr', (1, 0, 1, 14), ('Dict', (1, 0, 1, 14), [None, ('Constant', (1, 10, 1, 11), 2, None)], [('Dict', (1, 3, 1, 8), [('Constant', (1, 4, 1, 5), 1, None)], [('Constant', (1, 6, 1, 7), 2, None)]), ('Constant', (1, 12, 1, 13), 3, None)]))], []), -+('Module', [('Expr', (1, 0, 1, 12), ('Set', (1, 0, 1, 12), [('Starred', (1, 1, 1, 8), ('Set', (1, 2, 1, 8), [('Constant', (1, 3, 1, 4), 1, None), ('Constant', (1, 6, 1, 7), 2, None)]), ('Load',)), ('Constant', (1, 10, 1, 11), 3, None)]))], []), -+('Module', [('AsyncFunctionDef', (1, 0, 2, 21), 'f', ('arguments', [], [], None, [], [], None, []), [('Expr', (2, 1, 2, 21), ('ListComp', (2, 1, 2, 21), ('Name', (2, 2, 2, 3), 'i', ('Load',)), [('comprehension', ('Name', (2, 14, 2, 15), 'b', ('Store',)), ('Name', (2, 19, 2, 20), 'c', ('Load',)), [], 1)]))], [], None, None, [])], []), -+('Module', [('FunctionDef', (4, 0, 4, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (4, 9, 4, 13))], [('Name', (1, 1, 1, 6), 'deco1', ('Load',)), ('Call', (2, 1, 2, 8), ('Name', (2, 1, 2, 6), 'deco2', ('Load',)), [], []), ('Call', (3, 1, 3, 9), ('Name', (3, 1, 3, 6), 'deco3', ('Load',)), [('Constant', (3, 7, 3, 8), 1, None)], [])], None, None, [])], []), -+('Module', [('AsyncFunctionDef', (4, 0, 4, 19), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (4, 15, 4, 19))], [('Name', (1, 1, 1, 6), 'deco1', ('Load',)), ('Call', (2, 1, 2, 8), ('Name', (2, 1, 2, 6), 'deco2', ('Load',)), [], []), ('Call', (3, 1, 3, 9), ('Name', (3, 1, 3, 6), 'deco3', ('Load',)), [('Constant', (3, 7, 3, 8), 1, None)], [])], None, None, [])], []), -+('Module', [('ClassDef', (4, 0, 4, 13), 'C', [], [], [('Pass', (4, 9, 4, 13))], [('Name', (1, 1, 1, 6), 'deco1', ('Load',)), ('Call', (2, 1, 2, 8), ('Name', (2, 1, 2, 6), 'deco2', ('Load',)), [], []), ('Call', (3, 1, 3, 9), ('Name', (3, 1, 3, 6), 'deco3', ('Load',)), [('Constant', (3, 7, 3, 8), 1, None)], [])], [])], []), -+('Module', [('FunctionDef', (2, 0, 2, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (2, 9, 2, 13))], [('Call', (1, 1, 1, 19), ('Name', (1, 1, 1, 5), 'deco', ('Load',)), [('GeneratorExp', (1, 5, 1, 19), ('Name', (1, 6, 1, 7), 'a', ('Load',)), [('comprehension', ('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 17, 1, 18), 'b', ('Load',)), [], 0)])], [])], None, None, [])], []), -+('Module', [('FunctionDef', (2, 0, 2, 13), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (2, 9, 2, 13))], [('Attribute', (1, 1, 1, 6), ('Attribute', (1, 1, 1, 4), ('Name', (1, 1, 1, 2), 'a', ('Load',)), 'b', ('Load',)), 'c', ('Load',))], None, None, [])], []), -+('Module', [('Expr', (1, 0, 1, 8), ('NamedExpr', (1, 1, 1, 7), ('Name', (1, 1, 1, 2), 'a', ('Store',)), ('Constant', (1, 6, 1, 7), 1, None)))], []), -+('Module', [('FunctionDef', (1, 0, 1, 18), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [], None, [], [], None, []), [('Pass', (1, 14, 1, 18))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 26), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 12, 1, 13), 'c', None, None), ('arg', (1, 15, 1, 16), 'd', None, None), ('arg', (1, 18, 1, 19), 'e', None, None)], None, [], [], None, []), [('Pass', (1, 22, 1, 26))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 29), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 12, 1, 13), 'c', None, None)], None, [('arg', (1, 18, 1, 19), 'd', None, None), ('arg', (1, 21, 1, 22), 'e', None, None)], [None, None], None, []), [('Pass', (1, 25, 1, 29))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 39), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 12, 1, 13), 'c', None, None)], None, [('arg', (1, 18, 1, 19), 'd', None, None), ('arg', (1, 21, 1, 22), 'e', None, None)], [None, None], ('arg', (1, 26, 1, 32), 'kwargs', None, None), []), [('Pass', (1, 35, 1, 39))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 20), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [], None, [], [], None, [('Constant', (1, 8, 1, 9), 1, None)]), [('Pass', (1, 16, 1, 20))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 29), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None), ('arg', (1, 19, 1, 20), 'c', None, None)], None, [], [], None, [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None), ('Constant', (1, 21, 1, 22), 4, None)]), [('Pass', (1, 25, 1, 29))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 32), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [('Constant', (1, 24, 1, 25), 4, None)], None, [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 28, 1, 32))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 30), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [None], None, [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 26, 1, 30))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 42), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [('Constant', (1, 24, 1, 25), 4, None)], ('arg', (1, 29, 1, 35), 'kwargs', None, None), [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 38, 1, 42))], [], None, None, [])], []), -+('Module', [('FunctionDef', (1, 0, 1, 40), 'f', ('arguments', [('arg', (1, 6, 1, 7), 'a', None, None)], [('arg', (1, 14, 1, 15), 'b', None, None)], None, [('arg', (1, 22, 1, 23), 'c', None, None)], [None], ('arg', (1, 27, 1, 33), 'kwargs', None, None), [('Constant', (1, 8, 1, 9), 1, None), ('Constant', (1, 16, 1, 17), 2, None)]), [('Pass', (1, 36, 1, 40))], [], None, None, [])], []), -+('Module', [('TypeAlias', (1, 0, 1, 12), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [], ('Name', (1, 9, 1, 12), 'int', ('Load',)))], []), -+('Module', [('TypeAlias', (1, 0, 1, 15), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 8), 'T', None, None)], ('Name', (1, 12, 1, 15), 'int', ('Load',)))], []), -+('Module', [('TypeAlias', (1, 0, 1, 32), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 8), 'T', None, None), ('TypeVarTuple', (1, 10, 1, 13), 'Ts', None), ('ParamSpec', (1, 15, 1, 18), 'P', None)], ('Tuple', (1, 22, 1, 32), [('Name', (1, 23, 1, 24), 'T', ('Load',)), ('Name', (1, 26, 1, 28), 'Ts', ('Load',)), ('Name', (1, 30, 1, 31), 'P', ('Load',))], ('Load',)))], []), -+('Module', [('TypeAlias', (1, 0, 1, 37), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 13), 'T', ('Name', (1, 10, 1, 13), 'int', ('Load',)), None), ('TypeVarTuple', (1, 15, 1, 18), 'Ts', None), ('ParamSpec', (1, 20, 1, 23), 'P', None)], ('Tuple', (1, 27, 1, 37), [('Name', (1, 28, 1, 29), 'T', ('Load',)), ('Name', (1, 31, 1, 33), 'Ts', ('Load',)), ('Name', (1, 35, 1, 36), 'P', ('Load',))], ('Load',)))], []), -+('Module', [('TypeAlias', (1, 0, 1, 44), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 20), 'T', ('Tuple', (1, 10, 1, 20), [('Name', (1, 11, 1, 14), 'int', ('Load',)), ('Name', (1, 16, 1, 19), 'str', ('Load',))], ('Load',)), None), ('TypeVarTuple', (1, 22, 1, 25), 'Ts', None), ('ParamSpec', (1, 27, 1, 30), 'P', None)], ('Tuple', (1, 34, 1, 44), [('Name', (1, 35, 1, 36), 'T', ('Load',)), ('Name', (1, 38, 1, 40), 'Ts', ('Load',)), ('Name', (1, 42, 1, 43), 'P', ('Load',))], ('Load',)))], []), -+('Module', [('TypeAlias', (1, 0, 1, 48), ('Name', (1, 5, 1, 6), 'X', ('Store',)), [('TypeVar', (1, 7, 1, 17), 'T', ('Name', (1, 10, 1, 13), 'int', ('Load',)), ('Constant', (1, 16, 1, 17), 1, None)), ('TypeVarTuple', (1, 19, 1, 26), 'Ts', ('Constant', (1, 25, 1, 26), 2, None)), ('ParamSpec', (1, 28, 1, 34), 'P', ('Constant', (1, 33, 1, 34), 3, None))], ('Tuple', (1, 38, 1, 48), [('Name', (1, 39, 1, 40), 'T', ('Load',)), ('Name', (1, 42, 1, 44), 'Ts', ('Load',)), ('Name', (1, 46, 1, 47), 'P', ('Load',))], ('Load',)))], []), -+('Module', [('ClassDef', (1, 0, 1, 16), 'X', [], [], [('Pass', (1, 12, 1, 16))], [], [('TypeVar', (1, 8, 1, 9), 'T', None, None)])], []), -+('Module', [('ClassDef', (1, 0, 1, 26), 'X', [], [], [('Pass', (1, 22, 1, 26))], [], [('TypeVar', (1, 8, 1, 9), 'T', None, None), ('TypeVarTuple', (1, 11, 1, 14), 'Ts', None), ('ParamSpec', (1, 16, 1, 19), 'P', None)])], []), -+('Module', [('ClassDef', (1, 0, 1, 31), 'X', [], [], [('Pass', (1, 27, 1, 31))], [], [('TypeVar', (1, 8, 1, 14), 'T', ('Name', (1, 11, 1, 14), 'int', ('Load',)), None), ('TypeVarTuple', (1, 16, 1, 19), 'Ts', None), ('ParamSpec', (1, 21, 1, 24), 'P', None)])], []), -+('Module', [('ClassDef', (1, 0, 1, 38), 'X', [], [], [('Pass', (1, 34, 1, 38))], [], [('TypeVar', (1, 8, 1, 21), 'T', ('Tuple', (1, 11, 1, 21), [('Name', (1, 12, 1, 15), 'int', ('Load',)), ('Name', (1, 17, 1, 20), 'str', ('Load',))], ('Load',)), None), ('TypeVarTuple', (1, 23, 1, 26), 'Ts', None), ('ParamSpec', (1, 28, 1, 31), 'P', None)])], []), -+('Module', [('ClassDef', (1, 0, 1, 43), 'X', [], [], [('Pass', (1, 39, 1, 43))], [], [('TypeVar', (1, 8, 1, 18), 'T', ('Name', (1, 11, 1, 14), 'int', ('Load',)), ('Constant', (1, 17, 1, 18), 1, None)), ('TypeVarTuple', (1, 20, 1, 27), 'Ts', ('Constant', (1, 26, 1, 27), 2, None)), ('ParamSpec', (1, 29, 1, 36), 'P', ('Constant', (1, 35, 1, 36), 3, None))])], []), -+('Module', [('FunctionDef', (1, 0, 1, 16), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 12, 1, 16))], [], None, None, [('TypeVar', (1, 6, 1, 7), 'T', None, None)])], []), -+('Module', [('FunctionDef', (1, 0, 1, 26), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 22, 1, 26))], [], None, None, [('TypeVar', (1, 6, 1, 7), 'T', None, None), ('TypeVarTuple', (1, 9, 1, 12), 'Ts', None), ('ParamSpec', (1, 14, 1, 17), 'P', None)])], []), -+('Module', [('FunctionDef', (1, 0, 1, 31), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 27, 1, 31))], [], None, None, [('TypeVar', (1, 6, 1, 12), 'T', ('Name', (1, 9, 1, 12), 'int', ('Load',)), None), ('TypeVarTuple', (1, 14, 1, 17), 'Ts', None), ('ParamSpec', (1, 19, 1, 22), 'P', None)])], []), -+('Module', [('FunctionDef', (1, 0, 1, 38), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 34, 1, 38))], [], None, None, [('TypeVar', (1, 6, 1, 19), 'T', ('Tuple', (1, 9, 1, 19), [('Name', (1, 10, 1, 13), 'int', ('Load',)), ('Name', (1, 15, 1, 18), 'str', ('Load',))], ('Load',)), None), ('TypeVarTuple', (1, 21, 1, 24), 'Ts', None), ('ParamSpec', (1, 26, 1, 29), 'P', None)])], []), -+('Module', [('FunctionDef', (1, 0, 1, 43), 'f', ('arguments', [], [], None, [], [], None, []), [('Pass', (1, 39, 1, 43))], [], None, None, [('TypeVar', (1, 6, 1, 16), 'T', ('Name', (1, 9, 1, 12), 'int', ('Load',)), ('Constant', (1, 15, 1, 16), 1, None)), ('TypeVarTuple', (1, 18, 1, 25), 'Ts', ('Constant', (1, 24, 1, 25), 2, None)), ('ParamSpec', (1, 27, 1, 34), 'P', ('Constant', (1, 33, 1, 34), 3, None))])], []), - ] - single_results = [ -- ( -- "Interactive", -- [ -- ( -- "Expr", -- (1, 0, 1, 3), -- ( -- "BinOp", -- (1, 0, 1, 3), -- ("Constant", (1, 0, 1, 1), 1, None), -- ("Add",), -- ("Constant", (1, 2, 1, 3), 2, None), -- ), -- ) -- ], -- ), -+('Interactive', [('Expr', (1, 0, 1, 3), ('BinOp', (1, 0, 1, 3), ('Constant', (1, 0, 1, 1), 1, None), ('Add',), ('Constant', (1, 2, 1, 3), 2, None)))]), - ] - eval_results = [ -- ("Expression", ("Constant", (1, 0, 1, 4), None, None)), -- ( -- "Expression", -- ( -- "BoolOp", -- (1, 0, 1, 7), -- ("And",), -- [ -- ("Name", (1, 0, 1, 1), "a", ("Load",)), -- ("Name", (1, 6, 1, 7), "b", ("Load",)), -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "BinOp", -- (1, 0, 1, 5), -- ("Name", (1, 0, 1, 1), "a", ("Load",)), -- ("Add",), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ), -- ), -- ( -- "Expression", -- ("UnaryOp", (1, 0, 1, 5), ("Not",), ("Name", (1, 4, 1, 5), "v", ("Load",))), -- ), -- ( -- "Expression", -- ( -- "Lambda", -- (1, 0, 1, 11), -- ("arguments", [], [], None, [], [], None, []), -- ("Constant", (1, 7, 1, 11), None, None), -- ), -- ), -- ( -- "Expression", -- ( -- "Dict", -- (1, 0, 1, 7), -- [("Constant", (1, 2, 1, 3), 1, None)], -- [("Constant", (1, 4, 1, 5), 2, None)], -- ), -- ), -- ("Expression", ("Dict", (1, 0, 1, 2), [], [])), -- ("Expression", ("Set", (1, 0, 1, 7), [("Constant", (1, 1, 1, 5), None, None)])), -- ( -- "Expression", -- ( -- "Dict", -- (1, 0, 5, 6), -- [("Constant", (2, 6, 2, 7), 1, None)], -- [("Constant", (4, 10, 4, 11), 2, None)], -- ), -- ), -- ( -- "Expression", -- ( -- "ListComp", -- (1, 0, 1, 19), -- ("Name", (1, 1, 1, 2), "a", ("Load",)), -- [ -- ( -- "comprehension", -- ("Name", (1, 7, 1, 8), "b", ("Store",)), -- ("Name", (1, 12, 1, 13), "c", ("Load",)), -- [("Name", (1, 17, 1, 18), "d", ("Load",))], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "GeneratorExp", -- (1, 0, 1, 19), -- ("Name", (1, 1, 1, 2), "a", ("Load",)), -- [ -- ( -- "comprehension", -- ("Name", (1, 7, 1, 8), "b", ("Store",)), -- ("Name", (1, 12, 1, 13), "c", ("Load",)), -- [("Name", (1, 17, 1, 18), "d", ("Load",))], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "ListComp", -- (1, 0, 1, 20), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 11, 1, 14), -- [ -- ("Name", (1, 11, 1, 12), "a", ("Store",)), -- ("Name", (1, 13, 1, 14), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 18, 1, 19), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "ListComp", -- (1, 0, 1, 22), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 11, 1, 16), -- [ -- ("Name", (1, 12, 1, 13), "a", ("Store",)), -- ("Name", (1, 14, 1, 15), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 20, 1, 21), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "ListComp", -- (1, 0, 1, 22), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "List", -- (1, 11, 1, 16), -- [ -- ("Name", (1, 12, 1, 13), "a", ("Store",)), -- ("Name", (1, 14, 1, 15), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 20, 1, 21), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "SetComp", -- (1, 0, 1, 20), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 11, 1, 14), -- [ -- ("Name", (1, 11, 1, 12), "a", ("Store",)), -- ("Name", (1, 13, 1, 14), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 18, 1, 19), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "SetComp", -- (1, 0, 1, 22), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 11, 1, 16), -- [ -- ("Name", (1, 12, 1, 13), "a", ("Store",)), -- ("Name", (1, 14, 1, 15), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 20, 1, 21), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "SetComp", -- (1, 0, 1, 22), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "List", -- (1, 11, 1, 16), -- [ -- ("Name", (1, 12, 1, 13), "a", ("Store",)), -- ("Name", (1, 14, 1, 15), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 20, 1, 21), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "GeneratorExp", -- (1, 0, 1, 20), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 11, 1, 14), -- [ -- ("Name", (1, 11, 1, 12), "a", ("Store",)), -- ("Name", (1, 13, 1, 14), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 18, 1, 19), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "GeneratorExp", -- (1, 0, 1, 22), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "Tuple", -- (1, 11, 1, 16), -- [ -- ("Name", (1, 12, 1, 13), "a", ("Store",)), -- ("Name", (1, 14, 1, 15), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 20, 1, 21), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "GeneratorExp", -- (1, 0, 1, 22), -- ( -- "Tuple", -- (1, 1, 1, 6), -- [ -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- ("Name", (1, 4, 1, 5), "b", ("Load",)), -- ], -- ("Load",), -- ), -- [ -- ( -- "comprehension", -- ( -- "List", -- (1, 11, 1, 16), -- [ -- ("Name", (1, 12, 1, 13), "a", ("Store",)), -- ("Name", (1, 14, 1, 15), "b", ("Store",)), -- ], -- ("Store",), -- ), -- ("Name", (1, 20, 1, 21), "c", ("Load",)), -- [], -- 0, -- ) -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "Compare", -- (1, 0, 1, 9), -- ("Constant", (1, 0, 1, 1), 1, None), -- [("Lt",), ("Lt",)], -- [("Constant", (1, 4, 1, 5), 2, None), ("Constant", (1, 8, 1, 9), 3, None)], -- ), -- ), -- ( -- "Expression", -- ( -- "Call", -- (1, 0, 1, 17), -- ("Name", (1, 0, 1, 1), "f", ("Load",)), -- [ -- ("Constant", (1, 2, 1, 3), 1, None), -- ("Constant", (1, 4, 1, 5), 2, None), -- ( -- "Starred", -- (1, 10, 1, 12), -- ("Name", (1, 11, 1, 12), "d", ("Load",)), -- ("Load",), -- ), -- ], -- [ -- ("keyword", (1, 6, 1, 9), "c", ("Constant", (1, 8, 1, 9), 3, None)), -- ( -- "keyword", -- (1, 13, 1, 16), -- None, -- ("Name", (1, 15, 1, 16), "e", ("Load",)), -- ), -- ], -- ), -- ), -- ( -- "Expression", -- ( -- "Call", -- (1, 0, 1, 10), -- ("Name", (1, 0, 1, 1), "f", ("Load",)), -- [ -- ( -- "Starred", -- (1, 2, 1, 9), -- ( -- "List", -- (1, 3, 1, 9), -- [ -- ("Constant", (1, 4, 1, 5), 0, None), -- ("Constant", (1, 7, 1, 8), 1, None), -- ], -- ("Load",), -- ), -- ("Load",), -- ) -- ], -- [], -- ), -- ), -- ( -- "Expression", -- ( -- "Call", -- (1, 0, 1, 15), -- ("Name", (1, 0, 1, 1), "f", ("Load",)), -- [ -- ( -- "GeneratorExp", -- (1, 1, 1, 15), -- ("Name", (1, 2, 1, 3), "a", ("Load",)), -- [ -- ( -- "comprehension", -- ("Name", (1, 8, 1, 9), "a", ("Store",)), -- ("Name", (1, 13, 1, 14), "b", ("Load",)), -- [], -- 0, -- ) -- ], -- ) -- ], -- [], -- ), -- ), -- ("Expression", ("Constant", (1, 0, 1, 2), 10, None)), -- ("Expression", ("Constant", (1, 0, 1, 8), "string", None)), -- ( -- "Expression", -- ( -- "Attribute", -- (1, 0, 1, 3), -- ("Name", (1, 0, 1, 1), "a", ("Load",)), -- "b", -- ("Load",), -- ), -- ), -- ( -- "Expression", -- ( -- "Subscript", -- (1, 0, 1, 6), -- ("Name", (1, 0, 1, 1), "a", ("Load",)), -- ( -- "Slice", -- (1, 2, 1, 5), -- ("Name", (1, 2, 1, 3), "b", ("Load",)), -- ("Name", (1, 4, 1, 5), "c", ("Load",)), -- None, -- ), -- ("Load",), -- ), -- ), -- ("Expression", ("Name", (1, 0, 1, 1), "v", ("Load",))), -- ( -- "Expression", -- ( -- "List", -- (1, 0, 1, 7), -- [ -- ("Constant", (1, 1, 1, 2), 1, None), -- ("Constant", (1, 3, 1, 4), 2, None), -- ("Constant", (1, 5, 1, 6), 3, None), -- ], -- ("Load",), -- ), -- ), -- ("Expression", ("List", (1, 0, 1, 2), [], ("Load",))), -- ( -- "Expression", -- ( -- "Tuple", -- (1, 0, 1, 5), -- [ -- ("Constant", (1, 0, 1, 1), 1, None), -- ("Constant", (1, 2, 1, 3), 2, None), -- ("Constant", (1, 4, 1, 5), 3, None), -- ], -- ("Load",), -- ), -- ), -- ( -- "Expression", -- ( -- "Tuple", -- (1, 0, 1, 7), -- [ -- ("Constant", (1, 1, 1, 2), 1, None), -- ("Constant", (1, 3, 1, 4), 2, None), -- ("Constant", (1, 5, 1, 6), 3, None), -- ], -- ("Load",), -- ), -- ), -- ("Expression", ("Tuple", (1, 0, 1, 2), [], ("Load",))), -- ( -- "Expression", -- ( -- "Call", -- (1, 0, 1, 17), -- ( -- "Attribute", -- (1, 0, 1, 7), -- ( -- "Attribute", -- (1, 0, 1, 5), -- ( -- "Attribute", -- (1, 0, 1, 3), -- ("Name", (1, 0, 1, 1), "a", ("Load",)), -- "b", -- ("Load",), -- ), -- "c", -- ("Load",), -- ), -- "d", -- ("Load",), -- ), -- [ -- ( -- "Subscript", -- (1, 8, 1, 16), -- ( -- "Attribute", -- (1, 8, 1, 11), -- ("Name", (1, 8, 1, 9), "a", ("Load",)), -- "b", -- ("Load",), -- ), -- ( -- "Slice", -- (1, 12, 1, 15), -- ("Constant", (1, 12, 1, 13), 1, None), -- ("Constant", (1, 14, 1, 15), 2, None), -- None, -- ), -- ("Load",), -- ) -- ], -- [], -- ), -- ), -+('Expression', ('Constant', (1, 0, 1, 4), None, None)), -+('Expression', ('BoolOp', (1, 0, 1, 7), ('And',), [('Name', (1, 0, 1, 1), 'a', ('Load',)), ('Name', (1, 6, 1, 7), 'b', ('Load',))])), -+('Expression', ('BinOp', (1, 0, 1, 5), ('Name', (1, 0, 1, 1), 'a', ('Load',)), ('Add',), ('Name', (1, 4, 1, 5), 'b', ('Load',)))), -+('Expression', ('UnaryOp', (1, 0, 1, 5), ('Not',), ('Name', (1, 4, 1, 5), 'v', ('Load',)))), -+('Expression', ('Lambda', (1, 0, 1, 11), ('arguments', [], [], None, [], [], None, []), ('Constant', (1, 7, 1, 11), None, None))), -+('Expression', ('Dict', (1, 0, 1, 7), [('Constant', (1, 2, 1, 3), 1, None)], [('Constant', (1, 4, 1, 5), 2, None)])), -+('Expression', ('Dict', (1, 0, 1, 2), [], [])), -+('Expression', ('Set', (1, 0, 1, 7), [('Constant', (1, 1, 1, 5), None, None)])), -+('Expression', ('Dict', (1, 0, 5, 6), [('Constant', (2, 6, 2, 7), 1, None)], [('Constant', (4, 10, 4, 11), 2, None)])), -+('Expression', ('ListComp', (1, 0, 1, 19), ('Name', (1, 1, 1, 2), 'a', ('Load',)), [('comprehension', ('Name', (1, 7, 1, 8), 'b', ('Store',)), ('Name', (1, 12, 1, 13), 'c', ('Load',)), [('Name', (1, 17, 1, 18), 'd', ('Load',))], 0)])), -+('Expression', ('GeneratorExp', (1, 0, 1, 19), ('Name', (1, 1, 1, 2), 'a', ('Load',)), [('comprehension', ('Name', (1, 7, 1, 8), 'b', ('Store',)), ('Name', (1, 12, 1, 13), 'c', ('Load',)), [('Name', (1, 17, 1, 18), 'd', ('Load',))], 0)])), -+('Expression', ('ListComp', (1, 0, 1, 20), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'c', ('Load',)), [], 0)])), -+('Expression', ('ListComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), -+('Expression', ('ListComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), -+('Expression', ('SetComp', (1, 0, 1, 20), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'c', ('Load',)), [], 0)])), -+('Expression', ('SetComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), -+('Expression', ('SetComp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), -+('Expression', ('GeneratorExp', (1, 0, 1, 20), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 14), [('Name', (1, 11, 1, 12), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Store',))], ('Store',)), ('Name', (1, 18, 1, 19), 'c', ('Load',)), [], 0)])), -+('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), -+('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), -+('Expression', ('Compare', (1, 0, 1, 9), ('Constant', (1, 0, 1, 1), 1, None), [('Lt',), ('Lt',)], [('Constant', (1, 4, 1, 5), 2, None), ('Constant', (1, 8, 1, 9), 3, None)])), -+('Expression', ('Call', (1, 0, 1, 17), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Constant', (1, 2, 1, 3), 1, None), ('Constant', (1, 4, 1, 5), 2, None), ('Starred', (1, 10, 1, 12), ('Name', (1, 11, 1, 12), 'd', ('Load',)), ('Load',))], [('keyword', (1, 6, 1, 9), 'c', ('Constant', (1, 8, 1, 9), 3, None)), ('keyword', (1, 13, 1, 16), None, ('Name', (1, 15, 1, 16), 'e', ('Load',)))])), -+('Expression', ('Call', (1, 0, 1, 10), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Starred', (1, 2, 1, 9), ('List', (1, 3, 1, 9), [('Constant', (1, 4, 1, 5), 0, None), ('Constant', (1, 7, 1, 8), 1, None)], ('Load',)), ('Load',))], [])), -+('Expression', ('Call', (1, 0, 1, 15), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('GeneratorExp', (1, 1, 1, 15), ('Name', (1, 2, 1, 3), 'a', ('Load',)), [('comprehension', ('Name', (1, 8, 1, 9), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Load',)), [], 0)])], [])), -+('Expression', ('Constant', (1, 0, 1, 2), 10, None)), -+('Expression', ('Constant', (1, 0, 1, 8), 'string', None)), -+('Expression', ('Attribute', (1, 0, 1, 3), ('Name', (1, 0, 1, 1), 'a', ('Load',)), 'b', ('Load',))), -+('Expression', ('Subscript', (1, 0, 1, 6), ('Name', (1, 0, 1, 1), 'a', ('Load',)), ('Slice', (1, 2, 1, 5), ('Name', (1, 2, 1, 3), 'b', ('Load',)), ('Name', (1, 4, 1, 5), 'c', ('Load',)), None), ('Load',))), -+('Expression', ('Name', (1, 0, 1, 1), 'v', ('Load',))), -+('Expression', ('List', (1, 0, 1, 7), [('Constant', (1, 1, 1, 2), 1, None), ('Constant', (1, 3, 1, 4), 2, None), ('Constant', (1, 5, 1, 6), 3, None)], ('Load',))), -+('Expression', ('List', (1, 0, 1, 2), [], ('Load',))), -+('Expression', ('Tuple', (1, 0, 1, 5), [('Constant', (1, 0, 1, 1), 1, None), ('Constant', (1, 2, 1, 3), 2, None), ('Constant', (1, 4, 1, 5), 3, None)], ('Load',))), -+('Expression', ('Tuple', (1, 0, 1, 7), [('Constant', (1, 1, 1, 2), 1, None), ('Constant', (1, 3, 1, 4), 2, None), ('Constant', (1, 5, 1, 6), 3, None)], ('Load',))), -+('Expression', ('Tuple', (1, 0, 1, 2), [], ('Load',))), -+('Expression', ('Call', (1, 0, 1, 17), ('Attribute', (1, 0, 1, 7), ('Attribute', (1, 0, 1, 5), ('Attribute', (1, 0, 1, 3), ('Name', (1, 0, 1, 1), 'a', ('Load',)), 'b', ('Load',)), 'c', ('Load',)), 'd', ('Load',)), [('Subscript', (1, 8, 1, 16), ('Attribute', (1, 8, 1, 11), ('Name', (1, 8, 1, 9), 'a', ('Load',)), 'b', ('Load',)), ('Slice', (1, 12, 1, 15), ('Constant', (1, 12, 1, 13), 1, None), ('Constant', (1, 14, 1, 15), 2, None), None), ('Load',))], [])), - ] - main() -diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst b/Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst -new file mode 100644 -index 0000000000..6b58f89247 ---- /dev/null -+++ b/Misc/NEWS.d/next/Core and Builtins/2024-07-26-14-05-51.gh-issue-122300.SVIF-l.rst -@@ -0,0 +1,2 @@ -+Preserve AST nodes for f-string with single-element format specifiers. Patch -+by Pablo Galindo -diff --git a/Parser/action_helpers.c b/Parser/action_helpers.c -index 1354ef7505..34f744516c 100644 ---- a/Parser/action_helpers.c -+++ b/Parser/action_helpers.c -@@ -1002,7 +1002,8 @@ _PyPegen_setup_full_format_spec(Parser *p, Token *colon, asdl_expr_seq *spec, in - spec = resized_spec; - } - expr_ty res; -- if (asdl_seq_LEN(spec) == 0) { -+ Py_ssize_t n = asdl_seq_LEN(spec); -+ if (n == 0 || (n == 1 && asdl_seq_GET(spec, 0)->kind == Constant_kind)) { - res = _PyAST_JoinedStr(spec, lineno, col_offset, end_lineno, - end_col_offset, p->arena); - } else { diff --git a/python3.13.spec b/python3.13.spec index 5567126..ca25903 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel b4 +%global prerel rc1 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -397,16 +397,6 @@ Patch251: 00251-change-user-install-location.patch # Another process might have already moved jit_stencils.h.new Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch -# 00432 # 74b8ebb01dac2390dea7d76a8040ad54198c73c4 -# Account with abi_thread in test_sysconfig.test_user_similar -# -# From https://github.com/python/cpython/pull/122017 -Patch432: 00432-account-with-abi_thread-in-test_sysconfig-test_user_similar.patch - -# 00433 # 1c8b255f8c5430714b6860058880529a95a6bae7 -# Preserve AST nodes for format specifiers with single elements -Patch433: 00433-preserve-ast-nodes-for-format-specifiers-with-single-elements.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1748,6 +1738,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Aug 01 2024 Karolina Surma - 3.13.0~rc1-1 +- Update to Python 3.13.0rc1 + * Tue Jul 30 2024 Miro Hrončok - 3.13.0~b4-3 - Preserve AST nodes for f-string with single-element format specifiers - Fixes https://github.com/python/cpython/issues/122300 diff --git a/sources b/sources index aa5263c..abde692 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0b4.tar.xz) = e556f7a4e54b688d0424b0bd84f9849b52f4f7e04c68d4d5b877d86b4f9ded92c9efaa2b7ab33f345235f35e8d544833542f7a4cb100d0ff15b7d98b8367b935 -SHA512 (Python-3.13.0b4.tar.xz.asc) = 243637efff94965aa4d997fe26c91a7c1aa7dcfdf7f78d35d6f4fc408b654dfa9d075d1c73bc5a90d145f6e5029ee395a86faf7e027c24a55fabfea6ca20fbd4 +SHA512 (Python-3.13.0rc1.tar.xz) = fce7664f3298cfd191a7dc20b7b47acafdc50d058a2814312c94c30b65291395957d701e4661b9bb760417942acb5d27e5b8bb479bcda9a82cf29f53772a2daf +SHA512 (Python-3.13.0rc1.tar.xz.asc) = 3613829d9631f46b1b1ce11bfe5bb7fbfa49d97b639bb883c86737ea6ae8d15c24c526083cafb916011bd6d0b3b5fab2b17afd367edbdce99b32e0b4b845fd22 From 396df33f841dfd176ebccd93b3ce79fb1ea651c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 6 Aug 2024 23:21:44 +0200 Subject: [PATCH 043/115] Fix SystemError in PyEval_GetLocals() - Fixes: rhbz#2303107 --- ...-fix-systemerror-in-pyeval_getlocals.patch | 90 +++++++++++++++++++ python3.13.spec | 16 +++- 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch diff --git a/00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch b/00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch new file mode 100644 index 0000000..ebaad0d --- /dev/null +++ b/00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch @@ -0,0 +1,90 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Victor Stinner +Date: Tue, 6 Aug 2024 23:01:44 +0200 +Subject: [PATCH] 00434: gh-122728: Fix SystemError in PyEval_GetLocals() + +Fix PyEval_GetLocals() to avoid SystemError ("bad argument to +internal function"). Don't redefine the 'ret' variable in the if +block. + +Add an unit test on PyEval_GetLocals(). + +(cherry picked from commit 4767a6e31c0550836b2af45d27e374e721f0c4e6) +--- + Lib/test/test_capi/test_misc.py | 13 +++++++++++++ + .../2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst | 2 ++ + Modules/_testcapimodule.c | 7 +++++++ + Python/ceval.c | 2 +- + 4 files changed, 23 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst + +diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py +index f3d16e4a2f..080b3e6533 100644 +--- a/Lib/test/test_capi/test_misc.py ++++ b/Lib/test/test_capi/test_misc.py +@@ -1180,6 +1180,19 @@ def genf(): yield + gen = genf() + self.assertEqual(_testcapi.gen_get_code(gen), gen.gi_code) + ++ def test_pyeval_getlocals(self): ++ # Test PyEval_GetLocals() ++ x = 1 ++ self.assertEqual(_testcapi.pyeval_getlocals(), ++ {'self': self, ++ 'x': 1}) ++ ++ y = 2 ++ self.assertEqual(_testcapi.pyeval_getlocals(), ++ {'self': self, ++ 'x': 1, ++ 'y': 2}) ++ + + @requires_limited_api + class TestHeapTypeRelative(unittest.TestCase): +diff --git a/Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst b/Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst +new file mode 100644 +index 0000000000..a128d6aef3 +--- /dev/null ++++ b/Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst +@@ -0,0 +1,2 @@ ++Fix :c:func:`PyEval_GetLocals` to avoid :exc:`SystemError` ("bad argument to ++internal function"). Patch by Victor Stinner. +diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c +index 1fa7c37841..01b6bd89d1 100644 +--- a/Modules/_testcapimodule.c ++++ b/Modules/_testcapimodule.c +@@ -3332,6 +3332,12 @@ test_critical_sections(PyObject *module, PyObject *Py_UNUSED(args)) + Py_RETURN_NONE; + } + ++static PyObject * ++pyeval_getlocals(PyObject *module, PyObject *Py_UNUSED(args)) ++{ ++ return Py_XNewRef(PyEval_GetLocals()); ++} ++ + static PyMethodDef TestMethods[] = { + {"set_errno", set_errno, METH_VARARGS}, + {"test_config", test_config, METH_NOARGS}, +@@ -3476,6 +3482,7 @@ static PyMethodDef TestMethods[] = { + {"test_weakref_capi", test_weakref_capi, METH_NOARGS}, + {"function_set_warning", function_set_warning, METH_NOARGS}, + {"test_critical_sections", test_critical_sections, METH_NOARGS}, ++ {"pyeval_getlocals", pyeval_getlocals, METH_NOARGS}, + {NULL, NULL} /* sentinel */ + }; + +diff --git a/Python/ceval.c b/Python/ceval.c +index 866328e85b..351ddd2666 100644 +--- a/Python/ceval.c ++++ b/Python/ceval.c +@@ -2482,7 +2482,7 @@ PyEval_GetLocals(void) + PyFrameObject *f = _PyFrame_GetFrameObject(current_frame); + PyObject *ret = f->f_locals_cache; + if (ret == NULL) { +- PyObject *ret = PyDict_New(); ++ ret = PyDict_New(); + if (ret == NULL) { + Py_DECREF(locals); + return NULL; diff --git a/python3.13.spec b/python3.13.spec index ca25903..63bb831 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel rc1 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -397,6 +397,16 @@ Patch251: 00251-change-user-install-location.patch # Another process might have already moved jit_stencils.h.new Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch +# 00434 # 62b8e745105f68cec7016eccec1406911da01d66 +# gh-122728: Fix SystemError in PyEval_GetLocals() +# +# Fix PyEval_GetLocals() to avoid SystemError ("bad argument to +# internal function"). Don't redefine the 'ret' variable in the if +# block. +# +# Add an unit test on PyEval_GetLocals(). +Patch434: 00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1738,6 +1748,10 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Aug 06 2024 Miro Hrončok - 3.13.0~rc1-2 +- Fix SystemError in PyEval_GetLocals() +- Fixes: rhbz#2303107 + * Thu Aug 01 2024 Karolina Surma - 3.13.0~rc1-1 - Update to Python 3.13.0rc1 From 66bf96f29ad53edf98ec51799a01a54e78078688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 6 Aug 2024 23:23:11 +0200 Subject: [PATCH 044/115] Security fix for CVE-2024-6923 - Fixes: rhbz#2303160 --- ...headers-and-verify-headers-are-sound.patch | 362 ++++++++++++++++++ python3.13.spec | 25 ++ 2 files changed, 387 insertions(+) create mode 100644 00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch diff --git a/00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch b/00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch new file mode 100644 index 0000000..41cb737 --- /dev/null +++ b/00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch @@ -0,0 +1,362 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Miss Islington (bot)" + <31488909+miss-islington@users.noreply.github.com> +Date: Tue, 6 Aug 2024 19:06:41 +0200 +Subject: [PATCH] 00435: gh-121650: Encode newlines in headers, and verify + headers are sound + +Encode header parts that contain newlines + +Per RFC 2047: + +> [...] these encoding schemes allow the +> encoding of arbitrary octet values, mail readers that implement this +> decoding should also ensure that display of the decoded data on the +> recipient's terminal will not cause unwanted side-effects + +It seems that the "quoted-word" scheme is a valid way to include +a newline character in a header value, just like we already allow +undecodable bytes or control characters. +They do need to be properly quoted when serialized to text, though. + +Verify that email headers are well-formed + +This should fail for custom fold() implementations that aren't careful +about newlines. + +(cherry picked from commit 097633981879b3c9de9a1dd120d3aa585ecc2384) + +Co-authored-by: Petr Viktorin +Co-authored-by: Bas Bloemsaat +Co-authored-by: Serhiy Storchaka +--- + Doc/library/email.errors.rst | 7 +++ + Doc/library/email.policy.rst | 18 ++++++ + Doc/whatsnew/3.13.rst | 9 +++ + Lib/email/_header_value_parser.py | 12 +++- + Lib/email/_policybase.py | 8 +++ + Lib/email/errors.py | 4 ++ + Lib/email/generator.py | 13 +++- + Lib/test/test_email/test_generator.py | 62 +++++++++++++++++++ + Lib/test/test_email/test_policy.py | 26 ++++++++ + ...-07-27-16-10-41.gh-issue-121650.nf6oc9.rst | 5 ++ + 10 files changed, 160 insertions(+), 4 deletions(-) + create mode 100644 Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst + +diff --git a/Doc/library/email.errors.rst b/Doc/library/email.errors.rst +index 33ab426511..f8f43d82a3 100644 +--- a/Doc/library/email.errors.rst ++++ b/Doc/library/email.errors.rst +@@ -58,6 +58,13 @@ The following exception classes are defined in the :mod:`email.errors` module: + :class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g. + :class:`~email.mime.image.MIMEImage`). + ++ ++.. exception:: HeaderWriteError() ++ ++ Raised when an error occurs when the :mod:`~email.generator` outputs ++ headers. ++ ++ + .. exception:: MessageDefect() + + This is the base class for all defects found when parsing email messages. +diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst +index 83feedf728..314767d080 100644 +--- a/Doc/library/email.policy.rst ++++ b/Doc/library/email.policy.rst +@@ -229,6 +229,24 @@ added matters. To illustrate:: + + .. versionadded:: 3.6 + ++ ++ .. attribute:: verify_generated_headers ++ ++ If ``True`` (the default), the generator will raise ++ :exc:`~email.errors.HeaderWriteError` instead of writing a header ++ that is improperly folded or delimited, such that it would ++ be parsed as multiple headers or joined with adjacent data. ++ Such headers can be generated by custom header classes or bugs ++ in the ``email`` module. ++ ++ As it's a security feature, this defaults to ``True`` even in the ++ :class:`~email.policy.Compat32` policy. ++ For backwards compatible, but unsafe, behavior, it must be set to ++ ``False`` explicitly. ++ ++ .. versionadded:: 3.13 ++ ++ + The following :class:`Policy` method is intended to be called by code using + the email library to create policy instances with custom settings: + +diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst +index b53f419a59..35b808a4dd 100644 +--- a/Doc/whatsnew/3.13.rst ++++ b/Doc/whatsnew/3.13.rst +@@ -724,6 +724,15 @@ doctest + email + ----- + ++* Headers with embedded newlines are now quoted on output. ++ ++ The :mod:`~email.generator` will now refuse to serialize (write) headers ++ that are improperly folded or delimited, such that they would be parsed as ++ multiple headers or joined with adjacent data. ++ If you need to turn this safety feature off, ++ set :attr:`~email.policy.Policy.verify_generated_headers`. ++ (Contributed by Bas Bloemsaat and Petr Viktorin in :gh:`121650`.) ++ + * :func:`email.utils.getaddresses` and :func:`email.utils.parseaddr` now return + ``('', '')`` 2-tuples in more situations where invalid email addresses are + encountered instead of potentially inaccurate values. Add optional *strict* +diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py +index 7da1bbaf8a..ec2215a5e5 100644 +--- a/Lib/email/_header_value_parser.py ++++ b/Lib/email/_header_value_parser.py +@@ -92,6 +92,8 @@ + ASPECIALS = TSPECIALS | set("*'%") + ATTRIBUTE_ENDS = ASPECIALS | WSP + EXTENDED_ATTRIBUTE_ENDS = ATTRIBUTE_ENDS - set('%') ++NLSET = {'\n', '\r'} ++SPECIALSNL = SPECIALS | NLSET + + def quote_string(value): + return '"'+str(value).replace('\\', '\\\\').replace('"', r'\"')+'"' +@@ -2802,9 +2804,13 @@ def _refold_parse_tree(parse_tree, *, policy): + wrap_as_ew_blocked -= 1 + continue + tstr = str(part) +- if part.token_type == 'ptext' and set(tstr) & SPECIALS: +- # Encode if tstr contains special characters. +- want_encoding = True ++ if not want_encoding: ++ if part.token_type == 'ptext': ++ # Encode if tstr contains special characters. ++ want_encoding = not SPECIALSNL.isdisjoint(tstr) ++ else: ++ # Encode if tstr contains newlines. ++ want_encoding = not NLSET.isdisjoint(tstr) + try: + tstr.encode(encoding) + charset = encoding +diff --git a/Lib/email/_policybase.py b/Lib/email/_policybase.py +index 2ec54fbaba..5f9aa9fb09 100644 +--- a/Lib/email/_policybase.py ++++ b/Lib/email/_policybase.py +@@ -157,6 +157,13 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta): + message_factory -- the class to use to create new message objects. + If the value is None, the default is Message. + ++ verify_generated_headers ++ -- if true, the generator verifies that each header ++ they are properly folded, so that a parser won't ++ treat it as multiple headers, start-of-body, or ++ part of another header. ++ This is a check against custom Header & fold() ++ implementations. + """ + + raise_on_defect = False +@@ -165,6 +172,7 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta): + max_line_length = 78 + mangle_from_ = False + message_factory = None ++ verify_generated_headers = True + + def handle_defect(self, obj, defect): + """Based on policy, either raise defect or call register_defect. +diff --git a/Lib/email/errors.py b/Lib/email/errors.py +index 3ad0056554..02aa5eced6 100644 +--- a/Lib/email/errors.py ++++ b/Lib/email/errors.py +@@ -29,6 +29,10 @@ class CharsetError(MessageError): + """An illegal charset was given.""" + + ++class HeaderWriteError(MessageError): ++ """Error while writing headers.""" ++ ++ + # These are parsing defects which the parser was able to work around. + class MessageDefect(ValueError): + """Base class for a message defect.""" +diff --git a/Lib/email/generator.py b/Lib/email/generator.py +index c8056ad47b..47b9df8f4e 100644 +--- a/Lib/email/generator.py ++++ b/Lib/email/generator.py +@@ -14,12 +14,14 @@ + from copy import deepcopy + from io import StringIO, BytesIO + from email.utils import _has_surrogates ++from email.errors import HeaderWriteError + + UNDERSCORE = '_' + NL = '\n' # XXX: no longer used by the code below. + + NLCRE = re.compile(r'\r\n|\r|\n') + fcre = re.compile(r'^From ', re.MULTILINE) ++NEWLINE_WITHOUT_FWSP = re.compile(r'\r\n[^ \t]|\r[^ \n\t]|\n[^ \t]') + + + class Generator: +@@ -222,7 +224,16 @@ def _dispatch(self, msg): + + def _write_headers(self, msg): + for h, v in msg.raw_items(): +- self.write(self.policy.fold(h, v)) ++ folded = self.policy.fold(h, v) ++ if self.policy.verify_generated_headers: ++ linesep = self.policy.linesep ++ if not folded.endswith(self.policy.linesep): ++ raise HeaderWriteError( ++ f'folded header does not end with {linesep!r}: {folded!r}') ++ if NEWLINE_WITHOUT_FWSP.search(folded.removesuffix(linesep)): ++ raise HeaderWriteError( ++ f'folded header contains newline: {folded!r}') ++ self.write(folded) + # A blank line always separates headers from body + self.write(self._NL) + +diff --git a/Lib/test/test_email/test_generator.py b/Lib/test/test_email/test_generator.py +index bc6f734d4f..c75a842c33 100644 +--- a/Lib/test/test_email/test_generator.py ++++ b/Lib/test/test_email/test_generator.py +@@ -6,6 +6,7 @@ + from email.generator import Generator, BytesGenerator + from email.headerregistry import Address + from email import policy ++import email.errors + from test.test_email import TestEmailBase, parameterize + + +@@ -249,6 +250,44 @@ def test_rfc2231_wrapping_switches_to_default_len_if_too_narrow(self): + g.flatten(msg) + self.assertEqual(s.getvalue(), self.typ(expected)) + ++ def test_keep_encoded_newlines(self): ++ msg = self.msgmaker(self.typ(textwrap.dedent("""\ ++ To: nobody ++ Subject: Bad subject=?UTF-8?Q?=0A?=Bcc: injection@example.com ++ ++ None ++ """))) ++ expected = textwrap.dedent("""\ ++ To: nobody ++ Subject: Bad subject=?UTF-8?Q?=0A?=Bcc: injection@example.com ++ ++ None ++ """) ++ s = self.ioclass() ++ g = self.genclass(s, policy=self.policy.clone(max_line_length=80)) ++ g.flatten(msg) ++ self.assertEqual(s.getvalue(), self.typ(expected)) ++ ++ def test_keep_long_encoded_newlines(self): ++ msg = self.msgmaker(self.typ(textwrap.dedent("""\ ++ To: nobody ++ Subject: Bad subject=?UTF-8?Q?=0A?=Bcc: injection@example.com ++ ++ None ++ """))) ++ expected = textwrap.dedent("""\ ++ To: nobody ++ Subject: Bad subject ++ =?utf-8?q?=0A?=Bcc: ++ injection@example.com ++ ++ None ++ """) ++ s = self.ioclass() ++ g = self.genclass(s, policy=self.policy.clone(max_line_length=30)) ++ g.flatten(msg) ++ self.assertEqual(s.getvalue(), self.typ(expected)) ++ + + class TestGenerator(TestGeneratorBase, TestEmailBase): + +@@ -273,6 +312,29 @@ def test_flatten_unicode_linesep(self): + g.flatten(msg) + self.assertEqual(s.getvalue(), self.typ(expected)) + ++ def test_verify_generated_headers(self): ++ """gh-121650: by default the generator prevents header injection""" ++ class LiteralHeader(str): ++ name = 'Header' ++ def fold(self, **kwargs): ++ return self ++ ++ for text in ( ++ 'Value\r\nBad Injection\r\n', ++ 'NoNewLine' ++ ): ++ with self.subTest(text=text): ++ message = message_from_string( ++ "Header: Value\r\n\r\nBody", ++ policy=self.policy, ++ ) ++ ++ del message['Header'] ++ message['Header'] = LiteralHeader(text) ++ ++ with self.assertRaises(email.errors.HeaderWriteError): ++ message.as_string() ++ + + class TestBytesGenerator(TestGeneratorBase, TestEmailBase): + +diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py +index c6b9c80efe..baa35fd68e 100644 +--- a/Lib/test/test_email/test_policy.py ++++ b/Lib/test/test_email/test_policy.py +@@ -26,6 +26,7 @@ class PolicyAPITests(unittest.TestCase): + 'raise_on_defect': False, + 'mangle_from_': True, + 'message_factory': None, ++ 'verify_generated_headers': True, + } + # These default values are the ones set on email.policy.default. + # If any of these defaults change, the docs must be updated. +@@ -294,6 +295,31 @@ def test_short_maxlen_error(self): + with self.assertRaises(email.errors.HeaderParseError): + policy.fold("Subject", subject) + ++ def test_verify_generated_headers(self): ++ """Turning protection off allows header injection""" ++ policy = email.policy.default.clone(verify_generated_headers=False) ++ for text in ( ++ 'Header: Value\r\nBad: Injection\r\n', ++ 'Header: NoNewLine' ++ ): ++ with self.subTest(text=text): ++ message = email.message_from_string( ++ "Header: Value\r\n\r\nBody", ++ policy=policy, ++ ) ++ class LiteralHeader(str): ++ name = 'Header' ++ def fold(self, **kwargs): ++ return self ++ ++ del message['Header'] ++ message['Header'] = LiteralHeader(text) ++ ++ self.assertEqual( ++ message.as_string(), ++ f"{text}\nBody", ++ ) ++ + # XXX: Need subclassing tests. + # For adding subclassed objects, make sure the usual rules apply (subclass + # wins), but that the order still works (right overrides left). +diff --git a/Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst b/Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst +new file mode 100644 +index 0000000000..83dd28d4ac +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst +@@ -0,0 +1,5 @@ ++:mod:`email` headers with embedded newlines are now quoted on output. The ++:mod:`~email.generator` will now refuse to serialize (write) headers that ++are unsafely folded or delimited; see ++:attr:`~email.policy.Policy.verify_generated_headers`. (Contributed by Bas ++Bloemsaat and Petr Viktorin in :gh:`121650`.) diff --git a/python3.13.spec b/python3.13.spec index 63bb831..6b8d8a4 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -407,6 +407,29 @@ Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencil # Add an unit test on PyEval_GetLocals(). Patch434: 00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch +# 00435 # 66908394adb797c2c8463a74027c8646514423a0 +# gh-121650: Encode newlines in headers, and verify headers are sound +# +# Encode header parts that contain newlines +# +# Per RFC 2047: +# +# > [...] these encoding schemes allow the +# > encoding of arbitrary octet values, mail readers that implement this +# > decoding should also ensure that display of the decoded data on the +# > recipient's terminal will not cause unwanted side-effects +# +# It seems that the "quoted-word" scheme is a valid way to include +# a newline character in a header value, just like we already allow +# undecodable bytes or control characters. +# They do need to be properly quoted when serialized to text, though. +# +# Verify that email headers are well-formed +# +# This should fail for custom fold() implementations that aren't careful +# about newlines. +Patch435: 00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1751,6 +1774,8 @@ CheckPython freethreading * Tue Aug 06 2024 Miro Hrončok - 3.13.0~rc1-2 - Fix SystemError in PyEval_GetLocals() - Fixes: rhbz#2303107 +- Security fix for CVE-2024-6923 +- Fixes: rhbz#2303160 * Thu Aug 01 2024 Karolina Surma - 3.13.0~rc1-1 - Update to Python 3.13.0rc1 From b53472088c5c4304898053b4ce75c8e81f2d8a90 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 23 Aug 2024 15:32:50 +0200 Subject: [PATCH 045/115] Security fix for CVE-2024-8088 Fixes: rhbz#2307462 --- ...22905-sanitize-names-in-zipfile-path.patch | 122 ++++++++++++++++++ python3.13.spec | 10 +- 2 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch diff --git a/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch b/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch new file mode 100644 index 0000000..45eb865 --- /dev/null +++ b/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch @@ -0,0 +1,122 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Miss Islington (bot)" + <31488909+miss-islington@users.noreply.github.com> +Date: Mon, 12 Aug 2024 02:35:04 +0200 +Subject: [PATCH] 00436: [CVE-2024-8088] gh-122905: Sanitize names in + zipfile.Path. + +Co-authored-by: Jason R. Coombs +--- + Lib/test/test_zipfile/_path/test_path.py | 17 +++++ + Lib/zipfile/_path/__init__.py | 64 ++++++++++++++++++- + ...-08-11-14-08-04.gh-issue-122905.7tDsxA.rst | 1 + + 3 files changed, 81 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst + +diff --git a/Lib/test/test_zipfile/_path/test_path.py b/Lib/test/test_zipfile/_path/test_path.py +index 99842ffd63..4a31caee0b 100644 +--- a/Lib/test/test_zipfile/_path/test_path.py ++++ b/Lib/test/test_zipfile/_path/test_path.py +@@ -577,3 +577,20 @@ def test_getinfo_missing(self, alpharep): + zipfile.Path(alpharep) + with self.assertRaises(KeyError): + alpharep.getinfo('does-not-exist') ++ ++ def test_malformed_paths(self): ++ """ ++ Path should handle malformed paths. ++ """ ++ data = io.BytesIO() ++ zf = zipfile.ZipFile(data, "w") ++ zf.writestr("/one-slash.txt", b"content") ++ zf.writestr("//two-slash.txt", b"content") ++ zf.writestr("../parent.txt", b"content") ++ zf.filename = '' ++ root = zipfile.Path(zf) ++ assert list(map(str, root.iterdir())) == [ ++ 'one-slash.txt', ++ 'two-slash.txt', ++ 'parent.txt', ++ ] +diff --git a/Lib/zipfile/_path/__init__.py b/Lib/zipfile/_path/__init__.py +index f5ea18cee6..0f1814735c 100644 +--- a/Lib/zipfile/_path/__init__.py ++++ b/Lib/zipfile/_path/__init__.py +@@ -85,7 +85,69 @@ def __setstate__(self, state): + super().__init__(*args, **kwargs) + + +-class CompleteDirs(InitializedState, zipfile.ZipFile): ++class SanitizedNames: ++ """ ++ ZipFile mix-in to ensure names are sanitized. ++ """ ++ ++ def namelist(self): ++ return list(map(self._sanitize, super().namelist())) ++ ++ @staticmethod ++ def _sanitize(name): ++ r""" ++ Ensure a relative path with posix separators and no dot names. ++ ++ Modeled after ++ https://github.com/python/cpython/blob/bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c/Lib/zipfile/__init__.py#L1799-L1813 ++ but provides consistent cross-platform behavior. ++ ++ >>> san = SanitizedNames._sanitize ++ >>> san('/foo/bar') ++ 'foo/bar' ++ >>> san('//foo.txt') ++ 'foo.txt' ++ >>> san('foo/.././bar.txt') ++ 'foo/bar.txt' ++ >>> san('foo../.bar.txt') ++ 'foo../.bar.txt' ++ >>> san('\\foo\\bar.txt') ++ 'foo/bar.txt' ++ >>> san('D:\\foo.txt') ++ 'D/foo.txt' ++ >>> san('\\\\server\\share\\file.txt') ++ 'server/share/file.txt' ++ >>> san('\\\\?\\GLOBALROOT\\Volume3') ++ '?/GLOBALROOT/Volume3' ++ >>> san('\\\\.\\PhysicalDrive1\\root') ++ 'PhysicalDrive1/root' ++ ++ Retain any trailing slash. ++ >>> san('abc/') ++ 'abc/' ++ ++ Raises a ValueError if the result is empty. ++ >>> san('../..') ++ Traceback (most recent call last): ++ ... ++ ValueError: Empty filename ++ """ ++ ++ def allowed(part): ++ return part and part not in {'..', '.'} ++ ++ # Remove the drive letter. ++ # Don't use ntpath.splitdrive, because that also strips UNC paths ++ bare = re.sub('^([A-Z]):', r'\1', name, flags=re.IGNORECASE) ++ clean = bare.replace('\\', '/') ++ parts = clean.split('/') ++ joined = '/'.join(filter(allowed, parts)) ++ if not joined: ++ raise ValueError("Empty filename") ++ return joined + '/' * name.endswith('/') ++ ++ ++class CompleteDirs(InitializedState, SanitizedNames, zipfile.ZipFile): + """ + A ZipFile subclass that ensures that implied directories + are always included in the namelist. +diff --git a/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst b/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst +new file mode 100644 +index 0000000000..1be44c906c +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst +@@ -0,0 +1 @@ ++:class:`zipfile.Path` objects now sanitize names from the zipfile. diff --git a/python3.13.spec b/python3.13.spec index 6b8d8a4..b32cbf9 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel rc1 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -430,6 +430,10 @@ Patch434: 00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch # about newlines. Patch435: 00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch +# 00436 # c76cc2aa3a2c30375ade4859b732ada851cc89ed +# [CVE-2024-8088] gh-122905: Sanitize names in zipfile.Path. +Patch436: 00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1771,6 +1775,10 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Aug 23 2024 Charalampos Stratakis - 3.13.0~rc1-3 +- Security fix for CVE-2024-8088 +- Fixes: rhbz#2307462 + * Tue Aug 06 2024 Miro Hrončok - 3.13.0~rc1-2 - Fix SystemError in PyEval_GetLocals() - Fixes: rhbz#2303107 From 75fa60d507b795897b7d111a3b7ed228dd137f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 26 Aug 2024 11:23:49 +0200 Subject: [PATCH 046/115] Also skip test_abort_clients when building the package This is a fixup for f01f38eff5b3ddfe3b4fd657022bfada485a8832 Previously, the test only failed on CI; now it also fails in %check. --- python3.13.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index b32cbf9..6c30fde 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1330,6 +1330,7 @@ CheckPython() { # test_check_probes is failing since it was introduced in 3.12.0rc1, # the test is skipped until it is fixed in upstream. # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 + # test_abort_clients: https://github.com/python/cpython/issues/122136 # test_signal is skipped due to https://github.com/python/cpython/issues/118989 # test.test_concurrent_futures.test_deadlock tends to time out on s390x in # freethreading{,-debug} build, skipping it to shorten the build time @@ -1337,6 +1338,7 @@ CheckPython() { -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ -i test_check_probes \ + -i test_abort_clients \ %ifarch %{mips64} -x test_ctypes \ %endif From 222d4d99b9e56306a7dee4ec5051587b0892e18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 27 Aug 2024 12:28:44 +0200 Subject: [PATCH 047/115] Skip test_sendfile_close_peer_in_the_middle_of_receiving on ppc64le Reported upstream https://github.com/python/cpython/issues/123384 Which was a duplicate of https://github.com/python/cpython/issues/120226 The test is fixed on the main branch, but skipping is easier than backporting. The failure occurs with Kernel 6.10.x even when Python is built with an older Kernel. By skipping the tests, we can ship a CVE fix. --- python3.13.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index 6c30fde..360fe27 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1334,6 +1334,8 @@ CheckPython() { # test_signal is skipped due to https://github.com/python/cpython/issues/118989 # test.test_concurrent_futures.test_deadlock tends to time out on s390x in # freethreading{,-debug} build, skipping it to shorten the build time + # test_sendfile_close_peer_in_the_middle_of_receiving: + # https://github.com/python/cpython/issues/120226 LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ @@ -1346,6 +1348,9 @@ CheckPython() { -x test_signal \ -i test_deadlock \ %endif + %ifarch ppc64le + -i test_sendfile_close_peer_in_the_middle_of_receiving \ + %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName From 19f429832d8c6c345b338f10a59643f08b915208 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Sat, 7 Sep 2024 10:03:09 +0200 Subject: [PATCH 048/115] Update to Python 3.13.0rc2 --- ...ition-when-generating-jit_stencils-h.patch | 40 -- ...-fix-systemerror-in-pyeval_getlocals.patch | 90 ----- ...headers-and-verify-headers-are-sound.patch | 362 ------------------ ...22905-sanitize-names-in-zipfile-path.patch | 122 ------ python3.13.spec | 63 +-- sources | 4 +- 6 files changed, 13 insertions(+), 668 deletions(-) delete mode 100644 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch delete mode 100644 00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch delete mode 100644 00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch delete mode 100644 00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch diff --git a/00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch b/00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch deleted file mode 100644 index f6ab16e..0000000 --- a/00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Tue, 18 Jun 2024 15:25:31 +0200 -Subject: [PATCH] 00429: GH-118943: Fix another race condition when generating - jit_stencils.h - -Another process might have already moved jit_stencils.h.new ---- - .../Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst | 3 +++ - Tools/jit/_targets.py | 7 ++++++- - 2 files changed, 9 insertions(+), 1 deletion(-) - create mode 100644 Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst - -diff --git a/Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst b/Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst -new file mode 100644 -index 0000000000..997c990a96 ---- /dev/null -+++ b/Misc/NEWS.d/next/Build/2024-06-18-15-28-25.gh-issue-118943.aie7nn.rst -@@ -0,0 +1,3 @@ -+Fix a possible race condition affecting parallel builds configured with -+``--enable-experimental-jit``, in which :exc:`FileNotFoundError` could be caused by -+another process already moving ``jit_stencils.h.new`` to ``jit_stencils.h``. -diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py -index 5604c429bc..73d10a1287 100644 ---- a/Tools/jit/_targets.py -+++ b/Tools/jit/_targets.py -@@ -221,7 +221,12 @@ def build( - file.write("\n") - for line in _writer.dump(stencil_groups): - file.write(f"{line}\n") -- jit_stencils_new.replace(jit_stencils) -+ try: -+ jit_stencils_new.replace(jit_stencils) -+ except FileNotFoundError: -+ # another process probably already moved the file -+ if not jit_stencils.is_file(): -+ raise - finally: - jit_stencils_new.unlink(missing_ok=True) - diff --git a/00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch b/00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch deleted file mode 100644 index ebaad0d..0000000 --- a/00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Victor Stinner -Date: Tue, 6 Aug 2024 23:01:44 +0200 -Subject: [PATCH] 00434: gh-122728: Fix SystemError in PyEval_GetLocals() - -Fix PyEval_GetLocals() to avoid SystemError ("bad argument to -internal function"). Don't redefine the 'ret' variable in the if -block. - -Add an unit test on PyEval_GetLocals(). - -(cherry picked from commit 4767a6e31c0550836b2af45d27e374e721f0c4e6) ---- - Lib/test/test_capi/test_misc.py | 13 +++++++++++++ - .../2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst | 2 ++ - Modules/_testcapimodule.c | 7 +++++++ - Python/ceval.c | 2 +- - 4 files changed, 23 insertions(+), 1 deletion(-) - create mode 100644 Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst - -diff --git a/Lib/test/test_capi/test_misc.py b/Lib/test/test_capi/test_misc.py -index f3d16e4a2f..080b3e6533 100644 ---- a/Lib/test/test_capi/test_misc.py -+++ b/Lib/test/test_capi/test_misc.py -@@ -1180,6 +1180,19 @@ def genf(): yield - gen = genf() - self.assertEqual(_testcapi.gen_get_code(gen), gen.gi_code) - -+ def test_pyeval_getlocals(self): -+ # Test PyEval_GetLocals() -+ x = 1 -+ self.assertEqual(_testcapi.pyeval_getlocals(), -+ {'self': self, -+ 'x': 1}) -+ -+ y = 2 -+ self.assertEqual(_testcapi.pyeval_getlocals(), -+ {'self': self, -+ 'x': 1, -+ 'y': 2}) -+ - - @requires_limited_api - class TestHeapTypeRelative(unittest.TestCase): -diff --git a/Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst b/Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst -new file mode 100644 -index 0000000000..a128d6aef3 ---- /dev/null -+++ b/Misc/NEWS.d/next/C_API/2024-08-06-14-23-11.gh-issue-122728.l-fQ-v.rst -@@ -0,0 +1,2 @@ -+Fix :c:func:`PyEval_GetLocals` to avoid :exc:`SystemError` ("bad argument to -+internal function"). Patch by Victor Stinner. -diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c -index 1fa7c37841..01b6bd89d1 100644 ---- a/Modules/_testcapimodule.c -+++ b/Modules/_testcapimodule.c -@@ -3332,6 +3332,12 @@ test_critical_sections(PyObject *module, PyObject *Py_UNUSED(args)) - Py_RETURN_NONE; - } - -+static PyObject * -+pyeval_getlocals(PyObject *module, PyObject *Py_UNUSED(args)) -+{ -+ return Py_XNewRef(PyEval_GetLocals()); -+} -+ - static PyMethodDef TestMethods[] = { - {"set_errno", set_errno, METH_VARARGS}, - {"test_config", test_config, METH_NOARGS}, -@@ -3476,6 +3482,7 @@ static PyMethodDef TestMethods[] = { - {"test_weakref_capi", test_weakref_capi, METH_NOARGS}, - {"function_set_warning", function_set_warning, METH_NOARGS}, - {"test_critical_sections", test_critical_sections, METH_NOARGS}, -+ {"pyeval_getlocals", pyeval_getlocals, METH_NOARGS}, - {NULL, NULL} /* sentinel */ - }; - -diff --git a/Python/ceval.c b/Python/ceval.c -index 866328e85b..351ddd2666 100644 ---- a/Python/ceval.c -+++ b/Python/ceval.c -@@ -2482,7 +2482,7 @@ PyEval_GetLocals(void) - PyFrameObject *f = _PyFrame_GetFrameObject(current_frame); - PyObject *ret = f->f_locals_cache; - if (ret == NULL) { -- PyObject *ret = PyDict_New(); -+ ret = PyDict_New(); - if (ret == NULL) { - Py_DECREF(locals); - return NULL; diff --git a/00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch b/00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch deleted file mode 100644 index 41cb737..0000000 --- a/00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch +++ /dev/null @@ -1,362 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Tue, 6 Aug 2024 19:06:41 +0200 -Subject: [PATCH] 00435: gh-121650: Encode newlines in headers, and verify - headers are sound - -Encode header parts that contain newlines - -Per RFC 2047: - -> [...] these encoding schemes allow the -> encoding of arbitrary octet values, mail readers that implement this -> decoding should also ensure that display of the decoded data on the -> recipient's terminal will not cause unwanted side-effects - -It seems that the "quoted-word" scheme is a valid way to include -a newline character in a header value, just like we already allow -undecodable bytes or control characters. -They do need to be properly quoted when serialized to text, though. - -Verify that email headers are well-formed - -This should fail for custom fold() implementations that aren't careful -about newlines. - -(cherry picked from commit 097633981879b3c9de9a1dd120d3aa585ecc2384) - -Co-authored-by: Petr Viktorin -Co-authored-by: Bas Bloemsaat -Co-authored-by: Serhiy Storchaka ---- - Doc/library/email.errors.rst | 7 +++ - Doc/library/email.policy.rst | 18 ++++++ - Doc/whatsnew/3.13.rst | 9 +++ - Lib/email/_header_value_parser.py | 12 +++- - Lib/email/_policybase.py | 8 +++ - Lib/email/errors.py | 4 ++ - Lib/email/generator.py | 13 +++- - Lib/test/test_email/test_generator.py | 62 +++++++++++++++++++ - Lib/test/test_email/test_policy.py | 26 ++++++++ - ...-07-27-16-10-41.gh-issue-121650.nf6oc9.rst | 5 ++ - 10 files changed, 160 insertions(+), 4 deletions(-) - create mode 100644 Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst - -diff --git a/Doc/library/email.errors.rst b/Doc/library/email.errors.rst -index 33ab426511..f8f43d82a3 100644 ---- a/Doc/library/email.errors.rst -+++ b/Doc/library/email.errors.rst -@@ -58,6 +58,13 @@ The following exception classes are defined in the :mod:`email.errors` module: - :class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g. - :class:`~email.mime.image.MIMEImage`). - -+ -+.. exception:: HeaderWriteError() -+ -+ Raised when an error occurs when the :mod:`~email.generator` outputs -+ headers. -+ -+ - .. exception:: MessageDefect() - - This is the base class for all defects found when parsing email messages. -diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst -index 83feedf728..314767d080 100644 ---- a/Doc/library/email.policy.rst -+++ b/Doc/library/email.policy.rst -@@ -229,6 +229,24 @@ added matters. To illustrate:: - - .. versionadded:: 3.6 - -+ -+ .. attribute:: verify_generated_headers -+ -+ If ``True`` (the default), the generator will raise -+ :exc:`~email.errors.HeaderWriteError` instead of writing a header -+ that is improperly folded or delimited, such that it would -+ be parsed as multiple headers or joined with adjacent data. -+ Such headers can be generated by custom header classes or bugs -+ in the ``email`` module. -+ -+ As it's a security feature, this defaults to ``True`` even in the -+ :class:`~email.policy.Compat32` policy. -+ For backwards compatible, but unsafe, behavior, it must be set to -+ ``False`` explicitly. -+ -+ .. versionadded:: 3.13 -+ -+ - The following :class:`Policy` method is intended to be called by code using - the email library to create policy instances with custom settings: - -diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst -index b53f419a59..35b808a4dd 100644 ---- a/Doc/whatsnew/3.13.rst -+++ b/Doc/whatsnew/3.13.rst -@@ -724,6 +724,15 @@ doctest - email - ----- - -+* Headers with embedded newlines are now quoted on output. -+ -+ The :mod:`~email.generator` will now refuse to serialize (write) headers -+ that are improperly folded or delimited, such that they would be parsed as -+ multiple headers or joined with adjacent data. -+ If you need to turn this safety feature off, -+ set :attr:`~email.policy.Policy.verify_generated_headers`. -+ (Contributed by Bas Bloemsaat and Petr Viktorin in :gh:`121650`.) -+ - * :func:`email.utils.getaddresses` and :func:`email.utils.parseaddr` now return - ``('', '')`` 2-tuples in more situations where invalid email addresses are - encountered instead of potentially inaccurate values. Add optional *strict* -diff --git a/Lib/email/_header_value_parser.py b/Lib/email/_header_value_parser.py -index 7da1bbaf8a..ec2215a5e5 100644 ---- a/Lib/email/_header_value_parser.py -+++ b/Lib/email/_header_value_parser.py -@@ -92,6 +92,8 @@ - ASPECIALS = TSPECIALS | set("*'%") - ATTRIBUTE_ENDS = ASPECIALS | WSP - EXTENDED_ATTRIBUTE_ENDS = ATTRIBUTE_ENDS - set('%') -+NLSET = {'\n', '\r'} -+SPECIALSNL = SPECIALS | NLSET - - def quote_string(value): - return '"'+str(value).replace('\\', '\\\\').replace('"', r'\"')+'"' -@@ -2802,9 +2804,13 @@ def _refold_parse_tree(parse_tree, *, policy): - wrap_as_ew_blocked -= 1 - continue - tstr = str(part) -- if part.token_type == 'ptext' and set(tstr) & SPECIALS: -- # Encode if tstr contains special characters. -- want_encoding = True -+ if not want_encoding: -+ if part.token_type == 'ptext': -+ # Encode if tstr contains special characters. -+ want_encoding = not SPECIALSNL.isdisjoint(tstr) -+ else: -+ # Encode if tstr contains newlines. -+ want_encoding = not NLSET.isdisjoint(tstr) - try: - tstr.encode(encoding) - charset = encoding -diff --git a/Lib/email/_policybase.py b/Lib/email/_policybase.py -index 2ec54fbaba..5f9aa9fb09 100644 ---- a/Lib/email/_policybase.py -+++ b/Lib/email/_policybase.py -@@ -157,6 +157,13 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta): - message_factory -- the class to use to create new message objects. - If the value is None, the default is Message. - -+ verify_generated_headers -+ -- if true, the generator verifies that each header -+ they are properly folded, so that a parser won't -+ treat it as multiple headers, start-of-body, or -+ part of another header. -+ This is a check against custom Header & fold() -+ implementations. - """ - - raise_on_defect = False -@@ -165,6 +172,7 @@ class Policy(_PolicyBase, metaclass=abc.ABCMeta): - max_line_length = 78 - mangle_from_ = False - message_factory = None -+ verify_generated_headers = True - - def handle_defect(self, obj, defect): - """Based on policy, either raise defect or call register_defect. -diff --git a/Lib/email/errors.py b/Lib/email/errors.py -index 3ad0056554..02aa5eced6 100644 ---- a/Lib/email/errors.py -+++ b/Lib/email/errors.py -@@ -29,6 +29,10 @@ class CharsetError(MessageError): - """An illegal charset was given.""" - - -+class HeaderWriteError(MessageError): -+ """Error while writing headers.""" -+ -+ - # These are parsing defects which the parser was able to work around. - class MessageDefect(ValueError): - """Base class for a message defect.""" -diff --git a/Lib/email/generator.py b/Lib/email/generator.py -index c8056ad47b..47b9df8f4e 100644 ---- a/Lib/email/generator.py -+++ b/Lib/email/generator.py -@@ -14,12 +14,14 @@ - from copy import deepcopy - from io import StringIO, BytesIO - from email.utils import _has_surrogates -+from email.errors import HeaderWriteError - - UNDERSCORE = '_' - NL = '\n' # XXX: no longer used by the code below. - - NLCRE = re.compile(r'\r\n|\r|\n') - fcre = re.compile(r'^From ', re.MULTILINE) -+NEWLINE_WITHOUT_FWSP = re.compile(r'\r\n[^ \t]|\r[^ \n\t]|\n[^ \t]') - - - class Generator: -@@ -222,7 +224,16 @@ def _dispatch(self, msg): - - def _write_headers(self, msg): - for h, v in msg.raw_items(): -- self.write(self.policy.fold(h, v)) -+ folded = self.policy.fold(h, v) -+ if self.policy.verify_generated_headers: -+ linesep = self.policy.linesep -+ if not folded.endswith(self.policy.linesep): -+ raise HeaderWriteError( -+ f'folded header does not end with {linesep!r}: {folded!r}') -+ if NEWLINE_WITHOUT_FWSP.search(folded.removesuffix(linesep)): -+ raise HeaderWriteError( -+ f'folded header contains newline: {folded!r}') -+ self.write(folded) - # A blank line always separates headers from body - self.write(self._NL) - -diff --git a/Lib/test/test_email/test_generator.py b/Lib/test/test_email/test_generator.py -index bc6f734d4f..c75a842c33 100644 ---- a/Lib/test/test_email/test_generator.py -+++ b/Lib/test/test_email/test_generator.py -@@ -6,6 +6,7 @@ - from email.generator import Generator, BytesGenerator - from email.headerregistry import Address - from email import policy -+import email.errors - from test.test_email import TestEmailBase, parameterize - - -@@ -249,6 +250,44 @@ def test_rfc2231_wrapping_switches_to_default_len_if_too_narrow(self): - g.flatten(msg) - self.assertEqual(s.getvalue(), self.typ(expected)) - -+ def test_keep_encoded_newlines(self): -+ msg = self.msgmaker(self.typ(textwrap.dedent("""\ -+ To: nobody -+ Subject: Bad subject=?UTF-8?Q?=0A?=Bcc: injection@example.com -+ -+ None -+ """))) -+ expected = textwrap.dedent("""\ -+ To: nobody -+ Subject: Bad subject=?UTF-8?Q?=0A?=Bcc: injection@example.com -+ -+ None -+ """) -+ s = self.ioclass() -+ g = self.genclass(s, policy=self.policy.clone(max_line_length=80)) -+ g.flatten(msg) -+ self.assertEqual(s.getvalue(), self.typ(expected)) -+ -+ def test_keep_long_encoded_newlines(self): -+ msg = self.msgmaker(self.typ(textwrap.dedent("""\ -+ To: nobody -+ Subject: Bad subject=?UTF-8?Q?=0A?=Bcc: injection@example.com -+ -+ None -+ """))) -+ expected = textwrap.dedent("""\ -+ To: nobody -+ Subject: Bad subject -+ =?utf-8?q?=0A?=Bcc: -+ injection@example.com -+ -+ None -+ """) -+ s = self.ioclass() -+ g = self.genclass(s, policy=self.policy.clone(max_line_length=30)) -+ g.flatten(msg) -+ self.assertEqual(s.getvalue(), self.typ(expected)) -+ - - class TestGenerator(TestGeneratorBase, TestEmailBase): - -@@ -273,6 +312,29 @@ def test_flatten_unicode_linesep(self): - g.flatten(msg) - self.assertEqual(s.getvalue(), self.typ(expected)) - -+ def test_verify_generated_headers(self): -+ """gh-121650: by default the generator prevents header injection""" -+ class LiteralHeader(str): -+ name = 'Header' -+ def fold(self, **kwargs): -+ return self -+ -+ for text in ( -+ 'Value\r\nBad Injection\r\n', -+ 'NoNewLine' -+ ): -+ with self.subTest(text=text): -+ message = message_from_string( -+ "Header: Value\r\n\r\nBody", -+ policy=self.policy, -+ ) -+ -+ del message['Header'] -+ message['Header'] = LiteralHeader(text) -+ -+ with self.assertRaises(email.errors.HeaderWriteError): -+ message.as_string() -+ - - class TestBytesGenerator(TestGeneratorBase, TestEmailBase): - -diff --git a/Lib/test/test_email/test_policy.py b/Lib/test/test_email/test_policy.py -index c6b9c80efe..baa35fd68e 100644 ---- a/Lib/test/test_email/test_policy.py -+++ b/Lib/test/test_email/test_policy.py -@@ -26,6 +26,7 @@ class PolicyAPITests(unittest.TestCase): - 'raise_on_defect': False, - 'mangle_from_': True, - 'message_factory': None, -+ 'verify_generated_headers': True, - } - # These default values are the ones set on email.policy.default. - # If any of these defaults change, the docs must be updated. -@@ -294,6 +295,31 @@ def test_short_maxlen_error(self): - with self.assertRaises(email.errors.HeaderParseError): - policy.fold("Subject", subject) - -+ def test_verify_generated_headers(self): -+ """Turning protection off allows header injection""" -+ policy = email.policy.default.clone(verify_generated_headers=False) -+ for text in ( -+ 'Header: Value\r\nBad: Injection\r\n', -+ 'Header: NoNewLine' -+ ): -+ with self.subTest(text=text): -+ message = email.message_from_string( -+ "Header: Value\r\n\r\nBody", -+ policy=policy, -+ ) -+ class LiteralHeader(str): -+ name = 'Header' -+ def fold(self, **kwargs): -+ return self -+ -+ del message['Header'] -+ message['Header'] = LiteralHeader(text) -+ -+ self.assertEqual( -+ message.as_string(), -+ f"{text}\nBody", -+ ) -+ - # XXX: Need subclassing tests. - # For adding subclassed objects, make sure the usual rules apply (subclass - # wins), but that the order still works (right overrides left). -diff --git a/Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst b/Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst -new file mode 100644 -index 0000000000..83dd28d4ac ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2024-07-27-16-10-41.gh-issue-121650.nf6oc9.rst -@@ -0,0 +1,5 @@ -+:mod:`email` headers with embedded newlines are now quoted on output. The -+:mod:`~email.generator` will now refuse to serialize (write) headers that -+are unsafely folded or delimited; see -+:attr:`~email.policy.Policy.verify_generated_headers`. (Contributed by Bas -+Bloemsaat and Petr Viktorin in :gh:`121650`.) diff --git a/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch b/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch deleted file mode 100644 index 45eb865..0000000 --- a/00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Mon, 12 Aug 2024 02:35:04 +0200 -Subject: [PATCH] 00436: [CVE-2024-8088] gh-122905: Sanitize names in - zipfile.Path. - -Co-authored-by: Jason R. Coombs ---- - Lib/test/test_zipfile/_path/test_path.py | 17 +++++ - Lib/zipfile/_path/__init__.py | 64 ++++++++++++++++++- - ...-08-11-14-08-04.gh-issue-122905.7tDsxA.rst | 1 + - 3 files changed, 81 insertions(+), 1 deletion(-) - create mode 100644 Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst - -diff --git a/Lib/test/test_zipfile/_path/test_path.py b/Lib/test/test_zipfile/_path/test_path.py -index 99842ffd63..4a31caee0b 100644 ---- a/Lib/test/test_zipfile/_path/test_path.py -+++ b/Lib/test/test_zipfile/_path/test_path.py -@@ -577,3 +577,20 @@ def test_getinfo_missing(self, alpharep): - zipfile.Path(alpharep) - with self.assertRaises(KeyError): - alpharep.getinfo('does-not-exist') -+ -+ def test_malformed_paths(self): -+ """ -+ Path should handle malformed paths. -+ """ -+ data = io.BytesIO() -+ zf = zipfile.ZipFile(data, "w") -+ zf.writestr("/one-slash.txt", b"content") -+ zf.writestr("//two-slash.txt", b"content") -+ zf.writestr("../parent.txt", b"content") -+ zf.filename = '' -+ root = zipfile.Path(zf) -+ assert list(map(str, root.iterdir())) == [ -+ 'one-slash.txt', -+ 'two-slash.txt', -+ 'parent.txt', -+ ] -diff --git a/Lib/zipfile/_path/__init__.py b/Lib/zipfile/_path/__init__.py -index f5ea18cee6..0f1814735c 100644 ---- a/Lib/zipfile/_path/__init__.py -+++ b/Lib/zipfile/_path/__init__.py -@@ -85,7 +85,69 @@ def __setstate__(self, state): - super().__init__(*args, **kwargs) - - --class CompleteDirs(InitializedState, zipfile.ZipFile): -+class SanitizedNames: -+ """ -+ ZipFile mix-in to ensure names are sanitized. -+ """ -+ -+ def namelist(self): -+ return list(map(self._sanitize, super().namelist())) -+ -+ @staticmethod -+ def _sanitize(name): -+ r""" -+ Ensure a relative path with posix separators and no dot names. -+ -+ Modeled after -+ https://github.com/python/cpython/blob/bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c/Lib/zipfile/__init__.py#L1799-L1813 -+ but provides consistent cross-platform behavior. -+ -+ >>> san = SanitizedNames._sanitize -+ >>> san('/foo/bar') -+ 'foo/bar' -+ >>> san('//foo.txt') -+ 'foo.txt' -+ >>> san('foo/.././bar.txt') -+ 'foo/bar.txt' -+ >>> san('foo../.bar.txt') -+ 'foo../.bar.txt' -+ >>> san('\\foo\\bar.txt') -+ 'foo/bar.txt' -+ >>> san('D:\\foo.txt') -+ 'D/foo.txt' -+ >>> san('\\\\server\\share\\file.txt') -+ 'server/share/file.txt' -+ >>> san('\\\\?\\GLOBALROOT\\Volume3') -+ '?/GLOBALROOT/Volume3' -+ >>> san('\\\\.\\PhysicalDrive1\\root') -+ 'PhysicalDrive1/root' -+ -+ Retain any trailing slash. -+ >>> san('abc/') -+ 'abc/' -+ -+ Raises a ValueError if the result is empty. -+ >>> san('../..') -+ Traceback (most recent call last): -+ ... -+ ValueError: Empty filename -+ """ -+ -+ def allowed(part): -+ return part and part not in {'..', '.'} -+ -+ # Remove the drive letter. -+ # Don't use ntpath.splitdrive, because that also strips UNC paths -+ bare = re.sub('^([A-Z]):', r'\1', name, flags=re.IGNORECASE) -+ clean = bare.replace('\\', '/') -+ parts = clean.split('/') -+ joined = '/'.join(filter(allowed, parts)) -+ if not joined: -+ raise ValueError("Empty filename") -+ return joined + '/' * name.endswith('/') -+ -+ -+class CompleteDirs(InitializedState, SanitizedNames, zipfile.ZipFile): - """ - A ZipFile subclass that ensures that implied directories - are always included in the namelist. -diff --git a/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst b/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst -new file mode 100644 -index 0000000000..1be44c906c ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2024-08-11-14-08-04.gh-issue-122905.7tDsxA.rst -@@ -0,0 +1 @@ -+:class:`zipfile.Path` objects now sanitize names from the zipfile. diff --git a/python3.13.spec b/python3.13.spec index 360fe27..15cb11e 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel rc1 +%global prerel rc2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -68,7 +68,7 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 24.1.1 +%global pip_version 24.2 %global setuptools_version 67.6.1 %global wheel_version 0.43.0 # All of those also include a list of indirect bundled libs: @@ -76,23 +76,22 @@ License: Python-2.0.1 # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: Provides: bundled(python3dist(cachecontrol)) = 0.14 -Provides: bundled(python3dist(certifi)) = 2024.2.2 +Provides: bundled(python3dist(certifi)) = 2024.7.4 Provides: bundled(python3dist(distlib)) = 0.3.8 Provides: bundled(python3dist(distro)) = 1.9 Provides: bundled(python3dist(idna)) = 3.7 Provides: bundled(python3dist(msgpack)) = 1.0.8 Provides: bundled(python3dist(packaging)) = 24.1 -Provides: bundled(python3dist(platformdirs)) = 4.2.1 -Provides: bundled(python3dist(pygments)) = 2.17.2 +Provides: bundled(python3dist(platformdirs)) = 4.2.2 +Provides: bundled(python3dist(pygments)) = 2.18 Provides: bundled(python3dist(pyproject-hooks)) = 1 Provides: bundled(python3dist(requests)) = 2.32.3 Provides: bundled(python3dist(resolvelib)) = 1.0.1 Provides: bundled(python3dist(rich)) = 13.7.1 -Provides: bundled(python3dist(setuptools)) = 69.5.1 -Provides: bundled(python3dist(tenacity)) = 8.2.3 +Provides: bundled(python3dist(setuptools)) = 70.3 Provides: bundled(python3dist(tomli)) = 2.0.1 Provides: bundled(python3dist(truststore)) = 0.9.1 -Provides: bundled(python3dist(typing-extensions)) = 4.11 +Provides: bundled(python3dist(typing-extensions)) = 4.12.2 Provides: bundled(python3dist(urllib3)) = 1.26.18 } # setuptools @@ -391,49 +390,6 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00429 # fa7831be5e5365646d4dd400e23e977f83f64923 -# GH-118943: Fix another race condition when generating jit_stencils.h -# -# Another process might have already moved jit_stencils.h.new -Patch429: 00429-gh-118943-fix-another-race-condition-when-generating-jit_stencils-h.patch - -# 00434 # 62b8e745105f68cec7016eccec1406911da01d66 -# gh-122728: Fix SystemError in PyEval_GetLocals() -# -# Fix PyEval_GetLocals() to avoid SystemError ("bad argument to -# internal function"). Don't redefine the 'ret' variable in the if -# block. -# -# Add an unit test on PyEval_GetLocals(). -Patch434: 00434-gh-122728-fix-systemerror-in-pyeval_getlocals.patch - -# 00435 # 66908394adb797c2c8463a74027c8646514423a0 -# gh-121650: Encode newlines in headers, and verify headers are sound -# -# Encode header parts that contain newlines -# -# Per RFC 2047: -# -# > [...] these encoding schemes allow the -# > encoding of arbitrary octet values, mail readers that implement this -# > decoding should also ensure that display of the decoded data on the -# > recipient's terminal will not cause unwanted side-effects -# -# It seems that the "quoted-word" scheme is a valid way to include -# a newline character in a header value, just like we already allow -# undecodable bytes or control characters. -# They do need to be properly quoted when serialized to text, though. -# -# Verify that email headers are well-formed -# -# This should fail for custom fold() implementations that aren't careful -# about newlines. -Patch435: 00435-gh-121650-encode-newlines-in-headers-and-verify-headers-are-sound.patch - -# 00436 # c76cc2aa3a2c30375ade4859b732ada851cc89ed -# [CVE-2024-8088] gh-122905: Sanitize names in zipfile.Path. -Patch436: 00436-cve-2024-8088-gh-122905-sanitize-names-in-zipfile-path.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1782,6 +1738,9 @@ CheckPython freethreading # ====================================================== %changelog +* Sat Sep 07 2024 Karolina Surma - 3.13.0~rc2-1 +- Update to Python 3.13.0rc2 + * Fri Aug 23 2024 Charalampos Stratakis - 3.13.0~rc1-3 - Security fix for CVE-2024-8088 - Fixes: rhbz#2307462 diff --git a/sources b/sources index abde692..add3056 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0rc1.tar.xz) = fce7664f3298cfd191a7dc20b7b47acafdc50d058a2814312c94c30b65291395957d701e4661b9bb760417942acb5d27e5b8bb479bcda9a82cf29f53772a2daf -SHA512 (Python-3.13.0rc1.tar.xz.asc) = 3613829d9631f46b1b1ce11bfe5bb7fbfa49d97b639bb883c86737ea6ae8d15c24c526083cafb916011bd6d0b3b5fab2b17afd367edbdce99b32e0b4b845fd22 +SHA512 (Python-3.13.0rc2.tar.xz) = 85e6e6e80970ca38119e4f95880fb12e2d1548e6d60235cfcd7f6aaf08588c483469e43dda0f004b95455c2fb88ca736c313b22ae37eb0d4e6460ef521855c8d +SHA512 (Python-3.13.0rc2.tar.xz.asc) = 6d80d089b55910628744d21b0382b6441d0550c139dbee71d68a7cd9e494bff1c8235a2a894f3c7a52f9af312480a4001f333e04c9054f32db7eefd2a7d39263 From 75f739f5a9fc365b4556bfba441b0f0e5b042eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 9 Sep 2024 15:25:51 +0200 Subject: [PATCH 049/115] Revert "Skip test_sendfile_close_peer_in_the_middle_of_receiving on ppc64le" This was fixed upstream in https://github.com/python/cpython/pull/123421 This reverts commit 222d4d99b9e56306a7dee4ec5051587b0892e18c. --- python3.13.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 15cb11e..a8bb9b4 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1290,8 +1290,6 @@ CheckPython() { # test_signal is skipped due to https://github.com/python/cpython/issues/118989 # test.test_concurrent_futures.test_deadlock tends to time out on s390x in # freethreading{,-debug} build, skipping it to shorten the build time - # test_sendfile_close_peer_in_the_middle_of_receiving: - # https://github.com/python/cpython/issues/120226 LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ @@ -1304,9 +1302,6 @@ CheckPython() { -x test_signal \ -i test_deadlock \ %endif - %ifarch ppc64le - -i test_sendfile_close_peer_in_the_middle_of_receiving \ - %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName From 3758838aa7647355f29ec6028a9186484f8d10cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 9 Sep 2024 15:27:18 +0200 Subject: [PATCH 050/115] Revert "Skip test_abort_clients" This was fixed upstream in https://github.com/python/cpython/pull/123443 This reverts commit 75fa60d507b795897b7d111a3b7ed228dd137f01. This reverts commit f01f38eff5b3ddfe3b4fd657022bfada485a8832. --- python3.13.spec | 2 -- tests/tests.yml | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index a8bb9b4..7770c7f 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1286,7 +1286,6 @@ CheckPython() { # test_check_probes is failing since it was introduced in 3.12.0rc1, # the test is skipped until it is fixed in upstream. # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 - # test_abort_clients: https://github.com/python/cpython/issues/122136 # test_signal is skipped due to https://github.com/python/cpython/issues/118989 # test.test_concurrent_futures.test_deadlock tends to time out on s390x in # freethreading{,-debug} build, skipping it to shorten the build time @@ -1294,7 +1293,6 @@ CheckPython() { -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ -i test_check_probes \ - -i test_abort_clients \ %ifarch %{mips64} -x test_ctypes \ %endif diff --git a/tests/tests.yml b/tests/tests.yml index 2ba326a..fb2659f 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -30,11 +30,10 @@ run: "PYTHON=python{{ pybasever }}d TOX=false VERSION={{ pybasever }} CYTHON=false ./venv.sh" - selftest: dir: python/selftest - # test_abort_clients: https://github.com/python/cpython/issues/122136 - run: "VERSION={{ pybasever }} X='-i test_check_probes -i test_abort_clients' ./parallel.sh" + run: "VERSION={{ pybasever }} X='-i test_check_probes' ./parallel.sh" - debugtest: dir: python/selftest - run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes -i test_abort_clients' ./parallel.sh" + run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes' ./parallel.sh" - optimizedflags: dir: python/flags run: "python{{ pybasever }} ./assertflags.py -O3" From 9de4655645356c41fab23b85501ca0d0bb9c673d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 19 Sep 2024 00:08:35 +0200 Subject: [PATCH 051/115] Handle an empty AST body when reporting tracebacks - Fixes: rhbz#2311907 --- ...y-ast-body-when-reporting-tracebacks.patch | 83 +++++++++++++++++++ python3.13.spec | 10 ++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch diff --git a/00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch b/00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch new file mode 100644 index 0000000..9057e6b --- /dev/null +++ b/00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch @@ -0,0 +1,83 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= + <10796600+picnixz@users.noreply.github.com> +Date: Wed, 18 Sep 2024 18:42:33 +0200 +Subject: [PATCH] 00439: gh-122145: Handle an empty AST body when reporting + tracebacks + +(cherry picked from commit 5cd50cb6eb28e525f0c838e049e900ea982a5a23) +--- + Lib/test/test_traceback.py | 35 +++++++++++++++++++ + Lib/traceback.py | 2 ++ + ...-07-23-12-38-14.gh-issue-122145.sTO8nX.rst | 3 ++ + 3 files changed, 40 insertions(+) + create mode 100644 Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst + +diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py +index 574d5dab97..a78aded4cc 100644 +--- a/Lib/test/test_traceback.py ++++ b/Lib/test/test_traceback.py +@@ -3304,6 +3304,41 @@ def format_frame_summary(self, frame_summary, colorize=False): + f' File "{__file__}", line {lno}, in f\n 1/0\n' + ) + ++ def test_summary_should_show_carets(self): ++ # See: https://github.com/python/cpython/issues/122353 ++ ++ # statement to execute and to get a ZeroDivisionError for a traceback ++ statement = "abcdef = 1 / 0 and 2.0" ++ colno = statement.index('1 / 0') ++ end_colno = colno + len('1 / 0') ++ ++ # Actual line to use when rendering the traceback ++ # and whose AST will be extracted (it will be empty). ++ cached_line = '# this line will be used during rendering' ++ self.addCleanup(unlink, TESTFN) ++ with open(TESTFN, "w") as file: ++ file.write(cached_line) ++ linecache.updatecache(TESTFN, {}) ++ ++ try: ++ exec(compile(statement, TESTFN, "exec")) ++ except ZeroDivisionError as exc: ++ # This is the simplest way to create a StackSummary ++ # whose FrameSummary items have their column offsets. ++ s = traceback.TracebackException.from_exception(exc).stack ++ self.assertIsInstance(s, traceback.StackSummary) ++ with unittest.mock.patch.object(s, '_should_show_carets', ++ wraps=s._should_show_carets) as ff: ++ self.assertEqual(len(s), 2) ++ self.assertListEqual( ++ s.format_frame_summary(s[1]).splitlines(), ++ [ ++ f' File "{TESTFN}", line 1, in ', ++ f' {cached_line}' ++ ] ++ ) ++ ff.assert_called_with(colno, end_colno, [cached_line], None) ++ + class Unrepresentable: + def __repr__(self) -> str: + raise Exception("Unrepresentable") +diff --git a/Lib/traceback.py b/Lib/traceback.py +index 3e708c6f86..0fe7187a0c 100644 +--- a/Lib/traceback.py ++++ b/Lib/traceback.py +@@ -698,6 +698,8 @@ def _should_show_carets(self, start_offset, end_offset, all_lines, anchors): + with suppress(SyntaxError, ImportError): + import ast + tree = ast.parse('\n'.join(all_lines)) ++ if not tree.body: ++ return False + statement = tree.body[0] + value = None + def _spawns_full_line(value): +diff --git a/Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst b/Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst +new file mode 100644 +index 0000000000..a4282f12d9 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst +@@ -0,0 +1,3 @@ ++Fix an issue when reporting tracebacks corresponding to Python code ++emitting an empty AST body. ++Patch by Nikita Sobolev and Bénédikt Tran. diff --git a/python3.13.spec b/python3.13.spec index 7770c7f..4b37f74 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel rc2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -390,6 +390,10 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch +# 00439 # 5c3ace49fc6242246c8e54f2f904d483fb51aefa +# gh-122145: Handle an empty AST body when reporting tracebacks +Patch439: 00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1731,6 +1735,10 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Sep 18 2024 Miro Hrončok - 3.13.0~rc2-2 +- Handle an empty AST body when reporting tracebacks +- Fixes: rhbz#2311907 + * Sat Sep 07 2024 Karolina Surma - 3.13.0~rc2-1 - Update to Python 3.13.0rc2 From d3b035438f30099613c0f7e000bd37fcb872fc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 19 Sep 2024 18:48:13 +0200 Subject: [PATCH 052/115] Fix segfault when trying to use PyRun_SimpleString() with some imports --- ...to-update_global_state_for_extension.patch | 62 +++++++++++++++++++ python3.13.spec | 9 ++- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch diff --git a/00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch b/00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch new file mode 100644 index 0000000..1e9e1c0 --- /dev/null +++ b/00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: luk1337 +Date: Thu, 19 Sep 2024 18:05:20 +0200 +Subject: [PATCH] 00440: gh-124160: Pass main_tstate to + update_global_state_for_extension() + +(cherry picked from commit 7331d0f70bc9fbac177b76b6ec03486430383425) +--- + .../C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst | 2 ++ + Programs/_testembed.c | 9 +++++++++ + Python/import.c | 2 +- + 3 files changed, 12 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst + +diff --git a/Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst b/Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst +new file mode 100644 +index 0000000000..26e7aef08e +--- /dev/null ++++ b/Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst +@@ -0,0 +1,2 @@ ++Fix crash when importing modules containing state and single-phase ++initialization in a subinterpreter. +diff --git a/Programs/_testembed.c b/Programs/_testembed.c +index e341f0c6bf..96dbfabd7e 100644 +--- a/Programs/_testembed.c ++++ b/Programs/_testembed.c +@@ -94,6 +94,14 @@ static void _testembed_Py_Initialize(void) + } + + ++static int test_import_in_subinterpreters(void) ++{ ++ _testembed_Py_InitializeFromConfig(); ++ PyThreadState_Swap(Py_NewInterpreter()); ++ return PyRun_SimpleString("import readline"); // gh-124160 ++} ++ ++ + /***************************************************** + * Test repeated initialisation and subinterpreters + *****************************************************/ +@@ -2184,6 +2192,7 @@ static struct TestCase TestCases[] = { + {"test_repeated_init_exec", test_repeated_init_exec}, + {"test_repeated_simple_init", test_repeated_simple_init}, + {"test_forced_io_encoding", test_forced_io_encoding}, ++ {"test_import_in_subinterpreters", test_import_in_subinterpreters}, + {"test_repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters}, + {"test_repeated_init_and_inittab", test_repeated_init_and_inittab}, + {"test_pre_initialization_api", test_pre_initialization_api}, +diff --git a/Python/import.c b/Python/import.c +index 1056ddd370..be00c0b015 100644 +--- a/Python/import.c ++++ b/Python/import.c +@@ -2044,7 +2044,7 @@ import_run_extension(PyThreadState *tstate, PyModInitFunction p0, + singlephase.m_init = p0; + } + cached = update_global_state_for_extension( +- tstate, info->path, info->name, def, &singlephase); ++ main_tstate, info->path, info->name, def, &singlephase); + if (cached == NULL) { + assert(PyErr_Occurred()); + goto main_finally; diff --git a/python3.13.spec b/python3.13.spec index 4b37f74..247e62f 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ %global prerel rc2 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -394,6 +394,10 @@ Patch251: 00251-change-user-install-location.patch # gh-122145: Handle an empty AST body when reporting tracebacks Patch439: 00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch +# 00440 # 7c35d4da60c9edc333a7031434bf114660e1ad34 +# gh-124160: Pass main_tstate to update_global_state_for_extension() +Patch440: 00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1735,6 +1739,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Sep 19 2024 Miro Hrončok - 3.13.0~rc2-3 +- Fix segfault when trying to use PyRun_SimpleString() with some imports + * Wed Sep 18 2024 Miro Hrončok - 3.13.0~rc2-2 - Handle an empty AST body when reporting tracebacks - Fixes: rhbz#2311907 From 7aec56a73fcebef8206f9a1623e2c455d1b480b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 1 Oct 2024 17:36:42 +0200 Subject: [PATCH 053/115] Update to Python 3.13.0rc3 --- ...y-ast-body-when-reporting-tracebacks.patch | 83 ------------------- ...to-update_global_state_for_extension.patch | 62 -------------- python3.13.spec | 15 ++-- sources | 4 +- 4 files changed, 7 insertions(+), 157 deletions(-) delete mode 100644 00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch delete mode 100644 00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch diff --git a/00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch b/00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch deleted file mode 100644 index 9057e6b..0000000 --- a/00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?B=C3=A9n=C3=A9dikt=20Tran?= - <10796600+picnixz@users.noreply.github.com> -Date: Wed, 18 Sep 2024 18:42:33 +0200 -Subject: [PATCH] 00439: gh-122145: Handle an empty AST body when reporting - tracebacks - -(cherry picked from commit 5cd50cb6eb28e525f0c838e049e900ea982a5a23) ---- - Lib/test/test_traceback.py | 35 +++++++++++++++++++ - Lib/traceback.py | 2 ++ - ...-07-23-12-38-14.gh-issue-122145.sTO8nX.rst | 3 ++ - 3 files changed, 40 insertions(+) - create mode 100644 Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst - -diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py -index 574d5dab97..a78aded4cc 100644 ---- a/Lib/test/test_traceback.py -+++ b/Lib/test/test_traceback.py -@@ -3304,6 +3304,41 @@ def format_frame_summary(self, frame_summary, colorize=False): - f' File "{__file__}", line {lno}, in f\n 1/0\n' - ) - -+ def test_summary_should_show_carets(self): -+ # See: https://github.com/python/cpython/issues/122353 -+ -+ # statement to execute and to get a ZeroDivisionError for a traceback -+ statement = "abcdef = 1 / 0 and 2.0" -+ colno = statement.index('1 / 0') -+ end_colno = colno + len('1 / 0') -+ -+ # Actual line to use when rendering the traceback -+ # and whose AST will be extracted (it will be empty). -+ cached_line = '# this line will be used during rendering' -+ self.addCleanup(unlink, TESTFN) -+ with open(TESTFN, "w") as file: -+ file.write(cached_line) -+ linecache.updatecache(TESTFN, {}) -+ -+ try: -+ exec(compile(statement, TESTFN, "exec")) -+ except ZeroDivisionError as exc: -+ # This is the simplest way to create a StackSummary -+ # whose FrameSummary items have their column offsets. -+ s = traceback.TracebackException.from_exception(exc).stack -+ self.assertIsInstance(s, traceback.StackSummary) -+ with unittest.mock.patch.object(s, '_should_show_carets', -+ wraps=s._should_show_carets) as ff: -+ self.assertEqual(len(s), 2) -+ self.assertListEqual( -+ s.format_frame_summary(s[1]).splitlines(), -+ [ -+ f' File "{TESTFN}", line 1, in ', -+ f' {cached_line}' -+ ] -+ ) -+ ff.assert_called_with(colno, end_colno, [cached_line], None) -+ - class Unrepresentable: - def __repr__(self) -> str: - raise Exception("Unrepresentable") -diff --git a/Lib/traceback.py b/Lib/traceback.py -index 3e708c6f86..0fe7187a0c 100644 ---- a/Lib/traceback.py -+++ b/Lib/traceback.py -@@ -698,6 +698,8 @@ def _should_show_carets(self, start_offset, end_offset, all_lines, anchors): - with suppress(SyntaxError, ImportError): - import ast - tree = ast.parse('\n'.join(all_lines)) -+ if not tree.body: -+ return False - statement = tree.body[0] - value = None - def _spawns_full_line(value): -diff --git a/Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst b/Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst -new file mode 100644 -index 0000000000..a4282f12d9 ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2024-07-23-12-38-14.gh-issue-122145.sTO8nX.rst -@@ -0,0 +1,3 @@ -+Fix an issue when reporting tracebacks corresponding to Python code -+emitting an empty AST body. -+Patch by Nikita Sobolev and Bénédikt Tran. diff --git a/00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch b/00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch deleted file mode 100644 index 1e9e1c0..0000000 --- a/00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: luk1337 -Date: Thu, 19 Sep 2024 18:05:20 +0200 -Subject: [PATCH] 00440: gh-124160: Pass main_tstate to - update_global_state_for_extension() - -(cherry picked from commit 7331d0f70bc9fbac177b76b6ec03486430383425) ---- - .../C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst | 2 ++ - Programs/_testembed.c | 9 +++++++++ - Python/import.c | 2 +- - 3 files changed, 12 insertions(+), 1 deletion(-) - create mode 100644 Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst - -diff --git a/Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst b/Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst -new file mode 100644 -index 0000000000..26e7aef08e ---- /dev/null -+++ b/Misc/NEWS.d/next/C_API/2024-09-18-18-40-30.gh-issue-124160.Zy-VKi.rst -@@ -0,0 +1,2 @@ -+Fix crash when importing modules containing state and single-phase -+initialization in a subinterpreter. -diff --git a/Programs/_testembed.c b/Programs/_testembed.c -index e341f0c6bf..96dbfabd7e 100644 ---- a/Programs/_testembed.c -+++ b/Programs/_testembed.c -@@ -94,6 +94,14 @@ static void _testembed_Py_Initialize(void) - } - - -+static int test_import_in_subinterpreters(void) -+{ -+ _testembed_Py_InitializeFromConfig(); -+ PyThreadState_Swap(Py_NewInterpreter()); -+ return PyRun_SimpleString("import readline"); // gh-124160 -+} -+ -+ - /***************************************************** - * Test repeated initialisation and subinterpreters - *****************************************************/ -@@ -2184,6 +2192,7 @@ static struct TestCase TestCases[] = { - {"test_repeated_init_exec", test_repeated_init_exec}, - {"test_repeated_simple_init", test_repeated_simple_init}, - {"test_forced_io_encoding", test_forced_io_encoding}, -+ {"test_import_in_subinterpreters", test_import_in_subinterpreters}, - {"test_repeated_init_and_subinterpreters", test_repeated_init_and_subinterpreters}, - {"test_repeated_init_and_inittab", test_repeated_init_and_inittab}, - {"test_pre_initialization_api", test_pre_initialization_api}, -diff --git a/Python/import.c b/Python/import.c -index 1056ddd370..be00c0b015 100644 ---- a/Python/import.c -+++ b/Python/import.c -@@ -2044,7 +2044,7 @@ import_run_extension(PyThreadState *tstate, PyModInitFunction p0, - singlephase.m_init = p0; - } - cached = update_global_state_for_extension( -- tstate, info->path, info->name, def, &singlephase); -+ main_tstate, info->path, info->name, def, &singlephase); - if (cached == NULL) { - assert(PyErr_Occurred()); - goto main_finally; diff --git a/python3.13.spec b/python3.13.spec index 247e62f..f7c1569 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,10 +14,10 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel rc2 +%global prerel rc3 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -390,14 +390,6 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00439 # 5c3ace49fc6242246c8e54f2f904d483fb51aefa -# gh-122145: Handle an empty AST body when reporting tracebacks -Patch439: 00439-gh-122145-handle-an-empty-ast-body-when-reporting-tracebacks.patch - -# 00440 # 7c35d4da60c9edc333a7031434bf114660e1ad34 -# gh-124160: Pass main_tstate to update_global_state_for_extension() -Patch440: 00440-gh-124160-pass-main_tstate-to-update_global_state_for_extension.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1739,6 +1731,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Oct 01 2024 Miro Hrončok - 3.13.0~rc3-1 +- Update to Python 3.13.0rc3 + * Thu Sep 19 2024 Miro Hrončok - 3.13.0~rc2-3 - Fix segfault when trying to use PyRun_SimpleString() with some imports diff --git a/sources b/sources index add3056..5f44b91 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0rc2.tar.xz) = 85e6e6e80970ca38119e4f95880fb12e2d1548e6d60235cfcd7f6aaf08588c483469e43dda0f004b95455c2fb88ca736c313b22ae37eb0d4e6460ef521855c8d -SHA512 (Python-3.13.0rc2.tar.xz.asc) = 6d80d089b55910628744d21b0382b6441d0550c139dbee71d68a7cd9e494bff1c8235a2a894f3c7a52f9af312480a4001f333e04c9054f32db7eefd2a7d39263 +SHA512 (Python-3.13.0rc3.tar.xz) = 152e5b6d64048c1779612e66d5999c424ca7c61c8a0f4973f7b3019629d6a7923b422aec0bee30e7bc2d589a807d87e15a19b8fb4446bcf082eb663885a49b36 +SHA512 (Python-3.13.0rc3.tar.xz.asc) = c8f80b12f5e3021a11fc3ef5ce84572db9de7165ce89a03206cb0727b54f90ca2e444a16df064e6423e15b7bf2364db088b0c9315967dd340e735eabf7b892ce From 1299ef87250481065298e530bdacf9838bdac4da Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 8 Oct 2024 09:39:13 +0200 Subject: [PATCH 054/115] Update to Python 3.13.0 --- python3.13.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index f7c1569..9e10180 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.0 -%global prerel rc3 +#global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} Release: 1%{?dist} @@ -1731,6 +1731,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Oct 08 2024 Karolina Surma - 3.13.0-1 +- Update to Python 3.13.0 + * Tue Oct 01 2024 Miro Hrončok - 3.13.0~rc3-1 - Update to Python 3.13.0rc3 diff --git a/sources b/sources index 5f44b91..9cf507c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0rc3.tar.xz) = 152e5b6d64048c1779612e66d5999c424ca7c61c8a0f4973f7b3019629d6a7923b422aec0bee30e7bc2d589a807d87e15a19b8fb4446bcf082eb663885a49b36 -SHA512 (Python-3.13.0rc3.tar.xz.asc) = c8f80b12f5e3021a11fc3ef5ce84572db9de7165ce89a03206cb0727b54f90ca2e444a16df064e6423e15b7bf2364db088b0c9315967dd340e735eabf7b892ce +SHA512 (Python-3.13.0.tar.xz) = 44a143c9b96b55b01885ec020c3364265bda55289615cd7d5071915b0d0178a6f35e7551a89090001fcb7f3172d38177a56bf8b8532b15c9dbc50295c9210152 +SHA512 (Python-3.13.0.tar.xz.asc) = 1b8bb0fe4eb93e31ec1770e90b94d44b5864c0391aad5dcba3a30d8e505d9b17107385414353c0060007f8a536254f49b8e919f36ddf6421a6e4330f817f1a3e From f443f05bcfa284a54c557adc33f92a7c0672d6e6 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 8 Oct 2024 12:11:07 +0200 Subject: [PATCH 055/115] Skip test_signal and test_deadlock on ppc64le --- python3.13.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 9e10180..ca07111 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1287,8 +1287,9 @@ CheckPython() { # the test is skipped until it is fixed in upstream. # see: https://github.com/python/cpython/issues/104280#issuecomment-1669249980 # test_signal is skipped due to https://github.com/python/cpython/issues/118989 - # test.test_concurrent_futures.test_deadlock tends to time out on s390x in + # test.test_concurrent_futures.test_deadlock tends to time out on s390x and ppc64le in # freethreading{,-debug} build, skipping it to shorten the build time + # see: https://github.com/python/cpython/issues/121719 LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest %{_smp_mflags} --timeout=2700 \ -i test_freeze_simple_script \ @@ -1296,7 +1297,7 @@ CheckPython() { %ifarch %{mips64} -x test_ctypes \ %endif - %ifarch s390x + %ifarch s390x ppc64le -x test_signal \ -i test_deadlock \ %endif From a8ce422a93903af0224b0a222da98b7c77d3185f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 14 Oct 2024 12:00:50 +0200 Subject: [PATCH 056/115] CI: Explicitly lists flags to be checked for -O3/-O0 Not listing the flags skips the ones without -O. This way, we no longer assert -O3/-O2 is the only -O flag, but we also assert it is actually set. --- tests/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/tests.yml b/tests/tests.yml index fb2659f..8a4ba6b 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -36,16 +36,16 @@ run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes' ./parallel.sh" - optimizedflags: dir: python/flags - run: "python{{ pybasever }} ./assertflags.py -O3" + run: "python{{ pybasever }} ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - debugflags: dir: python/flags - run: "python{{ pybasever }}d ./assertflags.py -O0" + run: "python{{ pybasever }}d ./assertflags.py -O0 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - freethreadingflags: dir: python/flags - run: "python{{ pybasever }}t ./assertflags.py -O3" + run: "python{{ pybasever }}t ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - freethreadingdebugflags: dir: python/flags - run: "python{{ pybasever }}td ./assertflags.py -O0" + run: "python{{ pybasever }}td ./assertflags.py -O0 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - marshalparser: dir: python/marshalparser run: "VERSION={{ pybasever }} SAMPLE=10 test_marshalparser_compatibility.sh" From 7fc2da03e52a52e09d2ca4aa52f2748f88e55ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 15 Oct 2024 18:16:01 +0200 Subject: [PATCH 057/115] Use new-style RPM bconds --- python3.13.spec | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index ca07111..cd7a33c 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -25,27 +25,16 @@ License: Python-2.0.1 # Conditionals controlling the build # ================================== -# Note that the bcond macros are named for the CLI option they create. -# "%%bcond_without" means "ENABLE by default and create a --without option" - # Main Python, i.e. whether this is the main Python version in the distribution # that owns /usr/bin/python3 and other unique paths # This also means the built subpackages are called python3 rather than python3X # By default, this is determined by the %%__default_python3_pkgversion value -%if "%{?__default_python3_pkgversion}" == "%{pybasever}" -%bcond_without main_python -%else -%bcond_with main_python -%endif +%bcond main_python %["%{?__default_python3_pkgversion}" == "%{pybasever}"] # If this is *not* Main Python, should it contain `Provides: python(abi) ...`? # In Fedora no package shall depend on an alternative Python via this tag, so we do not provide it. # In ELN/RHEL/CentOS we want to allow building against alternative stacks, so the Provide is enabled. -%if 0%{?fedora} -%bcond_with python_abi_provides_for_alt_pythons -%else -%bcond_without python_abi_provides_for_alt_pythons -%endif +%bcond python_abi_provides_for_alt_pythons %{undefined fedora} # When bootstrapping python3, we need to build python3-packaging. # but packaging BR python3-devel and that brings in python3-rpm-generators; @@ -58,11 +47,11 @@ License: Python-2.0.1 # IMPORTANT: When bootstrapping, it's very likely python-pip-wheel is # not available. Turn off the rpmwheels bcond until # python-pip is built with a wheel to get around the issue. -%bcond_with bootstrap +%bcond bootstrap 0 # Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages # Uses upstream bundled prebuilt wheels otherwise -%bcond_without rpmwheels +%bcond rpmwheels 1 # If the rpmwheels condition is disabled, we use the bundled wheel packages # from Python with the versions below. # This needs to be manually updated when we update Python. @@ -119,49 +108,45 @@ Provides: bundled(python3dist(packaging)) = 24 } # Expensive optimizations (mainly, profile-guided optimizations) -%bcond_without optimizations +%bcond optimizations 1 # Run the test suite in %%check -%bcond_without tests +%bcond tests 1 # Extra build for debugging the interpreter or C-API extensions # (the -debug subpackages) -%bcond_without debug_build +%bcond debug_build 1 # Extra build without GIL, the freethreading PEP 703 provisional way # (the -freethreading subpackage) -%bcond_without freethreading_build +%bcond freethreading_build 1 # PEP 744: JIT Compilation # Whether to build with the experimental JIT compiler # We can only have this on Fedora 40+, where clang 18+ is available # And only on certain architectures: https://peps.python.org/pep-0744/#support # The freethreading build (when enabled) does not support JIT yet -%bcond_with jit -%ifarch x86_64 aarch64 -%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10 -%bcond_without jit -%endif -%endif +%bcond jit %[(0%{?fedora} >= 40 || 0%{?rhel} >= 10) && ("%{_arch}" == "x86_64" || "%{_arch}" == "aarch64")] %if %{with jit} # When built with JIT, it still needs to be enabled on runtime via PYTHON_JIT=1 %global jit_flag --enable-experimental-jit=yes-off %endif # Support for the GDB debugger -%bcond_without gdb_hooks +%bcond gdb_hooks 1 # The dbm.gnu module (key-value database) -%bcond_without gdbm +%bcond gdbm 1 # Main interpreter loop optimization -%bcond_without computed_gotos +%bcond computed_gotos 1 # Support for the Valgrind debugger/profiler +# (no way to use %%ifarch as an expression) %ifarch %{valgrind_arches} -%bcond_without valgrind +%bcond valgrind 1 %else -%bcond_with valgrind +%bcond valgrind 0 %endif # ===================== From 90ea69d66a261165ec6bbb911bb3c20970923e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 15 Oct 2024 18:18:17 +0200 Subject: [PATCH 058/115] Remove rarely used bconds I have not used those in ~12 years. --- python3.13.spec | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index cd7a33c..c9ff579 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -132,12 +132,6 @@ Provides: bundled(python3dist(packaging)) = 24 %global jit_flag --enable-experimental-jit=yes-off %endif -# Support for the GDB debugger -%bcond gdb_hooks 1 - -# The dbm.gnu module (key-value database) -%bcond gdbm 1 - # Main interpreter loop optimization %bcond computed_gotos 1 @@ -262,6 +256,7 @@ BuildRequires: bzip2-devel BuildRequires: expat-devel >= 2.6 BuildRequires: findutils BuildRequires: gcc +BuildRequires: gdbm-devel BuildRequires: git-core BuildRequires: glibc-devel BuildRequires: gnupg2 @@ -304,10 +299,6 @@ BuildRequires: llvm(major) = 18 BuildRequires: valgrind-devel %endif -%if %{with gdbm} -BuildRequires: gdbm-devel -%endif - %if %{with main_python} BuildRequires: desktop-file-utils BuildRequires: libappstream-glib @@ -962,10 +953,8 @@ topdir=$(pwd) # See https://fedoraproject.org/wiki/Features/EasierPythonDebugging for more # information -%if %{with gdb_hooks} DirHoldingGdbPy=%{_usr}/lib/debug/%{_libdir} mkdir -p %{buildroot}$DirHoldingGdbPy -%endif # with gdb_hooks # When the actual %%{dynload_dir} exists (it does when python3.X is installed for regen-all) # %%{buildroot}%%{dynload_dir} is not created by make install and the extension modules are missing @@ -1002,11 +991,9 @@ InstallPython() { popd -%if %{with gdb_hooks} # See comment on $DirHoldingGdbPy above PathOfGdbPy=$DirHoldingGdbPy/$PyInstSoName-%{version}-%{release}.%{_arch}.debug-gdb.py cp Tools/gdb/libpython.py %{buildroot}$PathOfGdbPy -%endif # with gdb_hooks # Rename the -devel script that differs on different arches to arch specific name mv %{buildroot}%{_bindir}/python${LDVersion}-{,`uname -m`-}config @@ -1113,7 +1100,7 @@ LD_LIBRARY_PATH=./build/optimized ./build/optimized/python \ -i "%{_bindir}/python%{pybasever}" -pn \ %{buildroot} \ %{buildroot}%{_bindir}/*%{pybasever}.py \ - %{?with_gdb_hooks:%{buildroot}$DirHoldingGdbPy/*.py} + %{buildroot}$DirHoldingGdbPy/*.py # Remove shebang lines from .py files that aren't executable, and # remove executability from .py files that don't have a shebang line: @@ -1423,9 +1410,7 @@ CheckPython freethreading %{1}/_curses_panel.%{2}.so\ %{1}/_datetime.%{2}.so\ %{1}/_dbm.%{2}.so\ -%if %{with gdbm}\ %{1}/_gdbm.%{2}.so\ -%endif\ %{1}/_decimal.%{2}.so\ %{1}/_elementtree.%{2}.so\ %{1}/_hashlib.%{2}.so\ From 461d9adf9eaa7713ecdca3fef949d4f01ba1563a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 15 Oct 2024 18:19:14 +0200 Subject: [PATCH 059/115] Turn valgrind bcond into in-place %ifarch There's no way to turn this bcond off on arches where it is not supported. There's no need to turn this bcond on on arches where it is supported. --- python3.13.spec | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index c9ff579..4cf7517 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -135,14 +135,6 @@ Provides: bundled(python3dist(packaging)) = 24 # Main interpreter loop optimization %bcond computed_gotos 1 -# Support for the Valgrind debugger/profiler -# (no way to use %%ifarch as an expression) -%ifarch %{valgrind_arches} -%bcond valgrind 1 -%else -%bcond valgrind 0 -%endif - # ===================== # General global macros # ===================== @@ -295,7 +287,7 @@ BuildRequires: clang(major) = 18 BuildRequires: llvm(major) = 18 %endif -%if %{with valgrind} +%ifarch %{valgrind_arches} BuildRequires: valgrind-devel %endif @@ -877,7 +869,7 @@ BuildPython() { %if %{with rpmwheels} --with-wheel-pkg-dir=%{python_wheel_dir} \ %endif -%if %{with valgrind} +%ifarch %{valgrind_arches} --with-valgrind \ %endif $ExtraConfigArgs \ From a5d0a1835edcf93e874638c799bbd995e44170f6 Mon Sep 17 00:00:00 2001 From: U2FsdGVkX1 Date: Wed, 13 Nov 2024 20:17:42 +0800 Subject: [PATCH 060/115] Increase the timeout for riscv64 because the current RISC-V CPU has slower performance. --- python3.13.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 4cf7517..bee5a28 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1255,7 +1255,12 @@ CheckPython() { # freethreading{,-debug} build, skipping it to shorten the build time # see: https://github.com/python/cpython/issues/121719 LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ - -wW --slowest %{_smp_mflags} --timeout=2700 \ + -wW --slowest %{_smp_mflags} \ + %ifarch riscv64 + --timeout=8100 \ + %else + --timeout=2700 \ + %endif -i test_freeze_simple_script \ -i test_check_probes \ %ifarch %{mips64} From ae3b33f26602842b13f4410f72996e1eb11d48d4 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 4 Dec 2024 00:29:07 +0100 Subject: [PATCH 061/115] Update to 3.13.1 Security fix for CVE-2024-9287 Fixes: rhbz#2321657 --- 00251-change-user-install-location.patch | 16 ++++++++-------- python3.13.spec | 19 ++++++++++++------- sources | 4 ++-- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index df3baea..8025f83 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,7 +30,7 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index 0a0dc47b17..bb42e1cf5a 100644 +index 89a81c55cb..950e2e337f 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -414,8 +414,15 @@ def getsitepackages(prefixes=None): @@ -51,7 +51,7 @@ index 0a0dc47b17..bb42e1cf5a 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 80aef34471..4e4ea6aeea 100644 +index ec3b638f00..28ad8a2321 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -87,7 +87,7 @@ index 80aef34471..4e4ea6aeea 100644 _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', 'scripts', 'data') -@@ -261,11 +280,40 @@ def _extend_dict(target_dict, other_dict): +@@ -259,11 +278,40 @@ def _extend_dict(target_dict, other_dict): target_dict[key] = value @@ -120,7 +120,7 @@ index 80aef34471..4e4ea6aeea 100644 + # we only change the defaults here, so explicit --prefix will take precedence + # https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe + if (scheme == 'posix_prefix' and -+ _PREFIX == '/usr' and ++ get_config_vars('prefix')[0] == '/usr' and + 'RPM_BUILD_ROOT' not in os.environ): + _extend_dict(vars, _config_vars_local()) + else: @@ -130,10 +130,10 @@ index 80aef34471..4e4ea6aeea 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 1ade49281b..e21ca34733 100644 +index bf53413021..33fa2feb28 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py -@@ -121,8 +121,19 @@ def test_get_path(self): +@@ -130,8 +130,19 @@ def test_get_path(self): for scheme in _INSTALL_SCHEMES: for name in _INSTALL_SCHEMES[scheme]: expected = _INSTALL_SCHEMES[scheme][name].format(**config_vars) @@ -154,7 +154,7 @@ index 1ade49281b..e21ca34733 100644 os.path.normpath(expected), ) -@@ -377,7 +388,7 @@ def test_get_config_h_filename(self): +@@ -386,7 +397,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -163,7 +163,7 @@ index 1ade49281b..e21ca34733 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -389,6 +400,8 @@ def test_symlink(self): # Issue 7880 +@@ -398,6 +409,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/python3.13.spec b/python3.13.spec index bee5a28..816f38f 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -13,7 +13,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.0 +%global general_version %{pybasever}.1 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -57,7 +57,7 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 24.2 +%global pip_version 24.3.1 %global setuptools_version 67.6.1 %global wheel_version 0.43.0 # All of those also include a list of indirect bundled libs: @@ -65,8 +65,8 @@ License: Python-2.0.1 # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: Provides: bundled(python3dist(cachecontrol)) = 0.14 -Provides: bundled(python3dist(certifi)) = 2024.7.4 -Provides: bundled(python3dist(distlib)) = 0.3.8 +Provides: bundled(python3dist(certifi)) = 2024.8.30 +Provides: bundled(python3dist(distlib)) = 0.3.9 Provides: bundled(python3dist(distro)) = 1.9 Provides: bundled(python3dist(idna)) = 3.7 Provides: bundled(python3dist(msgpack)) = 1.0.8 @@ -79,9 +79,9 @@ Provides: bundled(python3dist(resolvelib)) = 1.0.1 Provides: bundled(python3dist(rich)) = 13.7.1 Provides: bundled(python3dist(setuptools)) = 70.3 Provides: bundled(python3dist(tomli)) = 2.0.1 -Provides: bundled(python3dist(truststore)) = 0.9.1 +Provides: bundled(python3dist(truststore)) = 0.10 Provides: bundled(python3dist(typing-extensions)) = 4.12.2 -Provides: bundled(python3dist(urllib3)) = 1.26.18 +Provides: bundled(python3dist(urllib3)) = 1.26.20 } # setuptools # vendor.txt files not in .whl @@ -341,7 +341,7 @@ Source11: idle3.appdata.xml # (Patches taken from github.com/fedora-python/cpython) -# 00251 # 60dd97be7bf3662ff65edd8471e948924b4175b2 +# 00251 # f5b56b9d4a79df04e9d90ceff7388554c5f818b6 # Change user install location # # Set values of base and platbase in sysconfig from /usr @@ -1699,6 +1699,11 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Dec 03 2024 Charalampos Stratakis - 3.13.1-1 +- Update to 3.13.1 +- Security fix for CVE-2024-9287 +- Fixes: rhbz#2321657 + * Tue Oct 08 2024 Karolina Surma - 3.13.0-1 - Update to Python 3.13.0 diff --git a/sources b/sources index 9cf507c..25463a6 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.0.tar.xz) = 44a143c9b96b55b01885ec020c3364265bda55289615cd7d5071915b0d0178a6f35e7551a89090001fcb7f3172d38177a56bf8b8532b15c9dbc50295c9210152 -SHA512 (Python-3.13.0.tar.xz.asc) = 1b8bb0fe4eb93e31ec1770e90b94d44b5864c0391aad5dcba3a30d8e505d9b17107385414353c0060007f8a536254f49b8e919f36ddf6421a6e4330f817f1a3e +SHA512 (Python-3.13.1.tar.xz) = 056c9b5fc0a6b540f41513d045f43c1ed463d15e0f345cecec703ec9c2335e53b4beb19de9c74ab2b236b023f934d5fd9ae7727a808634eaa01cfe66018a9a35 +SHA512 (Python-3.13.1.tar.xz.asc) = 1b56b7c2f547aa39c75c18978e174debb113444ce3f9da3829ba6842e3160051e0de70bd49d306b8014299aa8aa911d7c67efe71dd648c3528cf8d7535a01599 From f84c0fe12f2f65713058447122526557f4b46256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 5 Dec 2024 11:53:48 +0100 Subject: [PATCH 062/115] Optimize patch 251 a tiny bit Before: $ python3.14 -m timeit -s 'import sysconfig' 'sysconfig.get_paths()' 2000 loops, best of 5: 157 usec per loop $ python3.14 -m timeit -s 'import sysconfig' 'sysconfig.get_paths()' 2000 loops, best of 5: 162 usec per loop $ python3.14 -m timeit -s 'import sysconfig' 'sysconfig.get_paths()' 1000 loops, best of 5: 146 usec per loop After: $ python3.14 -m timeit -s 'import sysconfig' 'sysconfig.get_paths()' 5000 loops, best of 5: 75.9 usec per loop $ python3.14 -m timeit -s 'import sysconfig' 'sysconfig.get_paths()' 5000 loops, best of 5: 77.1 usec per loop $ python3.14 -m timeit -s 'import sysconfig' 'sysconfig.get_paths()' 5000 loops, best of 5: 76.2 usec per loop The results are inconclusive on 3.13, but we want the patch to be identical (if possible). This can be shipped with the next update. --- 00251-change-user-install-location.patch | 4 ++-- python3.13.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 8025f83..a3a121d 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -51,7 +51,7 @@ index 89a81c55cb..950e2e337f 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index ec3b638f00..28ad8a2321 100644 +index ec3b638f00..94a6c64aa2 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -120,7 +120,7 @@ index ec3b638f00..28ad8a2321 100644 + # we only change the defaults here, so explicit --prefix will take precedence + # https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe + if (scheme == 'posix_prefix' and -+ get_config_vars('prefix')[0] == '/usr' and ++ sys.prefix == '/usr' and + 'RPM_BUILD_ROOT' not in os.environ): + _extend_dict(vars, _config_vars_local()) + else: diff --git a/python3.13.spec b/python3.13.spec index 816f38f..e44329f 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -341,7 +341,7 @@ Source11: idle3.appdata.xml # (Patches taken from github.com/fedora-python/cpython) -# 00251 # f5b56b9d4a79df04e9d90ceff7388554c5f818b6 +# 00251 # 5ac6e7781923cbb3e4606e3bca381a1167d322e5 # Change user install location # # Set values of base and platbase in sysconfig from /usr From 00aa424d30ed176d7fc8c7399e0037a6a6e70c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 9 Dec 2024 14:59:04 +0100 Subject: [PATCH 063/115] Security fix for CVE-2024-12254 - Fixes: rhbz#2330927 --- ...elines-pauses-the-protocol-if-needed.patch | 62 +++++++++++++++++++ python3.13.spec | 14 ++++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch diff --git a/00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch b/00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch new file mode 100644 index 0000000..4daa28f --- /dev/null +++ b/00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Miss Islington (bot)" + <31488909+miss-islington@users.noreply.github.com> +Date: Fri, 6 Dec 2024 06:12:40 +0100 +Subject: [PATCH] 00445: CVE-2024-12254: Ensure + _SelectorSocketTransport.writelines pauses the protocol if needed + +Ensure _SelectorSocketTransport.writelines pauses the protocol if it reaches the high water mark as needed. + +Resolved upstream: https://github.com/python/cpython/issues/127655 + +Co-authored-by: J. Nick Koston +Co-authored-by: Kumar Aditya +--- + Lib/asyncio/selector_events.py | 1 + + Lib/test/test_asyncio/test_selector_events.py | 12 ++++++++++++ + .../2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst | 1 + + 3 files changed, 14 insertions(+) + create mode 100644 Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst + +diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py +index f94bf10b42..f1ab9b12d6 100644 +--- a/Lib/asyncio/selector_events.py ++++ b/Lib/asyncio/selector_events.py +@@ -1175,6 +1175,7 @@ def writelines(self, list_of_data): + # If the entire buffer couldn't be written, register a write handler + if self._buffer: + self._loop._add_writer(self._sock_fd, self._write_ready) ++ self._maybe_pause_protocol() + + def can_write_eof(self): + return True +diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py +index aaeda33dd0..efca30f374 100644 +--- a/Lib/test/test_asyncio/test_selector_events.py ++++ b/Lib/test/test_asyncio/test_selector_events.py +@@ -805,6 +805,18 @@ def test_writelines_send_partial(self): + self.assertTrue(self.sock.send.called) + self.assertTrue(self.loop.writers) + ++ def test_writelines_pauses_protocol(self): ++ data = memoryview(b'data') ++ self.sock.send.return_value = 2 ++ self.sock.send.fileno.return_value = 7 ++ ++ transport = self.socket_transport() ++ transport._high_water = 1 ++ transport.writelines([data]) ++ self.assertTrue(self.protocol.pause_writing.called) ++ self.assertTrue(self.sock.send.called) ++ self.assertTrue(self.loop.writers) ++ + @unittest.skipUnless(selector_events._HAS_SENDMSG, 'no sendmsg') + def test_write_sendmsg_full(self): + data = memoryview(b'data') +diff --git a/Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst b/Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst +new file mode 100644 +index 0000000000..76cfc58121 +--- /dev/null ++++ b/Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst +@@ -0,0 +1 @@ ++Fixed the :class:`!asyncio.selector_events._SelectorSocketTransport` transport not pausing writes for the protocol when the buffer reaches the high water mark when using :meth:`asyncio.WriteTransport.writelines`. diff --git a/python3.13.spec b/python3.13.spec index e44329f..aade60b 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -358,6 +358,14 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch +# 00445 # d1a32daddefad32ceb93155552858c0a0311b23e +# CVE-2024-12254: Ensure _SelectorSocketTransport.writelines pauses the protocol if needed +# +# Ensure _SelectorSocketTransport.writelines pauses the protocol if it reaches the high water mark as needed. +# +# Resolved upstream: https://github.com/python/cpython/issues/127655 +Patch445: 00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1699,6 +1707,10 @@ CheckPython freethreading # ====================================================== %changelog +* Mon Dec 09 2024 Miro Hrončok - 3.13.1-2 +- Security fix for CVE-2024-12254 +- Fixes: rhbz#2330927 + * Tue Dec 03 2024 Charalampos Stratakis - 3.13.1-1 - Update to 3.13.1 - Security fix for CVE-2024-9287 From 027f189877041147b557341f0da19f8a32fc5d75 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 18 Jan 2025 21:09:02 +0000 Subject: [PATCH 064/115] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index aade60b..ae66d26 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -1707,6 +1707,9 @@ CheckPython freethreading # ====================================================== %changelog +* Sat Jan 18 2025 Fedora Release Engineering - 3.13.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Mon Dec 09 2024 Miro Hrončok - 3.13.1-2 - Security fix for CVE-2024-12254 - Fixes: rhbz#2330927 From d6e1ac20e88bff672688379859251e916eadadc4 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 23 Jan 2025 01:50:33 +0100 Subject: [PATCH 065/115] Remove redundant --with-system-ffi configure option The option has been removed since Python 3.12 See: https://github.com/python/cpython/commit/25590eb5dee5176f3ac60916b19450f8198e7ffc --- python3.13.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index ae66d26..deaa1f4 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -867,7 +867,6 @@ BuildPython() { --with-computed-gotos=%{computed_gotos_flag} \ --with-dbmliborder=gdbm:ndbm:bdb \ --with-system-expat \ - --with-system-ffi \ --with-system-libmpdec \ --enable-loadable-sqlite-extensions \ --with-dtrace \ From 63816a4d7a2dc13ccfd50643d42ba57700da1601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 29 Jan 2025 21:28:29 +0100 Subject: [PATCH 066/115] Ensure this package is built with Tk 8 - Fixes: rhbz#2337760 --- python3.13.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index deaa1f4..dbd82c5 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -265,8 +265,8 @@ BuildRequires: readline-devel BuildRequires: redhat-rpm-config >= 127 BuildRequires: sqlite-devel BuildRequires: systemtap-sdt-devel -BuildRequires: tcl-devel -BuildRequires: tk-devel +BuildRequires: tcl-devel < 1:9 +BuildRequires: tk-devel < 1:9 BuildRequires: xz-devel BuildRequires: zlib-devel BuildRequires: /usr/bin/dtrace From ef73f1e89cf8263fa696e43be9b54b7d41d163ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 29 Jan 2025 21:27:51 +0100 Subject: [PATCH 067/115] On Fedora 41 or older, statically build the _datetime module into libpython - This fixes a segfault when importng it from Python 3.13.0 updated to 3.13.1+ while running - Fixes: rhbz#2333852 --- python3.13.spec | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index dbd82c5..86e73cc 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 4%{?dist} License: Python-2.0.1 @@ -882,6 +882,17 @@ BuildPython() { $ExtraConfigArgs \ %{nil} +%if 0%{?fedora} && 0%{?fedora} < 42 + # Statically compile the _datetime module to mitigate: + # Segfault when updating from 3.13.0 to 3.13.1 while Python is running + # https://bugzilla.redhat.com/2333852 + # Note that this is an incomplete workaround for the case we know about, + # we'd like to see the cause fixed properly in Python 3.14 upstream: + # https://github.com/python/cpython/issues/128341 + # This is only carried on Fedoras released before Python 3.13.1. + echo -e '*static*\n_datetime _datetimemodule.c' > Modules/Setup.local +%endif + %global flags_override EXTRA_CFLAGS="$MoreCFlags" CFLAGS_NODIST="$CFLAGS_NODIST $MoreCFlags" %if %{without bootstrap} @@ -1412,7 +1423,9 @@ CheckPython freethreading %{1}/_ctypes.%{2}.so\ %{1}/_curses.%{2}.so\ %{1}/_curses_panel.%{2}.so\ +%if !(0%{?fedora} && 0%{?fedora} < 42)\ %{1}/_datetime.%{2}.so\ +%endif\ %{1}/_dbm.%{2}.so\ %{1}/_gdbm.%{2}.so\ %{1}/_decimal.%{2}.so\ @@ -1706,6 +1719,11 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Jan 29 2025 Miro Hrončok - 3.13.1-4 +- On Fedora 41 or older, statically build the _datetime module into libpython +- This fixes a segfault when importng it from Python 3.13.0 updated to 3.13.1+ while running +- Fixes: rhbz#2333852 + * Sat Jan 18 2025 Fedora Release Engineering - 3.13.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From fd1e3b0098cb96ba3525b58dff2f0ec1ef32cb8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 3 Feb 2025 18:30:24 +0100 Subject: [PATCH 068/115] Changelog typo --- python3.13.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 86e73cc..816a44a 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1721,7 +1721,7 @@ CheckPython freethreading %changelog * Wed Jan 29 2025 Miro Hrončok - 3.13.1-4 - On Fedora 41 or older, statically build the _datetime module into libpython -- This fixes a segfault when importng it from Python 3.13.0 updated to 3.13.1+ while running +- This fixes a segfault when importing it from Python 3.13.0 updated to 3.13.1+ while running - Fixes: rhbz#2333852 * Sat Jan 18 2025 Fedora Release Engineering - 3.13.1-3 From 4f7875132ef5de299fb43bce0c6dc942870d5b4b Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 4 Feb 2025 22:44:24 +0100 Subject: [PATCH 069/115] Update to 3.13.2 Security fix for CVE-2025-0938 Fixes: rhbz#2343274 --- ...elines-pauses-the-protocol-if-needed.patch | 62 ------------------- python3.13.spec | 17 +++-- sources | 4 +- 3 files changed, 9 insertions(+), 74 deletions(-) delete mode 100644 00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch diff --git a/00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch b/00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch deleted file mode 100644 index 4daa28f..0000000 --- a/00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Fri, 6 Dec 2024 06:12:40 +0100 -Subject: [PATCH] 00445: CVE-2024-12254: Ensure - _SelectorSocketTransport.writelines pauses the protocol if needed - -Ensure _SelectorSocketTransport.writelines pauses the protocol if it reaches the high water mark as needed. - -Resolved upstream: https://github.com/python/cpython/issues/127655 - -Co-authored-by: J. Nick Koston -Co-authored-by: Kumar Aditya ---- - Lib/asyncio/selector_events.py | 1 + - Lib/test/test_asyncio/test_selector_events.py | 12 ++++++++++++ - .../2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst | 1 + - 3 files changed, 14 insertions(+) - create mode 100644 Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst - -diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py -index f94bf10b42..f1ab9b12d6 100644 ---- a/Lib/asyncio/selector_events.py -+++ b/Lib/asyncio/selector_events.py -@@ -1175,6 +1175,7 @@ def writelines(self, list_of_data): - # If the entire buffer couldn't be written, register a write handler - if self._buffer: - self._loop._add_writer(self._sock_fd, self._write_ready) -+ self._maybe_pause_protocol() - - def can_write_eof(self): - return True -diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py -index aaeda33dd0..efca30f374 100644 ---- a/Lib/test/test_asyncio/test_selector_events.py -+++ b/Lib/test/test_asyncio/test_selector_events.py -@@ -805,6 +805,18 @@ def test_writelines_send_partial(self): - self.assertTrue(self.sock.send.called) - self.assertTrue(self.loop.writers) - -+ def test_writelines_pauses_protocol(self): -+ data = memoryview(b'data') -+ self.sock.send.return_value = 2 -+ self.sock.send.fileno.return_value = 7 -+ -+ transport = self.socket_transport() -+ transport._high_water = 1 -+ transport.writelines([data]) -+ self.assertTrue(self.protocol.pause_writing.called) -+ self.assertTrue(self.sock.send.called) -+ self.assertTrue(self.loop.writers) -+ - @unittest.skipUnless(selector_events._HAS_SENDMSG, 'no sendmsg') - def test_write_sendmsg_full(self): - data = memoryview(b'data') -diff --git a/Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst b/Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst -new file mode 100644 -index 0000000000..76cfc58121 ---- /dev/null -+++ b/Misc/NEWS.d/next/Security/2024-12-05-21-35-19.gh-issue-127655.xpPoOf.rst -@@ -0,0 +1 @@ -+Fixed the :class:`!asyncio.selector_events._SelectorSocketTransport` transport not pausing writes for the protocol when the buffer reaches the high water mark when using :meth:`asyncio.WriteTransport.writelines`. diff --git a/python3.13.spec b/python3.13.spec index 816a44a..f06182a 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -13,11 +13,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.1 +%global general_version %{pybasever}.2 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 4%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -358,14 +358,6 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00445 # d1a32daddefad32ceb93155552858c0a0311b23e -# CVE-2024-12254: Ensure _SelectorSocketTransport.writelines pauses the protocol if needed -# -# Ensure _SelectorSocketTransport.writelines pauses the protocol if it reaches the high water mark as needed. -# -# Resolved upstream: https://github.com/python/cpython/issues/127655 -Patch445: 00445-cve-2024-12254-ensure-_selectorsockettransport-writelines-pauses-the-protocol-if-needed.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1719,6 +1711,11 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Feb 04 2025 Charalampos Stratakis - 3.13.2-1 +- Update to 3.13.2 +- Security fix for CVE-2025-0938 +- Fixes: rhbz#2343274 + * Wed Jan 29 2025 Miro Hrončok - 3.13.1-4 - On Fedora 41 or older, statically build the _datetime module into libpython - This fixes a segfault when importing it from Python 3.13.0 updated to 3.13.1+ while running diff --git a/sources b/sources index 25463a6..e4c65e5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.1.tar.xz) = 056c9b5fc0a6b540f41513d045f43c1ed463d15e0f345cecec703ec9c2335e53b4beb19de9c74ab2b236b023f934d5fd9ae7727a808634eaa01cfe66018a9a35 -SHA512 (Python-3.13.1.tar.xz.asc) = 1b56b7c2f547aa39c75c18978e174debb113444ce3f9da3829ba6842e3160051e0de70bd49d306b8014299aa8aa911d7c67efe71dd648c3528cf8d7535a01599 +SHA512 (Python-3.13.2.tar.xz) = bb1c0598914c6d4326554faa568f660f10b20c701d0f36bf1fa58837b6498d728a407416b06ede39604caea1ca93f60545b83b01ae8ee65f55d4cc83242b63fe +SHA512 (Python-3.13.2.tar.xz.asc) = 5f019be530f688b0adf5d5cc9f2c2243e2f1dc7338559db14c1eedd12aadc85404d42c7aafd74e41828205d85f13f278876662ac30c8f3382a1ee081ba5f29f2 From 94a1f5627967375a953b927d1fff11586c0fc889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 6 Feb 2025 12:04:28 +0100 Subject: [PATCH 070/115] Rebuilt with mpdecimal 4.0.0 --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index f06182a..0912d12 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -1711,6 +1711,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Feb 06 2025 Miro Hrončok - 3.13.2-2 +- Rebuilt with mpdecimal 4.0.0 + * Tue Feb 04 2025 Charalampos Stratakis - 3.13.2-1 - Update to 3.13.2 - Security fix for CVE-2025-0938 From ee3b609ce717e6fb876293bd4c90791cdfb0f102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 9 Apr 2025 09:54:51 +0200 Subject: [PATCH 071/115] Update to 3.13.3 --- 00251-change-user-install-location.patch | 6 +-- ...oken-rst-with-rstfile-as-an-argument.patch | 24 ++++++++++++ ...ame-in-test_group_no_follow_symlinks.patch | 24 ++++++++++++ python3.13.spec | 37 +++++++++++++------ sources | 4 +- 5 files changed, 79 insertions(+), 16 deletions(-) create mode 100644 00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch create mode 100644 00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index a3a121d..8f0a321 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -51,7 +51,7 @@ index 89a81c55cb..950e2e337f 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index ec3b638f00..94a6c64aa2 100644 +index 510c7b9568..6e4e07e43b 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -87,7 +87,7 @@ index ec3b638f00..94a6c64aa2 100644 _SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include', 'scripts', 'data') -@@ -259,11 +278,40 @@ def _extend_dict(target_dict, other_dict): +@@ -266,11 +285,40 @@ def _extend_dict(target_dict, other_dict): target_dict[key] = value @@ -130,7 +130,7 @@ index ec3b638f00..94a6c64aa2 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index bf53413021..33fa2feb28 100644 +index aca02c06bc..a4d0db0da8 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -130,8 +130,19 @@ def test_get_path(self): diff --git a/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch b/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch new file mode 100644 index 0000000..4e736ef --- /dev/null +++ b/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Wed, 9 Apr 2025 10:47:48 +0200 +Subject: [PATCH] 00454: Invoke regen-token rst with rstfile as an argument + +Proposed upstream: https://github.com/python/cpython/pull/132304 +--- + Makefile.pre.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 3bd4495f95..d7a4e4b320 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1784,7 +1784,8 @@ regen-token: + # using Tools/build/generate_token.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py rst \ + $(srcdir)/Grammar/Tokens \ +- $(srcdir)/Doc/library/token-list.inc ++ $(srcdir)/Doc/library/token-list.inc \ ++ $(srcdir)/Doc/library/token.rst + # Regenerate Include/internal/pycore_token.h from Grammar/Tokens + # using Tools/build/generate_token.py + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py h \ diff --git a/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch b/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch new file mode 100644 index 0000000..0dd171e --- /dev/null +++ b/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Thu, 10 Apr 2025 15:11:41 +0200 +Subject: [PATCH] 00456: Find the correct group name in + test_group_no_follow_symlinks + +Proposed upstream: https://github.com/python/cpython/pull/132357 +--- + Lib/test/test_pathlib/test_pathlib.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py +index 1f01ce40da..2b9aad1426 100644 +--- a/Lib/test/test_pathlib/test_pathlib.py ++++ b/Lib/test/test_pathlib/test_pathlib.py +@@ -781,7 +781,7 @@ def test_group_no_follow_symlinks(self): + os.chown(link, -1, gid_2, follow_symlinks=False) + + expected_gid = link.stat(follow_symlinks=False).st_gid +- expected_name = self._get_pw_name_or_skip_test(expected_gid) ++ expected_name = self._get_gr_name_or_skip_test(expected_gid) + + self.assertEqual(expected_gid, gid_2) + self.assertEqual(expected_name, link.group(follow_symlinks=False)) diff --git a/python3.13.spec b/python3.13.spec index 0912d12..6dbc504 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -13,11 +13,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.2 +%global general_version %{pybasever}.3 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -57,28 +57,28 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 24.3.1 +%global pip_version 25.0.1 %global setuptools_version 67.6.1 %global wheel_version 0.43.0 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: -Provides: bundled(python3dist(cachecontrol)) = 0.14 +Provides: bundled(python3dist(cachecontrol)) = 0.14.1 Provides: bundled(python3dist(certifi)) = 2024.8.30 Provides: bundled(python3dist(distlib)) = 0.3.9 Provides: bundled(python3dist(distro)) = 1.9 -Provides: bundled(python3dist(idna)) = 3.7 -Provides: bundled(python3dist(msgpack)) = 1.0.8 -Provides: bundled(python3dist(packaging)) = 24.1 -Provides: bundled(python3dist(platformdirs)) = 4.2.2 +Provides: bundled(python3dist(idna)) = 3.10 +Provides: bundled(python3dist(msgpack)) = 1.1 +Provides: bundled(python3dist(packaging)) = 24.2 +Provides: bundled(python3dist(platformdirs)) = 4.3.6 Provides: bundled(python3dist(pygments)) = 2.18 -Provides: bundled(python3dist(pyproject-hooks)) = 1 +Provides: bundled(python3dist(pyproject-hooks)) = 1.2 Provides: bundled(python3dist(requests)) = 2.32.3 Provides: bundled(python3dist(resolvelib)) = 1.0.1 -Provides: bundled(python3dist(rich)) = 13.7.1 +Provides: bundled(python3dist(rich)) = 13.9.4 Provides: bundled(python3dist(setuptools)) = 70.3 -Provides: bundled(python3dist(tomli)) = 2.0.1 +Provides: bundled(python3dist(tomli)) = 2.2.1 Provides: bundled(python3dist(truststore)) = 0.10 Provides: bundled(python3dist(typing-extensions)) = 4.12.2 Provides: bundled(python3dist(urllib3)) = 1.26.20 @@ -358,6 +358,18 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch +# 00454 # 1d5d7e9ce724fbbd89645d637303d12731c2a622 +# Invoke regen-token rst with rstfile as an argument +# +# Proposed upstream: https://github.com/python/cpython/pull/132304 +Patch454: 00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch + +# 00456 # 8f50cf7170e39c02d52cb5f99d647eeefad2f685 +# Find the correct group name in test_group_no_follow_symlinks +# +# Proposed upstream: https://github.com/python/cpython/pull/132357 +Patch456: 00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1711,6 +1723,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Apr 09 2025 Tomáš Hrnčiar - 3.13.3-1 +- Update to 3.13.1 + * Thu Feb 06 2025 Miro Hrončok - 3.13.2-2 - Rebuilt with mpdecimal 4.0.0 diff --git a/sources b/sources index e4c65e5..f101eff 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.2.tar.xz) = bb1c0598914c6d4326554faa568f660f10b20c701d0f36bf1fa58837b6498d728a407416b06ede39604caea1ca93f60545b83b01ae8ee65f55d4cc83242b63fe -SHA512 (Python-3.13.2.tar.xz.asc) = 5f019be530f688b0adf5d5cc9f2c2243e2f1dc7338559db14c1eedd12aadc85404d42c7aafd74e41828205d85f13f278876662ac30c8f3382a1ee081ba5f29f2 +SHA512 (Python-3.13.3.tar.xz) = f7559b6dceae69f48742af0a6497fbec42cd1e5304f64b6eb9d89222a1171ccf12fa186cc0decabb4e98d05223184967a4a7537754c01083dacdc9073cb1a578 +SHA512 (Python-3.13.3.tar.xz.asc) = 54f8da5f4a4dcadc9830cb07aecf695a26a2de48ab98e1f42b09fdde1c70989476d07ce7ea81337216f1e5fcbf6b688e0608c88a2545ced416b01640108e94db From 8dd054a595e76b2cfe8f686b82308cffcd9438ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Thu, 17 Apr 2025 12:17:38 +0200 Subject: [PATCH 072/115] Regenerate patches with updated importpatches script --- 00251-change-user-install-location.patch | 2 +- 00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch | 2 +- ...e-correct-group-name-in-test_group_no_follow_symlinks.patch | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 8f0a321..2d2b66e 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 15 Feb 2021 12:19:27 +0100 -Subject: [PATCH] 00251: Change user install location +Subject: 00251: Change user install location MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch b/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch index 4e736ef..228a03a 100644 --- a/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch +++ b/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch @@ -1,7 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 9 Apr 2025 10:47:48 +0200 -Subject: [PATCH] 00454: Invoke regen-token rst with rstfile as an argument +Subject: 00454: Invoke regen-token rst with rstfile as an argument Proposed upstream: https://github.com/python/cpython/pull/132304 --- diff --git a/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch b/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch index 0dd171e..0627f0f 100644 --- a/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch +++ b/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch @@ -1,8 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 10 Apr 2025 15:11:41 +0200 -Subject: [PATCH] 00456: Find the correct group name in - test_group_no_follow_symlinks +Subject: 00456: Find the correct group name in test_group_no_follow_symlinks Proposed upstream: https://github.com/python/cpython/pull/132357 --- From d3f76dd9d51a0409238ddf76a34957177c727a0b Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 23 Apr 2025 01:11:41 +0200 Subject: [PATCH 073/115] Apply Intel's CET for mitigation against control-flow hijacking attacks --- ...l-control-flow-technology-for-x86-64.patch | 68 +++++++++++++++++++ python3.13.spec | 15 +++- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 00459-apply-intel-control-flow-technology-for-x86-64.patch diff --git a/00459-apply-intel-control-flow-technology-for-x86-64.patch b/00459-apply-intel-control-flow-technology-for-x86-64.patch new file mode 100644 index 0000000..98d5eee --- /dev/null +++ b/00459-apply-intel-control-flow-technology-for-x86-64.patch @@ -0,0 +1,68 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charalampos Stratakis +Date: Wed, 8 Jan 2025 04:58:22 +0100 +Subject: 00459: Apply Intel Control-flow Technology for x86-64 + +Required for mitigation against return-oriented programming (ROP) and Call or Jump Oriented Programming (COP/JOP) attacks + +Proposed upstream: https://github.com/python/cpython/pull/128606 + +See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html +--- + Python/asm_trampoline.S | 22 ++++++++++++++++++++++ + Python/perf_jit_trampoline.c | 4 ++++ + 2 files changed, 26 insertions(+) + +diff --git a/Python/asm_trampoline.S b/Python/asm_trampoline.S +index 0a3265dfee..616752459b 100644 +--- a/Python/asm_trampoline.S ++++ b/Python/asm_trampoline.S +@@ -9,6 +9,9 @@ + # } + _Py_trampoline_func_start: + #ifdef __x86_64__ ++#if defined(__CET__) && (__CET__ & 1) ++ endbr64 ++#endif + sub $8, %rsp + call *%rcx + add $8, %rsp +@@ -34,3 +37,22 @@ _Py_trampoline_func_start: + .globl _Py_trampoline_func_end + _Py_trampoline_func_end: + .section .note.GNU-stack,"",@progbits ++# Note for indicating the assembly code supports CET ++#if defined(__x86_64__) && defined(__CET__) && (__CET__ & 1) ++ .section .note.gnu.property,"a" ++ .align 8 ++ .long 1f - 0f ++ .long 4f - 1f ++ .long 5 ++0: ++ .string "GNU" ++1: ++ .align 8 ++ .long 0xc0000002 ++ .long 3f - 2f ++2: ++ .long 0x3 ++3: ++ .align 8 ++4: ++#endif // __x86_64__ +diff --git a/Python/perf_jit_trampoline.c b/Python/perf_jit_trampoline.c +index 0a8945958b..e9cc7758ba 100644 +--- a/Python/perf_jit_trampoline.c ++++ b/Python/perf_jit_trampoline.c +@@ -472,7 +472,11 @@ elf_init_ehframe(ELFObjectContext* ctx) + DWRF_U8(0); /* Augmentation data. */ + /* Registers saved in CFRAME. */ + #ifdef __x86_64__ ++# if defined(__CET__) && (__CET__ & 1) ++ DWRF_U8(DWRF_CFA_advance_loc | 8); ++# else + DWRF_U8(DWRF_CFA_advance_loc | 4); ++# endif + DWRF_U8(DWRF_CFA_def_cfa_offset); DWRF_UV(16); + DWRF_U8(DWRF_CFA_advance_loc | 6); + DWRF_U8(DWRF_CFA_def_cfa_offset); DWRF_UV(8); diff --git a/python3.13.spec b/python3.13.spec index 6dbc504..0805a72 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -370,6 +370,16 @@ Patch454: 00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch # Proposed upstream: https://github.com/python/cpython/pull/132357 Patch456: 00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch +# 00459 # 9cf6fed17de184d2e17ace2b5063e782e7e186ba +# Apply Intel Control-flow Technology for x86-64 +# +# Required for mitigation against return-oriented programming (ROP) and Call or Jump Oriented Programming (COP/JOP) attacks +# +# Proposed upstream: https://github.com/python/cpython/pull/128606 +# +# See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html +Patch459: 00459-apply-intel-control-flow-technology-for-x86-64.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1723,6 +1733,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Apr 22 2025 Charalampos Stratakis - 3.13.3-2 +- Apply Intel's CET for mitigation against control-flow hijacking attacks + * Wed Apr 09 2025 Tomáš Hrnčiar - 3.13.3-1 - Update to 3.13.1 From 5336a4f623037a4e8df4f04ad1837036fcbf8962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 6 May 2025 15:07:54 +0200 Subject: [PATCH 074/115] Drop requirement on python-wheel-wheel with setuptools >= 71 --- ...red-setuptools-in-lib-test-wheeldata.patch | 120 ++++++++++++++++++ ...eel-in-test-venvs-when-setuptools-71.patch | 32 +++++ python3.13.spec | 23 +++- 3 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch create mode 100644 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch diff --git a/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch b/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch new file mode 100644 index 0000000..b77c644 --- /dev/null +++ b/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch @@ -0,0 +1,120 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> +Date: Fri, 25 Apr 2025 00:46:20 +0100 +Subject: 00460: gh-132415: Update vendored setuptools in + ``Lib/test/wheeldata`` + +(cherry picked from commit c9f3f5b4ed52d7bed6073ffa39717ece47202558) +(actual changes in .whl files removed to make this patch smaller) + +gh-127906: Add missing sys import to test_cppext + +(cherry picked from commit 9cba14881b371b1e95d57877896169c4605f9b75) + +Co-Authored-By: Victor Stinner +--- + Lib/test/support/__init__.py | 14 +++++++------- + Lib/test/test_cext/__init__.py | 2 +- + Lib/test/test_cppext/__init__.py | 2 +- + Lib/test/test_cppext/setup.py | 1 + + Lib/test/test_peg_generator/test_c_parser.py | 2 +- + 5 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py +index 78cf4b3ca8..bd8860b696 100644 +--- a/Lib/test/support/__init__.py ++++ b/Lib/test/support/__init__.py +@@ -2360,7 +2360,7 @@ def _findwheel(pkgname): + filenames = os.listdir(wheel_dir) + filenames = sorted(filenames, reverse=True) # approximate "newest" first + for filename in filenames: +- # filename is like 'setuptools-67.6.1-py3-none-any.whl' ++ # filename is like 'setuptools-{version}-py3-none-any.whl' + if not filename.endswith(".whl"): + continue + prefix = pkgname + '-' +@@ -2369,16 +2369,16 @@ def _findwheel(pkgname): + raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}") + + +-# Context manager that creates a virtual environment, install setuptools and wheel in it +-# and returns the path to the venv directory and the path to the python executable ++# Context manager that creates a virtual environment, install setuptools in it, ++# and returns the paths to the venv directory and the python executable + @contextlib.contextmanager +-def setup_venv_with_pip_setuptools_wheel(venv_dir): +- import shlex ++def setup_venv_with_pip_setuptools(venv_dir): + import subprocess + from .os_helper import temp_cwd + + def run_command(cmd): + if verbose: ++ import shlex + print() + print('Run:', ' '.join(map(shlex.quote, cmd))) + subprocess.run(cmd, check=True) +@@ -2402,10 +2402,10 @@ def run_command(cmd): + else: + python = os.path.join(venv, 'bin', python_exe) + +- cmd = [python, '-X', 'dev', ++ cmd = (python, '-X', 'dev', + '-m', 'pip', 'install', + _findwheel('setuptools'), +- _findwheel('wheel')] ++ ) + run_command(cmd) + + yield python +diff --git a/Lib/test/test_cext/__init__.py b/Lib/test/test_cext/__init__.py +index 54859f9ff7..57f31c900d 100644 +--- a/Lib/test/test_cext/__init__.py ++++ b/Lib/test/test_cext/__init__.py +@@ -50,7 +50,7 @@ def test_build_limited_c11(self): + + def check_build(self, extension_name, std=None, limited=False): + venv_dir = 'env' +- with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe: ++ with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe: + self._check_build(extension_name, python_exe, + std=std, limited=limited) + +diff --git a/Lib/test/test_cppext/__init__.py b/Lib/test/test_cppext/__init__.py +index d519522730..e7130f6fc6 100644 +--- a/Lib/test/test_cppext/__init__.py ++++ b/Lib/test/test_cppext/__init__.py +@@ -47,7 +47,7 @@ def test_build_limited(self): + + def check_build(self, extension_name, std=None, limited=False): + venv_dir = 'env' +- with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe: ++ with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe: + self._check_build(extension_name, python_exe, + std=std, limited=limited) + +diff --git a/Lib/test/test_cppext/setup.py b/Lib/test/test_cppext/setup.py +index 019ff18446..25d71cd9a2 100644 +--- a/Lib/test/test_cppext/setup.py ++++ b/Lib/test/test_cppext/setup.py +@@ -3,6 +3,7 @@ + import os + import platform + import shlex ++import sys + import sysconfig + from test import support + +diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py +index 1411e55dd0..1095e7303c 100644 +--- a/Lib/test/test_peg_generator/test_c_parser.py ++++ b/Lib/test/test_peg_generator/test_c_parser.py +@@ -99,7 +99,7 @@ def setUpClass(cls): + cls.addClassCleanup(shutil.rmtree, cls.library_dir) + + with contextlib.ExitStack() as stack: +- python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools_wheel("venv")) ++ python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools("venv")) + sitepackages = subprocess.check_output( + [python_exe, "-c", "import sysconfig; print(sysconfig.get_path('platlib'))"], + text=True, diff --git a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch new file mode 100644 index 0000000..d617a6f --- /dev/null +++ b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Fri, 25 Apr 2025 09:33:37 +0200 +Subject: 00461: Downstream only: Install wheel in test venvs when setuptools < + 71 + +--- + Lib/test/support/__init__.py | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py +index bd8860b696..785ca4c3d5 100644 +--- a/Lib/test/support/__init__.py ++++ b/Lib/test/support/__init__.py +@@ -2402,9 +2402,16 @@ def run_command(cmd): + else: + python = os.path.join(venv, 'bin', python_exe) + ++ setuptools_whl = _findwheel('setuptools') ++ whl_filename = os.path.basename(setuptools_whl) ++ setuptools_major = int(whl_filename.split('-')[1].split('.')[0]) ++ if setuptools_major >= 71: # we need 70.1+, but that's OK ++ wheels = (setuptools_whl,) ++ else: ++ wheels = (setuptools_whl, _findwheel('wheel')) + cmd = (python, '-X', 'dev', + '-m', 'pip', 'install', +- _findwheel('setuptools'), ++ *wheels, + ) + run_command(cmd) + diff --git a/python3.13.spec b/python3.13.spec index 0805a72..288c31b 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -302,7 +302,7 @@ BuildRequires: libappstream-glib BuildRequires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 %if %{with tests} BuildRequires: %{python_wheel_pkg_prefix}-setuptools-wheel -BuildRequires: %{python_wheel_pkg_prefix}-wheel-wheel +BuildRequires: (%{python_wheel_pkg_prefix}-wheel-wheel if %{python_wheel_pkg_prefix}-setuptools-wheel < 71) %endif %endif @@ -380,6 +380,18 @@ Patch456: 00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.pat # See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html Patch459: 00459-apply-intel-control-flow-technology-for-x86-64.patch +# 00460 # f876c748b89770cfee4148c3dd3acbc3dd527eb6 +# gh-132415: Update vendored setuptools in ``Lib/test/wheeldata`` +# +# (actual changes in .whl files removed to make this patch smaller) +# +# gh-127906: Add missing sys import to test_cppext +Patch460: 00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch + +# 00461 # 920175020b21c0aff5edcc4c28d688b5061f591c +# Downstream only: Install wheel in test venvs when setuptools < 71 +Patch461: 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -642,7 +654,7 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release} %if %{with rpmwheels} Requires: %{python_wheel_pkg_prefix}-setuptools-wheel -Requires: %{python_wheel_pkg_prefix}-wheel-wheel +Requires: (%{python_wheel_pkg_prefix}-wheel-wheel if %{python_wheel_pkg_prefix}-setuptools-wheel < 71) %else Provides: bundled(python3dist(setuptools)) = %{setuptools_version} %setuptools_bundled_provides @@ -707,7 +719,7 @@ Summary: Free Threading (PEP 703) version of the Python runtime %if %{with rpmwheels} Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 Requires: %{python_wheel_pkg_prefix}-setuptools-wheel -Requires: %{python_wheel_pkg_prefix}-wheel-wheel +Requires: (%{python_wheel_pkg_prefix}-wheel-wheel if %{python_wheel_pkg_prefix}-setuptools-wheel < 71) License: %{libs_license} %else Provides: bundled(python3dist(pip)) = %{pip_version} @@ -1733,6 +1745,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue May 06 2025 Miro Hrončok - 3.13.3-3 +- Drop requirement on python-wheel-wheel with setuptools >= 71 + * Tue Apr 22 2025 Charalampos Stratakis - 3.13.3-2 - Apply Intel's CET for mitigation against control-flow hijacking attacks From 2198fa7927a99f739600915e909b2dfa50919285 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 6 May 2025 03:12:09 +0200 Subject: [PATCH 075/115] Add perf to the testing BuildRequires Perf profiling showing the Python functions is only supported on x86_64 and aarch64 at the moment. Adding perf as a BuildRequires allows tests that utilize the perf binary to run. --- python3.13.spec | 5 +++++ tests/tests.yml | 1 + 2 files changed, 6 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index 288c31b..dac363e 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -280,6 +280,11 @@ BuildRequires: gcc-c++ BuildRequires: gdb BuildRequires: glibc-all-langpacks BuildRequires: tzdata + +# Perf support is only available on x86_64 and aarch64 right now +%ifarch x86_64 aarch64 +BuildRequires: perf +%endif %endif %if %{with jit} diff --git a/tests/tests.yml b/tests/tests.yml index 8a4ba6b..32fbb39 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -65,3 +65,4 @@ - glibc-all-langpacks # for locale tests - marshalparser # for testing compatibility (magic numbers) with marshalparser - rpm # for debugging + - perf # for test_perf_profiler From 093e433f0c24c41d1e0529633b3f9035cb2b3ea4 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 14:02:26 +0200 Subject: [PATCH 076/115] Rebuilt as non-main Python on Fedora 43 --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index dac363e..b18040d 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 4%{?dist} License: Python-2.0.1 @@ -1750,6 +1750,9 @@ CheckPython freethreading # ====================================================== %changelog +* Mon Jun 02 2025 Python Maint - 3.13.3-4 +- Rebuilt as non-main Python on Fedora 43 + * Tue May 06 2025 Miro Hrončok - 3.13.3-3 - Drop requirement on python-wheel-wheel with setuptools >= 71 From b13a982a6263b25c13a83310551e6d13467e5f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 4 Jun 2025 08:47:43 +0200 Subject: [PATCH 077/115] Update to 3.13.4 --- 00251-change-user-install-location.patch | 4 +- ...oken-rst-with-rstfile-as-an-argument.patch | 24 ------- ...ame-in-test_group_no_follow_symlinks.patch | 23 ------- ...l-control-flow-technology-for-x86-64.patch | 68 ------------------- ...red-setuptools-in-lib-test-wheeldata.patch | 23 ++----- ...eel-in-test-venvs-when-setuptools-71.patch | 4 +- python3.13.spec | 53 +++++---------- sources | 4 +- 8 files changed, 29 insertions(+), 174 deletions(-) delete mode 100644 00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch delete mode 100644 00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch delete mode 100644 00459-apply-intel-control-flow-technology-for-x86-64.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 2d2b66e..a4a78b6 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,10 +30,10 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index 89a81c55cb..950e2e337f 100644 +index aedf36399c..2ae49a8029 100644 --- a/Lib/site.py +++ b/Lib/site.py -@@ -414,8 +414,15 @@ def getsitepackages(prefixes=None): +@@ -415,8 +415,15 @@ def getsitepackages(prefixes=None): return sitepackages def addsitepackages(known_paths, prefixes=None): diff --git a/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch b/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch deleted file mode 100644 index 228a03a..0000000 --- a/00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Wed, 9 Apr 2025 10:47:48 +0200 -Subject: 00454: Invoke regen-token rst with rstfile as an argument - -Proposed upstream: https://github.com/python/cpython/pull/132304 ---- - Makefile.pre.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 3bd4495f95..d7a4e4b320 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -1784,7 +1784,8 @@ regen-token: - # using Tools/build/generate_token.py - $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py rst \ - $(srcdir)/Grammar/Tokens \ -- $(srcdir)/Doc/library/token-list.inc -+ $(srcdir)/Doc/library/token-list.inc \ -+ $(srcdir)/Doc/library/token.rst - # Regenerate Include/internal/pycore_token.h from Grammar/Tokens - # using Tools/build/generate_token.py - $(PYTHON_FOR_REGEN) $(srcdir)/Tools/build/generate_token.py h \ diff --git a/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch b/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch deleted file mode 100644 index 0627f0f..0000000 --- a/00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Thu, 10 Apr 2025 15:11:41 +0200 -Subject: 00456: Find the correct group name in test_group_no_follow_symlinks - -Proposed upstream: https://github.com/python/cpython/pull/132357 ---- - Lib/test/test_pathlib/test_pathlib.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py -index 1f01ce40da..2b9aad1426 100644 ---- a/Lib/test/test_pathlib/test_pathlib.py -+++ b/Lib/test/test_pathlib/test_pathlib.py -@@ -781,7 +781,7 @@ def test_group_no_follow_symlinks(self): - os.chown(link, -1, gid_2, follow_symlinks=False) - - expected_gid = link.stat(follow_symlinks=False).st_gid -- expected_name = self._get_pw_name_or_skip_test(expected_gid) -+ expected_name = self._get_gr_name_or_skip_test(expected_gid) - - self.assertEqual(expected_gid, gid_2) - self.assertEqual(expected_name, link.group(follow_symlinks=False)) diff --git a/00459-apply-intel-control-flow-technology-for-x86-64.patch b/00459-apply-intel-control-flow-technology-for-x86-64.patch deleted file mode 100644 index 98d5eee..0000000 --- a/00459-apply-intel-control-flow-technology-for-x86-64.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Charalampos Stratakis -Date: Wed, 8 Jan 2025 04:58:22 +0100 -Subject: 00459: Apply Intel Control-flow Technology for x86-64 - -Required for mitigation against return-oriented programming (ROP) and Call or Jump Oriented Programming (COP/JOP) attacks - -Proposed upstream: https://github.com/python/cpython/pull/128606 - -See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html ---- - Python/asm_trampoline.S | 22 ++++++++++++++++++++++ - Python/perf_jit_trampoline.c | 4 ++++ - 2 files changed, 26 insertions(+) - -diff --git a/Python/asm_trampoline.S b/Python/asm_trampoline.S -index 0a3265dfee..616752459b 100644 ---- a/Python/asm_trampoline.S -+++ b/Python/asm_trampoline.S -@@ -9,6 +9,9 @@ - # } - _Py_trampoline_func_start: - #ifdef __x86_64__ -+#if defined(__CET__) && (__CET__ & 1) -+ endbr64 -+#endif - sub $8, %rsp - call *%rcx - add $8, %rsp -@@ -34,3 +37,22 @@ _Py_trampoline_func_start: - .globl _Py_trampoline_func_end - _Py_trampoline_func_end: - .section .note.GNU-stack,"",@progbits -+# Note for indicating the assembly code supports CET -+#if defined(__x86_64__) && defined(__CET__) && (__CET__ & 1) -+ .section .note.gnu.property,"a" -+ .align 8 -+ .long 1f - 0f -+ .long 4f - 1f -+ .long 5 -+0: -+ .string "GNU" -+1: -+ .align 8 -+ .long 0xc0000002 -+ .long 3f - 2f -+2: -+ .long 0x3 -+3: -+ .align 8 -+4: -+#endif // __x86_64__ -diff --git a/Python/perf_jit_trampoline.c b/Python/perf_jit_trampoline.c -index 0a8945958b..e9cc7758ba 100644 ---- a/Python/perf_jit_trampoline.c -+++ b/Python/perf_jit_trampoline.c -@@ -472,7 +472,11 @@ elf_init_ehframe(ELFObjectContext* ctx) - DWRF_U8(0); /* Augmentation data. */ - /* Registers saved in CFRAME. */ - #ifdef __x86_64__ -+# if defined(__CET__) && (__CET__ & 1) -+ DWRF_U8(DWRF_CFA_advance_loc | 8); -+# else - DWRF_U8(DWRF_CFA_advance_loc | 4); -+# endif - DWRF_U8(DWRF_CFA_def_cfa_offset); DWRF_UV(16); - DWRF_U8(DWRF_CFA_advance_loc | 6); - DWRF_U8(DWRF_CFA_def_cfa_offset); DWRF_UV(8); diff --git a/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch b/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch index b77c644..3553fb3 100644 --- a/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch +++ b/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch @@ -16,15 +16,14 @@ Co-Authored-By: Victor Stinner Lib/test/support/__init__.py | 14 +++++++------- Lib/test/test_cext/__init__.py | 2 +- Lib/test/test_cppext/__init__.py | 2 +- - Lib/test/test_cppext/setup.py | 1 + Lib/test/test_peg_generator/test_c_parser.py | 2 +- - 5 files changed, 11 insertions(+), 10 deletions(-) + 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py -index 78cf4b3ca8..bd8860b696 100644 +index f4cc51a918..6350d7c0a9 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py -@@ -2360,7 +2360,7 @@ def _findwheel(pkgname): +@@ -2361,7 +2361,7 @@ def _findwheel(pkgname): filenames = os.listdir(wheel_dir) filenames = sorted(filenames, reverse=True) # approximate "newest" first for filename in filenames: @@ -33,7 +32,7 @@ index 78cf4b3ca8..bd8860b696 100644 if not filename.endswith(".whl"): continue prefix = pkgname + '-' -@@ -2369,16 +2369,16 @@ def _findwheel(pkgname): +@@ -2370,16 +2370,16 @@ def _findwheel(pkgname): raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}") @@ -54,7 +53,7 @@ index 78cf4b3ca8..bd8860b696 100644 print() print('Run:', ' '.join(map(shlex.quote, cmd))) subprocess.run(cmd, check=True) -@@ -2402,10 +2402,10 @@ def run_command(cmd): +@@ -2403,10 +2403,10 @@ def run_command(cmd): else: python = os.path.join(venv, 'bin', python_exe) @@ -93,18 +92,6 @@ index d519522730..e7130f6fc6 100644 self._check_build(extension_name, python_exe, std=std, limited=limited) -diff --git a/Lib/test/test_cppext/setup.py b/Lib/test/test_cppext/setup.py -index 019ff18446..25d71cd9a2 100644 ---- a/Lib/test/test_cppext/setup.py -+++ b/Lib/test/test_cppext/setup.py -@@ -3,6 +3,7 @@ - import os - import platform - import shlex -+import sys - import sysconfig - from test import support - diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py index 1411e55dd0..1095e7303c 100644 --- a/Lib/test/test_peg_generator/test_c_parser.py diff --git a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch index d617a6f..b1d2620 100644 --- a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch +++ b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch @@ -9,10 +9,10 @@ Subject: 00461: Downstream only: Install wheel in test venvs when setuptools < 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py -index bd8860b696..785ca4c3d5 100644 +index 6350d7c0a9..64b3a8300e 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py -@@ -2402,9 +2402,16 @@ def run_command(cmd): +@@ -2403,9 +2403,16 @@ def run_command(cmd): else: python = os.path.join(venv, 'bin', python_exe) diff --git a/python3.13.spec b/python3.13.spec index b18040d..53262a4 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -13,11 +13,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.3 +%global general_version %{pybasever}.4 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 4%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -57,30 +57,32 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 25.0.1 +%global pip_version 25.1.1 %global setuptools_version 67.6.1 %global wheel_version 0.43.0 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: -Provides: bundled(python3dist(cachecontrol)) = 0.14.1 -Provides: bundled(python3dist(certifi)) = 2024.8.30 +Provides: bundled(python3dist(cachecontrol)) = 0.14.2 +Provides: bundled(python3dist(certifi)) = 2025.1.31 +Provides: bundled(python3dist(dependency-groups)) = 1.3.1 Provides: bundled(python3dist(distlib)) = 0.3.9 Provides: bundled(python3dist(distro)) = 1.9 Provides: bundled(python3dist(idna)) = 3.10 Provides: bundled(python3dist(msgpack)) = 1.1 -Provides: bundled(python3dist(packaging)) = 24.2 -Provides: bundled(python3dist(platformdirs)) = 4.3.6 -Provides: bundled(python3dist(pygments)) = 2.18 +Provides: bundled(python3dist(packaging)) = 25 +Provides: bundled(python3dist(platformdirs)) = 4.3.7 +Provides: bundled(python3dist(pygments)) = 2.19.1 Provides: bundled(python3dist(pyproject-hooks)) = 1.2 Provides: bundled(python3dist(requests)) = 2.32.3 -Provides: bundled(python3dist(resolvelib)) = 1.0.1 -Provides: bundled(python3dist(rich)) = 13.9.4 +Provides: bundled(python3dist(resolvelib)) = 1.1 +Provides: bundled(python3dist(rich)) = 14 Provides: bundled(python3dist(setuptools)) = 70.3 Provides: bundled(python3dist(tomli)) = 2.2.1 -Provides: bundled(python3dist(truststore)) = 0.10 -Provides: bundled(python3dist(typing-extensions)) = 4.12.2 +Provides: bundled(python3dist(tomli-w)) = 1.2 +Provides: bundled(python3dist(truststore)) = 0.10.1 +Provides: bundled(python3dist(typing-extensions)) = 4.13.2 Provides: bundled(python3dist(urllib3)) = 1.26.20 } # setuptools @@ -363,29 +365,7 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00454 # 1d5d7e9ce724fbbd89645d637303d12731c2a622 -# Invoke regen-token rst with rstfile as an argument -# -# Proposed upstream: https://github.com/python/cpython/pull/132304 -Patch454: 00454-invoke-regen-token-rst-with-rstfile-as-an-argument.patch - -# 00456 # 8f50cf7170e39c02d52cb5f99d647eeefad2f685 -# Find the correct group name in test_group_no_follow_symlinks -# -# Proposed upstream: https://github.com/python/cpython/pull/132357 -Patch456: 00456-find-the-correct-group-name-in-test_group_no_follow_symlinks.patch - -# 00459 # 9cf6fed17de184d2e17ace2b5063e782e7e186ba -# Apply Intel Control-flow Technology for x86-64 -# -# Required for mitigation against return-oriented programming (ROP) and Call or Jump Oriented Programming (COP/JOP) attacks -# -# Proposed upstream: https://github.com/python/cpython/pull/128606 -# -# See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html -Patch459: 00459-apply-intel-control-flow-technology-for-x86-64.patch - -# 00460 # f876c748b89770cfee4148c3dd3acbc3dd527eb6 +# 00460 # c0bff2b6359f503d3fc72bdba9f07a25519a4cdd # gh-132415: Update vendored setuptools in ``Lib/test/wheeldata`` # # (actual changes in .whl files removed to make this patch smaller) @@ -1750,6 +1730,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Jun 04 2025 Tomáš Hrnčiar - 3.13.4-1 +- Update to 3.13.4 + * Mon Jun 02 2025 Python Maint - 3.13.3-4 - Rebuilt as non-main Python on Fedora 43 diff --git a/sources b/sources index f101eff..4d0dbd1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.3.tar.xz) = f7559b6dceae69f48742af0a6497fbec42cd1e5304f64b6eb9d89222a1171ccf12fa186cc0decabb4e98d05223184967a4a7537754c01083dacdc9073cb1a578 -SHA512 (Python-3.13.3.tar.xz.asc) = 54f8da5f4a4dcadc9830cb07aecf695a26a2de48ab98e1f42b09fdde1c70989476d07ce7ea81337216f1e5fcbf6b688e0608c88a2545ced416b01640108e94db +SHA512 (Python-3.13.4.tar.xz) = 91454bb4d04c192721d2df980a806858bd8aadb5cef92159c2844cc33e92b0386b1b33d5cfff0f69d449e9f978a5f67f6032155f7b1425ff38e36477637c0c68 +SHA512 (Python-3.13.4.tar.xz.asc) = ba9c1dee0f3bf564e6ac19cbe08cf4fdc3779a04ed8289654f6dda3fba9f07a0937764a12f1e7e2f6d7ff17bb5b86c05b8ea19296a2b98d1c81a48362ccf6104 From d1bf28e630a3b03e56030c61515392faa3a85d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 5 Jun 2025 11:40:47 +0200 Subject: [PATCH 078/115] Revert "Add perf to the testing BuildRequires" This reverts commit 2198fa7927a99f739600915e909b2dfa50919285. The test fails for 3.13.4. --- python3.13.spec | 5 ----- tests/tests.yml | 1 - 2 files changed, 6 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 53262a4..220f1e2 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -282,11 +282,6 @@ BuildRequires: gcc-c++ BuildRequires: gdb BuildRequires: glibc-all-langpacks BuildRequires: tzdata - -# Perf support is only available on x86_64 and aarch64 right now -%ifarch x86_64 aarch64 -BuildRequires: perf -%endif %endif %if %{with jit} diff --git a/tests/tests.yml b/tests/tests.yml index 32fbb39..8a4ba6b 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -65,4 +65,3 @@ - glibc-all-langpacks # for locale tests - marshalparser # for testing compatibility (magic numbers) with marshalparser - rpm # for debugging - - perf # for test_perf_profiler From 2eee834815374dd8365df1502f0ec75e7f78c1ea Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 12 Jun 2025 02:49:36 +0200 Subject: [PATCH 079/115] Enable PAC and BTI hardware protections for aarch64 --- ...-pac-and-bti-protections-for-aarch64.patch | 102 ++++++++++++++++++ python3.13.spec | 22 +++- 2 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 00464-enable-pac-and-bti-protections-for-aarch64.patch diff --git a/00464-enable-pac-and-bti-protections-for-aarch64.patch b/00464-enable-pac-and-bti-protections-for-aarch64.patch new file mode 100644 index 0000000..9404072 --- /dev/null +++ b/00464-enable-pac-and-bti-protections-for-aarch64.patch @@ -0,0 +1,102 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charalampos Stratakis +Date: Tue, 3 Jun 2025 03:02:15 +0200 +Subject: 00464: Enable PAC and BTI protections for aarch64 + +Apply protection against ROP/JOP attacks for aarch64 on asm_trampoline.S + +The BTI flag must be applied in the assembler sources for this class +of attacks to be mitigated on newer aarch64 processors. + +Upstream PR: https://github.com/python/cpython/pull/130864/files + +The upstream patch is incomplete but only for the case where +frame pointers are not used on 3.13+. + +Since on Fedora we always compile with frame pointers the BTI/PAC +hardware protections can be enabled without losing Perf unwinding. +--- + Python/asm_trampoline.S | 4 +++ + Python/asm_trampoline_aarch64.h | 50 +++++++++++++++++++++++++++++++++ + 2 files changed, 54 insertions(+) + create mode 100644 Python/asm_trampoline_aarch64.h + +diff --git a/Python/asm_trampoline.S b/Python/asm_trampoline.S +index 616752459b..ec205a08ef 100644 +--- a/Python/asm_trampoline.S ++++ b/Python/asm_trampoline.S +@@ -1,3 +1,5 @@ ++#include "asm_trampoline_aarch64.h" ++ + .text + .globl _Py_trampoline_func_start + # The following assembly is equivalent to: +@@ -20,10 +22,12 @@ _Py_trampoline_func_start: + #if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__) + // ARM64 little endian, 64bit ABI + // generate with aarch64-linux-gnu-gcc 12.1 ++ SIGN_LR + stp x29, x30, [sp, -16]! + mov x29, sp + blr x3 + ldp x29, x30, [sp], 16 ++ VERIFY_LR + ret + #endif + #ifdef __riscv +diff --git a/Python/asm_trampoline_aarch64.h b/Python/asm_trampoline_aarch64.h +new file mode 100644 +index 0000000000..4b0ec4a7dc +--- /dev/null ++++ b/Python/asm_trampoline_aarch64.h +@@ -0,0 +1,50 @@ ++#ifndef ASM_TRAMPOLINE_AARCH_64_H_ ++#define ASM_TRAMPOLINE_AARCH_64_H_ ++ ++/* ++ * References: ++ * - https://developer.arm.com/documentation/101028/0012/5--Feature-test-macros ++ * - https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst ++ */ ++ ++#if defined(__ARM_FEATURE_BTI_DEFAULT) && __ARM_FEATURE_BTI_DEFAULT == 1 ++ #define BTI_J hint 36 /* bti j: for jumps, IE br instructions */ ++ #define BTI_C hint 34 /* bti c: for calls, IE bl instructions */ ++ #define GNU_PROPERTY_AARCH64_BTI 1 /* bit 0 GNU Notes is for BTI support */ ++#else ++ #define BTI_J ++ #define BTI_C ++ #define GNU_PROPERTY_AARCH64_BTI 0 ++#endif ++ ++#if defined(__ARM_FEATURE_PAC_DEFAULT) ++ #if __ARM_FEATURE_PAC_DEFAULT & 1 ++ #define SIGN_LR hint 25 /* paciasp: sign with the A key */ ++ #define VERIFY_LR hint 29 /* autiasp: verify with the A key */ ++ #elif __ARM_FEATURE_PAC_DEFAULT & 2 ++ #define SIGN_LR hint 27 /* pacibsp: sign with the b key */ ++ #define VERIFY_LR hint 31 /* autibsp: verify with the b key */ ++ #endif ++ #define GNU_PROPERTY_AARCH64_POINTER_AUTH 2 /* bit 1 GNU Notes is for PAC support */ ++#else ++ #define SIGN_LR BTI_C ++ #define VERIFY_LR ++ #define GNU_PROPERTY_AARCH64_POINTER_AUTH 0 ++#endif ++ ++/* Add the BTI and PAC support to GNU Notes section */ ++#if GNU_PROPERTY_AARCH64_BTI != 0 || GNU_PROPERTY_AARCH64_POINTER_AUTH != 0 ++ .pushsection .note.gnu.property, "a"; /* Start a new allocatable section */ ++ .balign 8; /* align it on a byte boundry */ ++ .long 4; /* size of "GNU\0" */ ++ .long 0x10; /* size of descriptor */ ++ .long 0x5; /* NT_GNU_PROPERTY_TYPE_0 */ ++ .asciz "GNU"; ++ .long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */ ++ .long 4; /* Four bytes of data */ ++ .long (GNU_PROPERTY_AARCH64_BTI|GNU_PROPERTY_AARCH64_POINTER_AUTH); /* BTI or PAC is enabled */ ++ .long 0; /* padding for 8 byte alignment */ ++ .popsection; /* end the section */ ++#endif ++ ++#endif diff --git a/python3.13.spec b/python3.13.spec index 220f1e2..20ac6bb 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -372,6 +372,23 @@ Patch460: 00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch # Downstream only: Install wheel in test venvs when setuptools < 71 Patch461: 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch +# 00464 # 292acffec7a379cb6d1f3c47b9e5a2f170bbadb6 +# Enable PAC and BTI protections for aarch64 +# +# Apply protection against ROP/JOP attacks for aarch64 on asm_trampoline.S +# +# The BTI flag must be applied in the assembler sources for this class +# of attacks to be mitigated on newer aarch64 processors. +# +# Upstream PR: https://github.com/python/cpython/pull/130864/files +# +# The upstream patch is incomplete but only for the case where +# frame pointers are not used on 3.13+. +# +# Since on Fedora we always compile with frame pointers the BTI/PAC +# hardware protections can be enabled without losing Perf unwinding. +Patch464: 00464-enable-pac-and-bti-protections-for-aarch64.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1725,6 +1742,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Jun 12 2025 Charalampos Stratakis - 3.13.4-2 +- Enable PAC and BTI hardware protections for aarch64 + * Wed Jun 04 2025 Tomáš Hrnčiar - 3.13.4-1 - Update to 3.13.4 From ae868353c389472f902f8709904dca98e6f3ea24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 12 Jun 2025 12:10:14 +0200 Subject: [PATCH 080/115] Update to 3.13.5 --- ...red-setuptools-in-lib-test-wheeldata.patch | 107 ------------------ ...eel-in-test-venvs-when-setuptools-71.patch | 4 +- python3.13.spec | 65 +++++------ sources | 4 +- 4 files changed, 31 insertions(+), 149 deletions(-) delete mode 100644 00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch diff --git a/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch b/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch deleted file mode 100644 index 3553fb3..0000000 --- a/00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> -Date: Fri, 25 Apr 2025 00:46:20 +0100 -Subject: 00460: gh-132415: Update vendored setuptools in - ``Lib/test/wheeldata`` - -(cherry picked from commit c9f3f5b4ed52d7bed6073ffa39717ece47202558) -(actual changes in .whl files removed to make this patch smaller) - -gh-127906: Add missing sys import to test_cppext - -(cherry picked from commit 9cba14881b371b1e95d57877896169c4605f9b75) - -Co-Authored-By: Victor Stinner ---- - Lib/test/support/__init__.py | 14 +++++++------- - Lib/test/test_cext/__init__.py | 2 +- - Lib/test/test_cppext/__init__.py | 2 +- - Lib/test/test_peg_generator/test_c_parser.py | 2 +- - 4 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py -index f4cc51a918..6350d7c0a9 100644 ---- a/Lib/test/support/__init__.py -+++ b/Lib/test/support/__init__.py -@@ -2361,7 +2361,7 @@ def _findwheel(pkgname): - filenames = os.listdir(wheel_dir) - filenames = sorted(filenames, reverse=True) # approximate "newest" first - for filename in filenames: -- # filename is like 'setuptools-67.6.1-py3-none-any.whl' -+ # filename is like 'setuptools-{version}-py3-none-any.whl' - if not filename.endswith(".whl"): - continue - prefix = pkgname + '-' -@@ -2370,16 +2370,16 @@ def _findwheel(pkgname): - raise FileNotFoundError(f"No wheel for {pkgname} found in {wheel_dir}") - - --# Context manager that creates a virtual environment, install setuptools and wheel in it --# and returns the path to the venv directory and the path to the python executable -+# Context manager that creates a virtual environment, install setuptools in it, -+# and returns the paths to the venv directory and the python executable - @contextlib.contextmanager --def setup_venv_with_pip_setuptools_wheel(venv_dir): -- import shlex -+def setup_venv_with_pip_setuptools(venv_dir): - import subprocess - from .os_helper import temp_cwd - - def run_command(cmd): - if verbose: -+ import shlex - print() - print('Run:', ' '.join(map(shlex.quote, cmd))) - subprocess.run(cmd, check=True) -@@ -2403,10 +2403,10 @@ def run_command(cmd): - else: - python = os.path.join(venv, 'bin', python_exe) - -- cmd = [python, '-X', 'dev', -+ cmd = (python, '-X', 'dev', - '-m', 'pip', 'install', - _findwheel('setuptools'), -- _findwheel('wheel')] -+ ) - run_command(cmd) - - yield python -diff --git a/Lib/test/test_cext/__init__.py b/Lib/test/test_cext/__init__.py -index 54859f9ff7..57f31c900d 100644 ---- a/Lib/test/test_cext/__init__.py -+++ b/Lib/test/test_cext/__init__.py -@@ -50,7 +50,7 @@ def test_build_limited_c11(self): - - def check_build(self, extension_name, std=None, limited=False): - venv_dir = 'env' -- with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe: -+ with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe: - self._check_build(extension_name, python_exe, - std=std, limited=limited) - -diff --git a/Lib/test/test_cppext/__init__.py b/Lib/test/test_cppext/__init__.py -index d519522730..e7130f6fc6 100644 ---- a/Lib/test/test_cppext/__init__.py -+++ b/Lib/test/test_cppext/__init__.py -@@ -47,7 +47,7 @@ def test_build_limited(self): - - def check_build(self, extension_name, std=None, limited=False): - venv_dir = 'env' -- with support.setup_venv_with_pip_setuptools_wheel(venv_dir) as python_exe: -+ with support.setup_venv_with_pip_setuptools(venv_dir) as python_exe: - self._check_build(extension_name, python_exe, - std=std, limited=limited) - -diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py -index 1411e55dd0..1095e7303c 100644 ---- a/Lib/test/test_peg_generator/test_c_parser.py -+++ b/Lib/test/test_peg_generator/test_c_parser.py -@@ -99,7 +99,7 @@ def setUpClass(cls): - cls.addClassCleanup(shutil.rmtree, cls.library_dir) - - with contextlib.ExitStack() as stack: -- python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools_wheel("venv")) -+ python_exe = stack.enter_context(support.setup_venv_with_pip_setuptools("venv")) - sitepackages = subprocess.check_output( - [python_exe, "-c", "import sysconfig; print(sysconfig.get_path('platlib'))"], - text=True, diff --git a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch index b1d2620..6b071ad 100644 --- a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch +++ b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch @@ -9,10 +9,10 @@ Subject: 00461: Downstream only: Install wheel in test venvs when setuptools < 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py -index 6350d7c0a9..64b3a8300e 100644 +index c2b407159a..5c2efc4a51 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py -@@ -2403,9 +2403,16 @@ def run_command(cmd): +@@ -2428,9 +2428,16 @@ def run_command(cmd): else: python = os.path.join(venv, 'bin', python_exe) diff --git a/python3.13.spec b/python3.13.spec index 20ac6bb..3c8407e 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -13,11 +13,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.4 +%global general_version %{pybasever}.5 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -58,8 +58,7 @@ License: Python-2.0.1 # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl %global pip_version 25.1.1 -%global setuptools_version 67.6.1 -%global wheel_version 0.43.0 +%global setuptools_version 79.0.1 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) @@ -86,27 +85,28 @@ Provides: bundled(python3dist(typing-extensions)) = 4.13.2 Provides: bundled(python3dist(urllib3)) = 1.26.20 } # setuptools -# vendor.txt files not in .whl -# $ %%{_rpmconfigdir}/pythonbundles.py \ -# <(curl -L https://github.com/pypa/setuptools/raw/v%%{setuptools_version}/setuptools/_vendor/vendored.txt) \ -# <(curl -L https://github.com/pypa/setuptools/raw/v%%{setuptools_version}/pkg_resources/_vendor/vendored.txt) +# vendor.txt not in .whl +# Bundled packages are defined in multiple files. Generate the list with: +# git clone https://github.com/pypa/setuptools && git switch v%%{setuptools_version} +# pip freeze --path setuptools/_vendor > vendored.txt +# %%{_rpmconfigdir}/pythonbundles.py vendored.txt %global setuptools_bundled_provides %{expand: -Provides: bundled(python3dist(importlib-metadata)) = 6 -Provides: bundled(python3dist(importlib-resources)) = 5.10.2 -Provides: bundled(python3dist(jaraco-text)) = 3.7 -Provides: bundled(python3dist(more-itertools)) = 8.8 -Provides: bundled(python3dist(ordered-set)) = 3.1.1 -Provides: bundled(python3dist(packaging)) = 23 -Provides: bundled(python3dist(platformdirs)) = 2.6.2 +Provides: bundled(python3dist(autocommand)) = 2.2.2 +Provides: bundled(python3dist(backports-tarfile)) = 1.2 +Provides: bundled(python3dist(importlib-metadata)) = 8 +Provides: bundled(python3dist(inflect)) = 7.3.1 +Provides: bundled(python3dist(jaraco-collections)) = 5.1 +Provides: bundled(python3dist(jaraco-context)) = 5.3 +Provides: bundled(python3dist(jaraco-functools)) = 4.0.1 +Provides: bundled(python3dist(jaraco-text)) = 3.12.1 +Provides: bundled(python3dist(more-itertools)) = 10.3 +Provides: bundled(python3dist(packaging)) = 24.2 +Provides: bundled(python3dist(platformdirs)) = 4.2.2 Provides: bundled(python3dist(tomli)) = 2.0.1 -Provides: bundled(python3dist(typing-extensions)) = 4.0.1 -Provides: bundled(python3dist(typing-extensions)) = 4.4 -Provides: bundled(python3dist(zipp)) = 3.7 -} -# wheel -# $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheeldata/wheel-*.whl wheel/vendored/vendor.txt) -%global wheel_bundled_provides %{expand: -Provides: bundled(python3dist(packaging)) = 24 +Provides: bundled(python3dist(typeguard)) = 4.3 +Provides: bundled(python3dist(typing-extensions)) = 4.12.2 +Provides: bundled(python3dist(wheel)) = 0.45.1 +Provides: bundled(python3dist(zipp)) = 3.19.2 } # Expensive optimizations (mainly, profile-guided optimizations) @@ -360,14 +360,6 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00460 # c0bff2b6359f503d3fc72bdba9f07a25519a4cdd -# gh-132415: Update vendored setuptools in ``Lib/test/wheeldata`` -# -# (actual changes in .whl files removed to make this patch smaller) -# -# gh-127906: Add missing sys import to test_cppext -Patch460: 00460-gh-132415-update-vendored-setuptools-in-lib-test-wheeldata.patch - # 00461 # 920175020b21c0aff5edcc4c28d688b5061f591c # Downstream only: Install wheel in test venvs when setuptools < 71 Patch461: 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch @@ -655,8 +647,6 @@ Requires: (%{python_wheel_pkg_prefix}-wheel-wheel if %{python_wheel_pkg_prefix}- %else Provides: bundled(python3dist(setuptools)) = %{setuptools_version} %setuptools_bundled_provides -Provides: bundled(python3dist(wheel)) = %{wheel_version} -%wheel_bundled_provides # License manually combined from Python + setuptools + wheel License: Python-2.0.1 AND MIT AND Apache-2.0 AND (Apache-2.0 OR BSD-2-Clause) %endif @@ -723,9 +713,7 @@ Provides: bundled(python3dist(pip)) = %{pip_version} %pip_bundled_provides Provides: bundled(python3dist(setuptools)) = %{setuptools_version} %setuptools_bundled_provides -Provides: bundled(python3dist(wheel)) = %{wheel_version} -%wheel_bundled_provides -# License combined from Python libs + pip + setuptools + wheel +# License combined from Python libs + pip + setuptools License: %{libs_license} AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) %endif @@ -788,13 +776,11 @@ extension modules. # setuptools.whl does not contain the vendored.txt files if [ -f %{_rpmconfigdir}/pythonbundles.py ]; then %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) --compare-with '%pip_bundled_provides' - %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/test/wheeldata/wheel-*.whl wheel/vendored/vendor.txt) --compare-with '%wheel_bundled_provides' fi %if %{with rpmwheels} rm Lib/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl rm Lib/test/wheeldata/setuptools-%{setuptools_version}-py3-none-any.whl -rm Lib/test/wheeldata/wheel-%{wheel_version}-py3-none-any.whl %endif # Remove all exe files to ensure we are not shipping prebuilt binaries @@ -1742,6 +1728,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Jun 12 2025 Miro Hrončok - 3.13.5-1 +- Update to 3.13.5 + * Thu Jun 12 2025 Charalampos Stratakis - 3.13.4-2 - Enable PAC and BTI hardware protections for aarch64 diff --git a/sources b/sources index 4d0dbd1..0bc8e56 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.4.tar.xz) = 91454bb4d04c192721d2df980a806858bd8aadb5cef92159c2844cc33e92b0386b1b33d5cfff0f69d449e9f978a5f67f6032155f7b1425ff38e36477637c0c68 -SHA512 (Python-3.13.4.tar.xz.asc) = ba9c1dee0f3bf564e6ac19cbe08cf4fdc3779a04ed8289654f6dda3fba9f07a0937764a12f1e7e2f6d7ff17bb5b86c05b8ea19296a2b98d1c81a48362ccf6104 +SHA512 (Python-3.13.5.tar.xz) = 2a058072e87b614b204bd1321b2bfa9c4b6614dbd5ded98dc0ee51c0d6b81504f902b7c003ad14295b371a37918f6975dc37d5a9c836dd9c30f8b086e4759193 +SHA512 (Python-3.13.5.tar.xz.asc) = 07c1a2ec2d6ba2805680b7f1dc262fdc5dc3eec4503780ecdc08cd570ccbb5f1efa736ee03c83d36bdb33ce87db06be5892cf5a6eaf4018d5fe78fff99e615ae From 17339454efdbc520b2031c6c706f5f3495525a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 13 May 2025 17:29:44 +0000 Subject: [PATCH 081/115] Verify bundled() provides for setuptools.whl --- python3.13.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 3c8407e..0276039 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -86,10 +86,7 @@ Provides: bundled(python3dist(urllib3)) = 1.26.20 } # setuptools # vendor.txt not in .whl -# Bundled packages are defined in multiple files. Generate the list with: -# git clone https://github.com/pypa/setuptools && git switch v%%{setuptools_version} -# pip freeze --path setuptools/_vendor > vendored.txt -# %%{_rpmconfigdir}/pythonbundles.py vendored.txt +# %%{_rpmconfigdir}/pythonbundles.py <(unzip -l Lib/test/wheeldata/setuptools-*.whl | grep -E '_vendor/.+dist-info/RECORD' | sed -E 's@^.*/([^-]+)-([^-]+)\.dist-info/.*$@\1==\2@') %global setuptools_bundled_provides %{expand: Provides: bundled(python3dist(autocommand)) = 2.2.2 Provides: bundled(python3dist(backports-tarfile)) = 1.2 @@ -776,6 +773,7 @@ extension modules. # setuptools.whl does not contain the vendored.txt files if [ -f %{_rpmconfigdir}/pythonbundles.py ]; then %{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) --compare-with '%pip_bundled_provides' + %{_rpmconfigdir}/pythonbundles.py <(unzip -l Lib/test/wheeldata/setuptools-*.whl | grep -E '_vendor/.+dist-info/RECORD' | sed -E 's@^.*/([^-]+)-([^-]+)\.dist-info/.*$@\1==\2@') --compare-with '%setuptools_bundled_provides' fi %if %{with rpmwheels} From 8df7c5a7363b09d52d3b08884bd8b6aa20816d2a Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 24 Jun 2025 11:22:52 +0200 Subject: [PATCH 082/115] Remove the upper version bound from expat library It's already greater than 2.6 in all Fedoras. --- python3.13.spec | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 0276039..6f5dd91 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -243,8 +243,7 @@ Obsoletes: python%{pybasever}%{?1:-%{1}}\ BuildRequires: autoconf BuildRequires: bluez-libs-devel BuildRequires: bzip2-devel -# See the runtime requirement in the -libs subpackage -BuildRequires: expat-devel >= 2.6 +BuildRequires: expat-devel BuildRequires: findutils BuildRequires: gcc BuildRequires: gdbm-devel @@ -536,14 +535,6 @@ Recommends: (%{pkgname}-tkinter%{?_isa} = %{version}-%{release} if tk%{?_isa}) # The zoneinfo module needs tzdata Requires: tzdata -# The requirement on libexpat is generated, but we need to version it. -# When built with expat >= 2.6, but installed with older expat, we get: -# ImportError: /usr/lib64/python3.X/lib-dynload/pyexpat.cpython-....so: -# undefined symbol: XML_SetReparseDeferralEnabled -# This breaks many things, including python -m venv. -# Other subpackages (like -debug) also need this, but they all depend on -libs. -Requires: expat >= 2.6 - %description -n %{pkgname}-libs This package contains runtime libraries for use by Python: - the majority of the Python standard library @@ -720,7 +711,6 @@ License: %{libs_license} AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND IS Provides: bundled(libb2) = 0.98.1 Provides: bundled(mimalloc) = 2.12 Requires: tzdata -Requires: expat >= 2.6 %description -n python%{pybasever}-freethreading The provisional Free Threading (PEP 703) build of Python. From c6f6c7c52282e22cf18ce8f299cdfa5d491842f5 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 24 Jun 2025 11:26:09 +0200 Subject: [PATCH 083/115] Define %python3_pkgversion based on the Python's status Main Python should retain the value '3', non-main the major-minor one. We need that to request the correctly versioned wheels for EPEL builds. --- python3.13.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index 6f5dd91..ea7c16b 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -140,9 +140,11 @@ Provides: bundled(python3dist(zipp)) = 3.19.2 %if %{with main_python} %global pkgname python3 %global exename python3 +%global python3_pkgversion 3 %else %global pkgname python%{pybasever} %global exename python%{pybasever} +%global python3_pkgversion %{pybasever} %endif # ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac From a7e6af421eb682bba9f1bf41347a96f1efcdff6c Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 24 Jun 2025 13:22:09 +0200 Subject: [PATCH 084/115] Downstream patch: Skip tests not working with older expat version This will ensure the tests run in Fedoras and EPEL 10, but are skipped for EPEL 9. --- ...not-working-with-older-expat-version.patch | 69 +++++++++++++++++++ python3.13.spec | 14 +++- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch new file mode 100644 index 0000000..1653ee5 --- /dev/null +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -0,0 +1,69 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Karolina Surma +Date: Tue, 24 Jun 2025 11:12:13 +0200 +Subject: 00466: Downstream only: Skip tests not working with older expat + version + +We want to run these tests in Fedora and EPEL 10, but not in EPEL 9, +which has too old version of expat. We set the upper bound version +in the conditionalized skip to a release available in CentOS Stream 10, +which is tested as working. +--- + Lib/test/test_pyexpat.py | 2 ++ + Lib/test/test_sax.py | 2 ++ + Lib/test/test_xml_etree.py | 6 ++++++ + 3 files changed, 10 insertions(+) + +diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py +index 1d56ccd71c..5ef5517828 100644 +--- a/Lib/test/test_pyexpat.py ++++ b/Lib/test/test_pyexpat.py +@@ -790,6 +790,8 @@ def start_element(name, _): + + self.assertEqual(started, ['doc']) + ++ @unittest.skipIf(expat.version_info < (2, 7, 1), ++ f"Skip for expat < 2.7.1 (version available in RHEL 10)") + def test_reparse_deferral_disabled(self): + started = [] + +diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py +index 9b3014a94a..90401e0d8f 100644 +--- a/Lib/test/test_sax.py ++++ b/Lib/test/test_sax.py +@@ -1240,6 +1240,8 @@ def test_flush_reparse_deferral_enabled(self): + + self.assertEqual(result.getvalue(), start + b"") + ++ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), ++ f"Skip for expat < 2.7.1 (version available in RHEL 10)") + def test_flush_reparse_deferral_disabled(self): + result = BytesIO() + xmlgen = XMLGenerator(result) +diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py +index bd75c00e50..9a1e020d24 100644 +--- a/Lib/test/test_xml_etree.py ++++ b/Lib/test/test_xml_etree.py +@@ -1521,9 +1521,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): + self.assert_event_tags(parser, [('end', 'root')]) + self.assertIsNone(parser.close()) + ++ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), ++ f"Skip for expat < 2.7.1 (version available in RHEL 10)") + def test_simple_xml_chunk_1(self): + self.test_simple_xml(chunk_size=1, flush=True) + ++ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), ++ f"Skip for expat < 2.7.1 (version available in RHEL 10)") + def test_simple_xml_chunk_5(self): + self.test_simple_xml(chunk_size=5, flush=True) + +@@ -1748,6 +1752,8 @@ def test_flush_reparse_deferral_enabled(self): + + self.assert_event_tags(parser, [('end', 'doc')]) + ++ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), ++ f"Skip for expat < 2.7.1 (version available in RHEL 10)") + def test_flush_reparse_deferral_disabled(self): + parser = ET.XMLPullParser(events=('start', 'end')) + diff --git a/python3.13.spec b/python3.13.spec index ea7c16b..cad7545 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -379,6 +379,15 @@ Patch461: 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.p # hardware protections can be enabled without losing Perf unwinding. Patch464: 00464-enable-pac-and-bti-protections-for-aarch64.patch +# 00466 # e10760fb955ee33d2917f8a57bb4e24d71e5341c +# Downstream only: Skip tests not working with older expat version +# +# We want to run these tests in Fedora and EPEL 10, but not in EPEL 9, +# which has too old version of expat. We set the upper bound version +# in the conditionalized skip to a release available in CentOS Stream 10, +# which is tested as working. +Patch466: 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1718,6 +1727,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Jun 25 2025 Karolina Surma - 3.13.5-2 +- Conditionally skip tests not working with the older expat version + * Thu Jun 12 2025 Miro Hrončok - 3.13.5-1 - Update to 3.13.5 From 1a07ebce6be219de2b079aacf639d4c64277e63b Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 25 Jun 2025 11:53:02 +0200 Subject: [PATCH 085/115] Move the bootstrapping conditionals above the global metadata We need to have it above the Release field, in order for the build NVR to contain the ~bootstrap suffix and sort correctly (lower than the main build). This enables bootstrapping the package directly in Koji side tag. --- python3.13.spec | 118 +++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index cad7545..aefa7b6 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1,3 +1,30 @@ +# ====================== +# Bootstrap conditionals +# ====================== + +# When bootstrapping python3, we need to build python3-packaging. +# but packaging BR python3-devel and that brings in python3-rpm-generators; +# python3-rpm-generators needs python3-packaging, so we cannot have it yet. +# +# We also use the previous build of Python in "make regen-all". +# +# Procedure: https://fedoraproject.org/wiki/SIGs/Python/UpgradingPython +# +# IMPORTANT: When bootstrapping, it's very likely python-pip-wheel is +# not available. Turn off the rpmwheels bcond until +# python-pip is built with a wheel to get around the issue. +%bcond bootstrap 0 + +# Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages +# Uses upstream bundled prebuilt wheels otherwise +%bcond rpmwheels 1 + +# Expensive optimizations (mainly, profile-guided optimizations) +%bcond optimizations 1 + +# Run the test suite in %%check +%bcond tests 1 + # ================== # Top-level metadata # ================== @@ -36,22 +63,42 @@ License: Python-2.0.1 # In ELN/RHEL/CentOS we want to allow building against alternative stacks, so the Provide is enabled. %bcond python_abi_provides_for_alt_pythons %{undefined fedora} -# When bootstrapping python3, we need to build python3-packaging. -# but packaging BR python3-devel and that brings in python3-rpm-generators; -# python3-rpm-generators needs python3-packaging, so we cannot have it yet. -# -# We also use the previous build of Python in "make regen-all". -# -# Procedure: https://fedoraproject.org/wiki/SIGs/Python/UpgradingPython -# -# IMPORTANT: When bootstrapping, it's very likely python-pip-wheel is -# not available. Turn off the rpmwheels bcond until -# python-pip is built with a wheel to get around the issue. -%bcond bootstrap 0 +# Extra build for debugging the interpreter or C-API extensions +# (the -debug subpackages) +%bcond debug_build 1 + +# Extra build without GIL, the freethreading PEP 703 provisional way +# (the -freethreading subpackage) +%bcond freethreading_build 1 + +# PEP 744: JIT Compilation +# Whether to build with the experimental JIT compiler +# We can only have this on Fedora 40+, where clang 18+ is available +# And only on certain architectures: https://peps.python.org/pep-0744/#support +# The freethreading build (when enabled) does not support JIT yet +%bcond jit %[(0%{?fedora} >= 40 || 0%{?rhel} >= 10) && ("%{_arch}" == "x86_64" || "%{_arch}" == "aarch64")] +%if %{with jit} +# When built with JIT, it still needs to be enabled on runtime via PYTHON_JIT=1 +%global jit_flag --enable-experimental-jit=yes-off +%endif + +# Main interpreter loop optimization +%bcond computed_gotos 1 + +# ===================== +# General global macros +# ===================== + +%if %{with main_python} +%global pkgname python3 +%global exename python3 +%global python3_pkgversion 3 +%else +%global pkgname python%{pybasever} +%global exename python%{pybasever} +%global python3_pkgversion %{pybasever} +%endif -# Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages -# Uses upstream bundled prebuilt wheels otherwise -%bcond rpmwheels 1 # If the rpmwheels condition is disabled, we use the bundled wheel packages # from Python with the versions below. # This needs to be manually updated when we update Python. @@ -106,47 +153,6 @@ Provides: bundled(python3dist(wheel)) = 0.45.1 Provides: bundled(python3dist(zipp)) = 3.19.2 } -# Expensive optimizations (mainly, profile-guided optimizations) -%bcond optimizations 1 - -# Run the test suite in %%check -%bcond tests 1 - -# Extra build for debugging the interpreter or C-API extensions -# (the -debug subpackages) -%bcond debug_build 1 - -# Extra build without GIL, the freethreading PEP 703 provisional way -# (the -freethreading subpackage) -%bcond freethreading_build 1 - -# PEP 744: JIT Compilation -# Whether to build with the experimental JIT compiler -# We can only have this on Fedora 40+, where clang 18+ is available -# And only on certain architectures: https://peps.python.org/pep-0744/#support -# The freethreading build (when enabled) does not support JIT yet -%bcond jit %[(0%{?fedora} >= 40 || 0%{?rhel} >= 10) && ("%{_arch}" == "x86_64" || "%{_arch}" == "aarch64")] -%if %{with jit} -# When built with JIT, it still needs to be enabled on runtime via PYTHON_JIT=1 -%global jit_flag --enable-experimental-jit=yes-off -%endif - -# Main interpreter loop optimization -%bcond computed_gotos 1 - -# ===================== -# General global macros -# ===================== -%if %{with main_python} -%global pkgname python3 -%global exename python3 -%global python3_pkgversion 3 -%else -%global pkgname python%{pybasever} -%global exename python%{pybasever} -%global python3_pkgversion %{pybasever} -%endif - # ABIFLAGS, LDVERSION and SOABI are in the upstream configure.ac # See PEP 3149 for some background: http://www.python.org/dev/peps/pep-3149/ %global ABIFLAGS_optimized %{nil} From f31a75016fe7968e5d51d016a9bd6640d9fc023e Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 25 Jun 2025 12:27:09 +0200 Subject: [PATCH 086/115] Switch the basic conditionals based on the bootstrap's value We always switch rpmswheels, optimizations and tests when bootstrapping new Python version, so they can be tied to the bootstrap conditional. With that, switching the bootstrap in Koji side tag will be possible, letting us to avoid separate "bootstrap" and "rebuild" commits. --- python3.13.spec | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index aefa7b6..dd4b3f5 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -10,20 +10,25 @@ # # Procedure: https://fedoraproject.org/wiki/SIGs/Python/UpgradingPython # -# IMPORTANT: When bootstrapping, it's very likely python-pip-wheel is -# not available. Turn off the rpmwheels bcond until -# python-pip is built with a wheel to get around the issue. +# Bootstrap enabled: +# - disables regen-all with the same Python version +# - disables dependency on python3-rpm-generators if we build with main_python +# - disables rpmwheels, optimizations and tests by default %bcond bootstrap 0 # Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages # Uses upstream bundled prebuilt wheels otherwise -%bcond rpmwheels 1 +%bcond rpmwheels %{without bootstrap} # Expensive optimizations (mainly, profile-guided optimizations) -%bcond optimizations 1 +# We don't have to switch it off for bootstrap, but it speeds up the first build, +# so we opt to only run them during the "full" build +%bcond optimizations %{without bootstrap} # Run the test suite in %%check -%bcond tests 1 +# Technically, we can run the tests even during the bootstrap build, but since +# we build Python 2x, it's better to just run it once with the "full" build +%bcond tests %{without bootstrap} # ================== # Top-level metadata From 1331394c24222bd740305ae777852bbcfb60a5ce Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 25 Jun 2025 13:53:06 +0200 Subject: [PATCH 087/115] Lower the minimal required autoconf version for EPEL 9 build --- python3.13.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index dd4b3f5..546cae4 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -806,6 +806,8 @@ rm -r Modules/_decimal/libmpdec # (This is after patching, so that we can use patches directly from upstream) rm configure pyconfig.h.in +# Lower the minimal required version of autoconf to enable build for EPEL 9 +sed -i "s/AC_PREREQ(\[2\.71\])/AC_PREREQ([2.69])/" configure.ac # ====================================================== # Configuring and building the code: From aef12e770ac2072480655685eb708b37b29249e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 20 May 2025 11:54:21 +0000 Subject: [PATCH 088/115] Disable JIT on RHEL For now on, until we figure out a way of building the JIT with pre-built stencils, we disable the JIT on RHEL to avoid a dependency on a specific LLVM+clang version. https://discuss.python.org/t/building-the-jit-with-pre-built-stencils/91838 https://src.fedoraproject.org/rpms/python3.14/pull-request/40 https://github.com/fedora-eln/eln/issues/207 ---------- This was cherry-picked from https://src.fedoraproject.org/rpms/python3.14/c/ef2d703504cf0039fe5dc82e21e20053cc827c10 for https://github.com/fedora-eln/eln/issues/258#issuecomment-3085727051 With one difference: We build this package on EPEL and we have clang18 there. --- python3.13.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 546cae4..ea80e26 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -81,7 +81,7 @@ License: Python-2.0.1 # We can only have this on Fedora 40+, where clang 18+ is available # And only on certain architectures: https://peps.python.org/pep-0744/#support # The freethreading build (when enabled) does not support JIT yet -%bcond jit %[(0%{?fedora} >= 40 || 0%{?rhel} >= 10) && ("%{_arch}" == "x86_64" || "%{_arch}" == "aarch64")] +%bcond jit %[(0%{?fedora} >= 40 || 0%{?epel} >= 10) && ("%{_arch}" == "x86_64" || "%{_arch}" == "aarch64")] %if %{with jit} # When built with JIT, it still needs to be enabled on runtime via PYTHON_JIT=1 %global jit_flag --enable-experimental-jit=yes-off From fc659cc8a29c43235a241352e39d5b636a9fa1b8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 11:19:24 +0000 Subject: [PATCH 089/115] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index ea80e26..dce8653 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -49,7 +49,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -1740,6 +1740,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 3.13.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Wed Jun 25 2025 Karolina Surma - 3.13.5-2 - Conditionally skip tests not working with the older expat version From 7042c32c98c23476f333432a6ea23303f90d3adb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 28 Jul 2025 22:30:40 +0200 Subject: [PATCH 090/115] Fix CVE-2025-8194: Tarfile infinite loop during parsing with negative member offset --- 00467-CVE-2025-8194.patch | 214 ++++++++++++++++++++++++++++++++++++++ python3.13.spec | 9 +- 2 files changed, 222 insertions(+), 1 deletion(-) create mode 100644 00467-CVE-2025-8194.patch diff --git a/00467-CVE-2025-8194.patch b/00467-CVE-2025-8194.patch new file mode 100644 index 0000000..6d5ef78 --- /dev/null +++ b/00467-CVE-2025-8194.patch @@ -0,0 +1,214 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alexander Urieles +Date: Mon, 28 Jul 2025 17:37:26 +0200 +Subject: 00467: gh-130577: tarfile now validates archives to ensure member + offsets are non-negative + +(cherry picked from commit 7040aa54f14676938970e10c5f74ea93cd56aa38) + +Co-authored-by: Alexander Urieles +Co-authored-by: Gregory P. Smith +--- + Lib/tarfile.py | 3 + + Lib/test/test_tarfile.py | 156 ++++++++++++++++++ + ...-07-23-00-35-29.gh-issue-130577.c7EITy.rst | 3 + + 3 files changed, 162 insertions(+) + create mode 100644 Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst + +diff --git a/Lib/tarfile.py b/Lib/tarfile.py +index 0980f6a817..9ff9df696d 100755 +--- a/Lib/tarfile.py ++++ b/Lib/tarfile.py +@@ -1636,6 +1636,9 @@ def _block(self, count): + """Round up a byte count by BLOCKSIZE and return it, + e.g. _block(834) => 1024. + """ ++ # Only non-negative offsets are allowed ++ if count < 0: ++ raise InvalidHeaderError("invalid offset") + blocks, remainder = divmod(count, BLOCKSIZE) + if remainder: + blocks += 1 +diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py +index ac31be0f05..7024be46de 100644 +--- a/Lib/test/test_tarfile.py ++++ b/Lib/test/test_tarfile.py +@@ -50,6 +50,7 @@ def sha256sum(data): + xzname = os.path.join(TEMPDIR, "testtar.tar.xz") + tmpname = os.path.join(TEMPDIR, "tmp.tar") + dotlessname = os.path.join(TEMPDIR, "testtar") ++SPACE = b" " + + sha256_regtype = ( + "e09e4bc8b3c9d9177e77256353b36c159f5f040531bbd4b024a8f9b9196c71ce" +@@ -4578,6 +4579,161 @@ def extractall(self, ar): + ar.extractall(self.testdir, filter='fully_trusted') + + ++class OffsetValidationTests(unittest.TestCase): ++ tarname = tmpname ++ invalid_posix_header = ( ++ # name: 100 bytes ++ tarfile.NUL * tarfile.LENGTH_NAME ++ # mode, space, null terminator: 8 bytes ++ + b"000755" + SPACE + tarfile.NUL ++ # uid, space, null terminator: 8 bytes ++ + b"000001" + SPACE + tarfile.NUL ++ # gid, space, null terminator: 8 bytes ++ + b"000001" + SPACE + tarfile.NUL ++ # size, space: 12 bytes ++ + b"\xff" * 11 + SPACE ++ # mtime, space: 12 bytes ++ + tarfile.NUL * 11 + SPACE ++ # chksum: 8 bytes ++ + b"0011407" + tarfile.NUL ++ # type: 1 byte ++ + tarfile.REGTYPE ++ # linkname: 100 bytes ++ + tarfile.NUL * tarfile.LENGTH_LINK ++ # magic: 6 bytes, version: 2 bytes ++ + tarfile.POSIX_MAGIC ++ # uname: 32 bytes ++ + tarfile.NUL * 32 ++ # gname: 32 bytes ++ + tarfile.NUL * 32 ++ # devmajor, space, null terminator: 8 bytes ++ + tarfile.NUL * 6 + SPACE + tarfile.NUL ++ # devminor, space, null terminator: 8 bytes ++ + tarfile.NUL * 6 + SPACE + tarfile.NUL ++ # prefix: 155 bytes ++ + tarfile.NUL * tarfile.LENGTH_PREFIX ++ # padding: 12 bytes ++ + tarfile.NUL * 12 ++ ) ++ invalid_gnu_header = ( ++ # name: 100 bytes ++ tarfile.NUL * tarfile.LENGTH_NAME ++ # mode, null terminator: 8 bytes ++ + b"0000755" + tarfile.NUL ++ # uid, null terminator: 8 bytes ++ + b"0000001" + tarfile.NUL ++ # gid, space, null terminator: 8 bytes ++ + b"0000001" + tarfile.NUL ++ # size, space: 12 bytes ++ + b"\xff" * 11 + SPACE ++ # mtime, space: 12 bytes ++ + tarfile.NUL * 11 + SPACE ++ # chksum: 8 bytes ++ + b"0011327" + tarfile.NUL ++ # type: 1 byte ++ + tarfile.REGTYPE ++ # linkname: 100 bytes ++ + tarfile.NUL * tarfile.LENGTH_LINK ++ # magic: 8 bytes ++ + tarfile.GNU_MAGIC ++ # uname: 32 bytes ++ + tarfile.NUL * 32 ++ # gname: 32 bytes ++ + tarfile.NUL * 32 ++ # devmajor, null terminator: 8 bytes ++ + tarfile.NUL * 8 ++ # devminor, null terminator: 8 bytes ++ + tarfile.NUL * 8 ++ # padding: 167 bytes ++ + tarfile.NUL * 167 ++ ) ++ invalid_v7_header = ( ++ # name: 100 bytes ++ tarfile.NUL * tarfile.LENGTH_NAME ++ # mode, space, null terminator: 8 bytes ++ + b"000755" + SPACE + tarfile.NUL ++ # uid, space, null terminator: 8 bytes ++ + b"000001" + SPACE + tarfile.NUL ++ # gid, space, null terminator: 8 bytes ++ + b"000001" + SPACE + tarfile.NUL ++ # size, space: 12 bytes ++ + b"\xff" * 11 + SPACE ++ # mtime, space: 12 bytes ++ + tarfile.NUL * 11 + SPACE ++ # chksum: 8 bytes ++ + b"0010070" + tarfile.NUL ++ # type: 1 byte ++ + tarfile.REGTYPE ++ # linkname: 100 bytes ++ + tarfile.NUL * tarfile.LENGTH_LINK ++ # padding: 255 bytes ++ + tarfile.NUL * 255 ++ ) ++ valid_gnu_header = tarfile.TarInfo("filename").tobuf(tarfile.GNU_FORMAT) ++ data_block = b"\xff" * tarfile.BLOCKSIZE ++ ++ def _write_buffer(self, buffer): ++ with open(self.tarname, "wb") as f: ++ f.write(buffer) ++ ++ def _get_members(self, ignore_zeros=None): ++ with open(self.tarname, "rb") as f: ++ with tarfile.open( ++ mode="r", fileobj=f, ignore_zeros=ignore_zeros ++ ) as tar: ++ return tar.getmembers() ++ ++ def _assert_raises_read_error_exception(self): ++ with self.assertRaisesRegex( ++ tarfile.ReadError, "file could not be opened successfully" ++ ): ++ self._get_members() ++ ++ def test_invalid_offset_header_validations(self): ++ for tar_format, invalid_header in ( ++ ("posix", self.invalid_posix_header), ++ ("gnu", self.invalid_gnu_header), ++ ("v7", self.invalid_v7_header), ++ ): ++ with self.subTest(format=tar_format): ++ self._write_buffer(invalid_header) ++ self._assert_raises_read_error_exception() ++ ++ def test_early_stop_at_invalid_offset_header(self): ++ buffer = self.valid_gnu_header + self.invalid_gnu_header + self.valid_gnu_header ++ self._write_buffer(buffer) ++ members = self._get_members() ++ self.assertEqual(len(members), 1) ++ self.assertEqual(members[0].name, "filename") ++ self.assertEqual(members[0].offset, 0) ++ ++ def test_ignore_invalid_archive(self): ++ # 3 invalid headers with their respective data ++ buffer = (self.invalid_gnu_header + self.data_block) * 3 ++ self._write_buffer(buffer) ++ members = self._get_members(ignore_zeros=True) ++ self.assertEqual(len(members), 0) ++ ++ def test_ignore_invalid_offset_headers(self): ++ for first_block, second_block, expected_offset in ( ++ ( ++ (self.valid_gnu_header), ++ (self.invalid_gnu_header + self.data_block), ++ 0, ++ ), ++ ( ++ (self.invalid_gnu_header + self.data_block), ++ (self.valid_gnu_header), ++ 1024, ++ ), ++ ): ++ self._write_buffer(first_block + second_block) ++ members = self._get_members(ignore_zeros=True) ++ self.assertEqual(len(members), 1) ++ self.assertEqual(members[0].name, "filename") ++ self.assertEqual(members[0].offset, expected_offset) ++ ++ + def setUpModule(): + os_helper.unlink(TEMPDIR) + os.makedirs(TEMPDIR) +diff --git a/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst +new file mode 100644 +index 0000000000..342cabbc86 +--- /dev/null ++++ b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst +@@ -0,0 +1,3 @@ ++:mod:`tarfile` now validates archives to ensure member offsets are ++non-negative. (Contributed by Alexander Enrique Urieles Nieto in ++:gh:`130577`.) diff --git a/python3.13.spec b/python3.13.spec index dce8653..dc18f57 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -49,7 +49,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 4%{?dist} License: Python-2.0.1 @@ -399,6 +399,10 @@ Patch464: 00464-enable-pac-and-bti-protections-for-aarch64.patch # which is tested as working. Patch466: 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +# 00467 # e4a33ed8bbb729606c58ba1e80bac5cfedf29147 +# gh-130577: tarfile now validates archives to ensure member offsets are non-negative +Patch467: 00467-CVE-2025-8194.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1740,6 +1744,9 @@ CheckPython freethreading # ====================================================== %changelog +* Mon Jul 28 2025 Miro Hrončok - 3.13.5-4 +- Fix CVE-2025-8194: Tarfile infinite loop during parsing with negative member offset + * Fri Jul 25 2025 Fedora Release Engineering - 3.13.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 2c3a2e93e22712fb82835a9c4269f2637dc60388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zachar?= Date: Mon, 28 Jul 2025 09:59:54 +0200 Subject: [PATCH 091/115] Drop STI and use tmt instead Resolves: rhbz#2383059 --- {tests/.fmf => .fmf}/version | 0 plan.fmf | 73 ++++++++++++++++++++++++++++++++++++ tests/provision.fmf | 4 -- tests/tests.yml | 67 --------------------------------- 4 files changed, 73 insertions(+), 71 deletions(-) rename {tests/.fmf => .fmf}/version (100%) create mode 100644 plan.fmf delete mode 100644 tests/provision.fmf delete mode 100644 tests/tests.yml diff --git a/tests/.fmf/version b/.fmf/version similarity index 100% rename from tests/.fmf/version rename to .fmf/version diff --git a/plan.fmf b/plan.fmf new file mode 100644 index 0000000..432f1a3 --- /dev/null +++ b/plan.fmf @@ -0,0 +1,73 @@ +execute: + how: tmt + +provision: + hardware: + memory: '>= 3 GB' + +environment: + pybasever: '3.13' + +discover: + - name: tests_python + how: shell + url: https://src.fedoraproject.org/tests/python.git + tests: + - name: smoke + path: /smoke + test: "VERSION=${pybasever} CYTHON=false ./venv.sh" + - name: smoke_virtualenv + path: /smoke + test: "VERSION=${pybasever} METHOD=virtualenv CYTHON=false ./venv.sh" + - name: debugsmoke + path: /smoke + test: "PYTHON=python${pybasever}d TOX=false VERSION=${pybasever} CYTHON=false ./venv.sh" + - name: selftest + path: /selftest + test: "VERSION=${pybasever} X='-i test_check_probes' ./parallel.sh" + - name: debugtest + path: /selftest + test: "VERSION=${pybasever} PYTHON=python${pybasever}d X='-i test_check_probes' ./parallel.sh" + - name: optimizedflags + path: /flags + test: "python${pybasever} ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" + - name: debugflags + path: /flags + test: "python${pybasever}d ./assertflags.py -O0 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" + - name: freethreadingflags + path: /flags + test: "python${pybasever}t ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" + - name: freethreadingdebugflags + path: /flags + test: "python${pybasever}td ./assertflags.py -O0 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" + - name: marshalparser + path: /marshalparser + test: "VERSION=${pybasever} SAMPLE=10 ./test_marshalparser_compatibility.sh" + +prepare: + - name: Install dependencies + how: install + package: + - gcc # for extension building in venv and selftest + - gcc-c++ # for test_cppext + - gdb # for test_gdb + - "python${pybasever}" # the test subject + - "python${pybasever}-debug" # for leak testing + - "python${pybasever}-devel" # for extension building in venv and selftest + - "python${pybasever}-tkinter" # for selftest + - "python${pybasever}-test" # for selftest + - "python${pybasever}-freethreading" # for -O... flag test + - "python${pybasever}-freethreading-debug" # for -O... flag test + - tox # for venv tests + - virtualenv # for virtualenv tests + - glibc-all-langpacks # for locale tests + - marshalparser # for testing compatibility (magic numbers) with marshalparser + - rpm # for debugging + - dnf # for upgrade + - name: Update packages + how: shell + script: dnf upgrade -y + - name: rpm_qa + order: 100 + how: shell + script: rpm -qa | sort | tee $TMT_PLAN_DATA/rpmqa.txt diff --git a/tests/provision.fmf b/tests/provision.fmf deleted file mode 100644 index 1a4f0f0..0000000 --- a/tests/provision.fmf +++ /dev/null @@ -1,4 +0,0 @@ ---- -standard-inventory-qcow2: - qemu: - m: 3G # Amount of VM memory diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 8a4ba6b..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -- hosts: localhost - tags: - - classic - tasks: - - dnf: - name: "*" - state: latest - -- hosts: localhost - roles: - - role: standard-test-basic - tags: - - classic - repositories: - - repo: "https://src.fedoraproject.org/tests/python.git" - dest: "python" - pybasever: "3.13" - tests: - - rpm_qa: - run: rpm -qa - - smoke: - dir: python/smoke - run: "VERSION={{ pybasever }} CYTHON=false ./venv.sh" - - smoke_virtualenv: - dir: python/smoke - run: "VERSION={{ pybasever }} METHOD=virtualenv CYTHON=false ./venv.sh" - - debugsmoke: - dir: python/smoke - run: "PYTHON=python{{ pybasever }}d TOX=false VERSION={{ pybasever }} CYTHON=false ./venv.sh" - - selftest: - dir: python/selftest - run: "VERSION={{ pybasever }} X='-i test_check_probes' ./parallel.sh" - - debugtest: - dir: python/selftest - run: "VERSION={{ pybasever }} PYTHON=python{{ pybasever }}d X='-i test_check_probes' ./parallel.sh" - - optimizedflags: - dir: python/flags - run: "python{{ pybasever }} ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - - debugflags: - dir: python/flags - run: "python{{ pybasever }}d ./assertflags.py -O0 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - - freethreadingflags: - dir: python/flags - run: "python{{ pybasever }}t ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - - freethreadingdebugflags: - dir: python/flags - run: "python{{ pybasever }}td ./assertflags.py -O0 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" - - marshalparser: - dir: python/marshalparser - run: "VERSION={{ pybasever }} SAMPLE=10 test_marshalparser_compatibility.sh" - required_packages: - - gcc # for extension building in venv and selftest - - gcc-c++ # for test_cppext - - gdb # for test_gdb - - "python{{ pybasever }}" # the test subject - - "python{{ pybasever }}-debug" # for leak testing - - "python{{ pybasever }}-devel" # for extension building in venv and selftest - - "python{{ pybasever }}-tkinter" # for selftest - - "python{{ pybasever }}-test" # for selftest - - "python{{ pybasever }}-freethreading" # for -O... flag test - - "python{{ pybasever }}-freethreading-debug" # for -O... flag test - - tox # for venv tests - - virtualenv # for virtualenv tests - - glibc-all-langpacks # for locale tests - - marshalparser # for testing compatibility (magic numbers) with marshalparser - - rpm # for debugging From 0f632505c6f1b49cc6a9de408c30d4d0392a0083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Thu, 7 Aug 2025 09:44:15 +0200 Subject: [PATCH 092/115] Update to 3.13.6 --- ...eel-in-test-venvs-when-setuptools-71.patch | 4 +- ...-pac-and-bti-protections-for-aarch64.patch | 4 +- ...not-working-with-older-expat-version.patch | 6 +- 00467-CVE-2025-8194.patch | 214 ------------------ python3.13.spec | 32 ++- sources | 4 +- 6 files changed, 24 insertions(+), 240 deletions(-) delete mode 100644 00467-CVE-2025-8194.patch diff --git a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch index 6b071ad..e7ca5a2 100644 --- a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch +++ b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch @@ -9,10 +9,10 @@ Subject: 00461: Downstream only: Install wheel in test venvs when setuptools < 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py -index c2b407159a..5c2efc4a51 100644 +index c60fc03064..731828879f 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py -@@ -2428,9 +2428,16 @@ def run_command(cmd): +@@ -2434,9 +2434,16 @@ def run_command(cmd): else: python = os.path.join(venv, 'bin', python_exe) diff --git a/00464-enable-pac-and-bti-protections-for-aarch64.patch b/00464-enable-pac-and-bti-protections-for-aarch64.patch index 9404072..1a7acf3 100644 --- a/00464-enable-pac-and-bti-protections-for-aarch64.patch +++ b/00464-enable-pac-and-bti-protections-for-aarch64.patch @@ -22,7 +22,7 @@ hardware protections can be enabled without losing Perf unwinding. create mode 100644 Python/asm_trampoline_aarch64.h diff --git a/Python/asm_trampoline.S b/Python/asm_trampoline.S -index 616752459b..ec205a08ef 100644 +index a14e68c0e8..2513cde4e7 100644 --- a/Python/asm_trampoline.S +++ b/Python/asm_trampoline.S @@ -1,3 +1,5 @@ @@ -31,7 +31,7 @@ index 616752459b..ec205a08ef 100644 .text .globl _Py_trampoline_func_start # The following assembly is equivalent to: -@@ -20,10 +22,12 @@ _Py_trampoline_func_start: +@@ -21,10 +23,12 @@ _Py_trampoline_func_start: #if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__) // ARM64 little endian, 64bit ABI // generate with aarch64-linux-gnu-gcc 12.1 diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch index 1653ee5..af1bf77 100644 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -41,10 +41,10 @@ index 9b3014a94a..90401e0d8f 100644 result = BytesIO() xmlgen = XMLGenerator(result) diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index bd75c00e50..9a1e020d24 100644 +index 12efa006cd..adcea4b204 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py -@@ -1521,9 +1521,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): +@@ -1548,9 +1548,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): self.assert_event_tags(parser, [('end', 'root')]) self.assertIsNone(parser.close()) @@ -58,7 +58,7 @@ index bd75c00e50..9a1e020d24 100644 def test_simple_xml_chunk_5(self): self.test_simple_xml(chunk_size=5, flush=True) -@@ -1748,6 +1752,8 @@ def test_flush_reparse_deferral_enabled(self): +@@ -1775,6 +1779,8 @@ def test_flush_reparse_deferral_enabled(self): self.assert_event_tags(parser, [('end', 'doc')]) diff --git a/00467-CVE-2025-8194.patch b/00467-CVE-2025-8194.patch deleted file mode 100644 index 6d5ef78..0000000 --- a/00467-CVE-2025-8194.patch +++ /dev/null @@ -1,214 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Alexander Urieles -Date: Mon, 28 Jul 2025 17:37:26 +0200 -Subject: 00467: gh-130577: tarfile now validates archives to ensure member - offsets are non-negative - -(cherry picked from commit 7040aa54f14676938970e10c5f74ea93cd56aa38) - -Co-authored-by: Alexander Urieles -Co-authored-by: Gregory P. Smith ---- - Lib/tarfile.py | 3 + - Lib/test/test_tarfile.py | 156 ++++++++++++++++++ - ...-07-23-00-35-29.gh-issue-130577.c7EITy.rst | 3 + - 3 files changed, 162 insertions(+) - create mode 100644 Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst - -diff --git a/Lib/tarfile.py b/Lib/tarfile.py -index 0980f6a817..9ff9df696d 100755 ---- a/Lib/tarfile.py -+++ b/Lib/tarfile.py -@@ -1636,6 +1636,9 @@ def _block(self, count): - """Round up a byte count by BLOCKSIZE and return it, - e.g. _block(834) => 1024. - """ -+ # Only non-negative offsets are allowed -+ if count < 0: -+ raise InvalidHeaderError("invalid offset") - blocks, remainder = divmod(count, BLOCKSIZE) - if remainder: - blocks += 1 -diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py -index ac31be0f05..7024be46de 100644 ---- a/Lib/test/test_tarfile.py -+++ b/Lib/test/test_tarfile.py -@@ -50,6 +50,7 @@ def sha256sum(data): - xzname = os.path.join(TEMPDIR, "testtar.tar.xz") - tmpname = os.path.join(TEMPDIR, "tmp.tar") - dotlessname = os.path.join(TEMPDIR, "testtar") -+SPACE = b" " - - sha256_regtype = ( - "e09e4bc8b3c9d9177e77256353b36c159f5f040531bbd4b024a8f9b9196c71ce" -@@ -4578,6 +4579,161 @@ def extractall(self, ar): - ar.extractall(self.testdir, filter='fully_trusted') - - -+class OffsetValidationTests(unittest.TestCase): -+ tarname = tmpname -+ invalid_posix_header = ( -+ # name: 100 bytes -+ tarfile.NUL * tarfile.LENGTH_NAME -+ # mode, space, null terminator: 8 bytes -+ + b"000755" + SPACE + tarfile.NUL -+ # uid, space, null terminator: 8 bytes -+ + b"000001" + SPACE + tarfile.NUL -+ # gid, space, null terminator: 8 bytes -+ + b"000001" + SPACE + tarfile.NUL -+ # size, space: 12 bytes -+ + b"\xff" * 11 + SPACE -+ # mtime, space: 12 bytes -+ + tarfile.NUL * 11 + SPACE -+ # chksum: 8 bytes -+ + b"0011407" + tarfile.NUL -+ # type: 1 byte -+ + tarfile.REGTYPE -+ # linkname: 100 bytes -+ + tarfile.NUL * tarfile.LENGTH_LINK -+ # magic: 6 bytes, version: 2 bytes -+ + tarfile.POSIX_MAGIC -+ # uname: 32 bytes -+ + tarfile.NUL * 32 -+ # gname: 32 bytes -+ + tarfile.NUL * 32 -+ # devmajor, space, null terminator: 8 bytes -+ + tarfile.NUL * 6 + SPACE + tarfile.NUL -+ # devminor, space, null terminator: 8 bytes -+ + tarfile.NUL * 6 + SPACE + tarfile.NUL -+ # prefix: 155 bytes -+ + tarfile.NUL * tarfile.LENGTH_PREFIX -+ # padding: 12 bytes -+ + tarfile.NUL * 12 -+ ) -+ invalid_gnu_header = ( -+ # name: 100 bytes -+ tarfile.NUL * tarfile.LENGTH_NAME -+ # mode, null terminator: 8 bytes -+ + b"0000755" + tarfile.NUL -+ # uid, null terminator: 8 bytes -+ + b"0000001" + tarfile.NUL -+ # gid, space, null terminator: 8 bytes -+ + b"0000001" + tarfile.NUL -+ # size, space: 12 bytes -+ + b"\xff" * 11 + SPACE -+ # mtime, space: 12 bytes -+ + tarfile.NUL * 11 + SPACE -+ # chksum: 8 bytes -+ + b"0011327" + tarfile.NUL -+ # type: 1 byte -+ + tarfile.REGTYPE -+ # linkname: 100 bytes -+ + tarfile.NUL * tarfile.LENGTH_LINK -+ # magic: 8 bytes -+ + tarfile.GNU_MAGIC -+ # uname: 32 bytes -+ + tarfile.NUL * 32 -+ # gname: 32 bytes -+ + tarfile.NUL * 32 -+ # devmajor, null terminator: 8 bytes -+ + tarfile.NUL * 8 -+ # devminor, null terminator: 8 bytes -+ + tarfile.NUL * 8 -+ # padding: 167 bytes -+ + tarfile.NUL * 167 -+ ) -+ invalid_v7_header = ( -+ # name: 100 bytes -+ tarfile.NUL * tarfile.LENGTH_NAME -+ # mode, space, null terminator: 8 bytes -+ + b"000755" + SPACE + tarfile.NUL -+ # uid, space, null terminator: 8 bytes -+ + b"000001" + SPACE + tarfile.NUL -+ # gid, space, null terminator: 8 bytes -+ + b"000001" + SPACE + tarfile.NUL -+ # size, space: 12 bytes -+ + b"\xff" * 11 + SPACE -+ # mtime, space: 12 bytes -+ + tarfile.NUL * 11 + SPACE -+ # chksum: 8 bytes -+ + b"0010070" + tarfile.NUL -+ # type: 1 byte -+ + tarfile.REGTYPE -+ # linkname: 100 bytes -+ + tarfile.NUL * tarfile.LENGTH_LINK -+ # padding: 255 bytes -+ + tarfile.NUL * 255 -+ ) -+ valid_gnu_header = tarfile.TarInfo("filename").tobuf(tarfile.GNU_FORMAT) -+ data_block = b"\xff" * tarfile.BLOCKSIZE -+ -+ def _write_buffer(self, buffer): -+ with open(self.tarname, "wb") as f: -+ f.write(buffer) -+ -+ def _get_members(self, ignore_zeros=None): -+ with open(self.tarname, "rb") as f: -+ with tarfile.open( -+ mode="r", fileobj=f, ignore_zeros=ignore_zeros -+ ) as tar: -+ return tar.getmembers() -+ -+ def _assert_raises_read_error_exception(self): -+ with self.assertRaisesRegex( -+ tarfile.ReadError, "file could not be opened successfully" -+ ): -+ self._get_members() -+ -+ def test_invalid_offset_header_validations(self): -+ for tar_format, invalid_header in ( -+ ("posix", self.invalid_posix_header), -+ ("gnu", self.invalid_gnu_header), -+ ("v7", self.invalid_v7_header), -+ ): -+ with self.subTest(format=tar_format): -+ self._write_buffer(invalid_header) -+ self._assert_raises_read_error_exception() -+ -+ def test_early_stop_at_invalid_offset_header(self): -+ buffer = self.valid_gnu_header + self.invalid_gnu_header + self.valid_gnu_header -+ self._write_buffer(buffer) -+ members = self._get_members() -+ self.assertEqual(len(members), 1) -+ self.assertEqual(members[0].name, "filename") -+ self.assertEqual(members[0].offset, 0) -+ -+ def test_ignore_invalid_archive(self): -+ # 3 invalid headers with their respective data -+ buffer = (self.invalid_gnu_header + self.data_block) * 3 -+ self._write_buffer(buffer) -+ members = self._get_members(ignore_zeros=True) -+ self.assertEqual(len(members), 0) -+ -+ def test_ignore_invalid_offset_headers(self): -+ for first_block, second_block, expected_offset in ( -+ ( -+ (self.valid_gnu_header), -+ (self.invalid_gnu_header + self.data_block), -+ 0, -+ ), -+ ( -+ (self.invalid_gnu_header + self.data_block), -+ (self.valid_gnu_header), -+ 1024, -+ ), -+ ): -+ self._write_buffer(first_block + second_block) -+ members = self._get_members(ignore_zeros=True) -+ self.assertEqual(len(members), 1) -+ self.assertEqual(members[0].name, "filename") -+ self.assertEqual(members[0].offset, expected_offset) -+ -+ - def setUpModule(): - os_helper.unlink(TEMPDIR) - os.makedirs(TEMPDIR) -diff --git a/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst -new file mode 100644 -index 0000000000..342cabbc86 ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2025-07-23-00-35-29.gh-issue-130577.c7EITy.rst -@@ -0,0 +1,3 @@ -+:mod:`tarfile` now validates archives to ensure member offsets are -+non-negative. (Contributed by Alexander Enrique Urieles Nieto in -+:gh:`130577`.) diff --git a/python3.13.spec b/python3.13.spec index dc18f57..3d67881 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,11 +45,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.5 +%global general_version %{pybasever}.6 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 4%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -109,31 +109,30 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 25.1.1 +%global pip_version 25.2 %global setuptools_version 79.0.1 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: -Provides: bundled(python3dist(cachecontrol)) = 0.14.2 -Provides: bundled(python3dist(certifi)) = 2025.1.31 +Provides: bundled(python3dist(cachecontrol)) = 0.14.3 +Provides: bundled(python3dist(certifi)) = 2025.7.14 Provides: bundled(python3dist(dependency-groups)) = 1.3.1 -Provides: bundled(python3dist(distlib)) = 0.3.9 +Provides: bundled(python3dist(distlib)) = 0.4 Provides: bundled(python3dist(distro)) = 1.9 Provides: bundled(python3dist(idna)) = 3.10 -Provides: bundled(python3dist(msgpack)) = 1.1 +Provides: bundled(python3dist(msgpack)) = 1.1.1 Provides: bundled(python3dist(packaging)) = 25 -Provides: bundled(python3dist(platformdirs)) = 4.3.7 -Provides: bundled(python3dist(pygments)) = 2.19.1 +Provides: bundled(python3dist(platformdirs)) = 4.3.8 +Provides: bundled(python3dist(pygments)) = 2.19.2 Provides: bundled(python3dist(pyproject-hooks)) = 1.2 -Provides: bundled(python3dist(requests)) = 2.32.3 -Provides: bundled(python3dist(resolvelib)) = 1.1 -Provides: bundled(python3dist(rich)) = 14 +Provides: bundled(python3dist(requests)) = 2.32.4 +Provides: bundled(python3dist(resolvelib)) = 1.2 +Provides: bundled(python3dist(rich)) = 14.1 Provides: bundled(python3dist(setuptools)) = 70.3 Provides: bundled(python3dist(tomli)) = 2.2.1 Provides: bundled(python3dist(tomli-w)) = 1.2 Provides: bundled(python3dist(truststore)) = 0.10.1 -Provides: bundled(python3dist(typing-extensions)) = 4.13.2 Provides: bundled(python3dist(urllib3)) = 1.26.20 } # setuptools @@ -399,10 +398,6 @@ Patch464: 00464-enable-pac-and-bti-protections-for-aarch64.patch # which is tested as working. Patch466: 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch -# 00467 # e4a33ed8bbb729606c58ba1e80bac5cfedf29147 -# gh-130577: tarfile now validates archives to ensure member offsets are non-negative -Patch467: 00467-CVE-2025-8194.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1744,6 +1739,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Aug 07 2025 Tomáš Hrnčiar - 3.13.5-5 +- Update to 3.13.6 + * Mon Jul 28 2025 Miro Hrončok - 3.13.5-4 - Fix CVE-2025-8194: Tarfile infinite loop during parsing with negative member offset diff --git a/sources b/sources index 0bc8e56..ad0e635 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.5.tar.xz) = 2a058072e87b614b204bd1321b2bfa9c4b6614dbd5ded98dc0ee51c0d6b81504f902b7c003ad14295b371a37918f6975dc37d5a9c836dd9c30f8b086e4759193 -SHA512 (Python-3.13.5.tar.xz.asc) = 07c1a2ec2d6ba2805680b7f1dc262fdc5dc3eec4503780ecdc08cd570ccbb5f1efa736ee03c83d36bdb33ce87db06be5892cf5a6eaf4018d5fe78fff99e615ae +SHA512 (Python-3.13.6.tar.xz) = fca724dbb4f3fed889d0b51c86ee0559c70ee2c7aba1d8b089b08538d82411ec9e6bc9c7a39c1dc4bb4f13b5cf0d9a332f7759412fa540a1940477cb47052316 +SHA512 (Python-3.13.6.tar.xz.asc) = 133b2c017f9f8cf93209f11bb398908528dabf9b66ece034cb8a26fc9550b84a3589f85deb1acfe322b01db20da083c039ce91db1452bdda9fb885a948d53c50 From 666e5f924e88f8b789a4806e1b943135e7eb25d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 14 Aug 2025 23:01:00 +0200 Subject: [PATCH 093/115] Update to 3.13.7 --- python3.13.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 3d67881..578adc4 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,7 +45,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.6 +%global general_version %{pybasever}.7 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -1739,6 +1739,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Aug 14 2025 Miro Hrončok - 3.13.7-1 +- Update to 3.13.7 + * Thu Aug 07 2025 Tomáš Hrnčiar - 3.13.5-5 - Update to 3.13.6 diff --git a/sources b/sources index ad0e635..c08163a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.6.tar.xz) = fca724dbb4f3fed889d0b51c86ee0559c70ee2c7aba1d8b089b08538d82411ec9e6bc9c7a39c1dc4bb4f13b5cf0d9a332f7759412fa540a1940477cb47052316 -SHA512 (Python-3.13.6.tar.xz.asc) = 133b2c017f9f8cf93209f11bb398908528dabf9b66ece034cb8a26fc9550b84a3589f85deb1acfe322b01db20da083c039ce91db1452bdda9fb885a948d53c50 +SHA512 (Python-3.13.7.tar.xz) = 73fa04db860e8b98c204f84d403598fcb802b19bfc8f2675df2fddb6b153b1643daf081746a043f57c8fa71b950a439581aa5204c2bfadb8cfd8864ca4f42f0d +SHA512 (Python-3.13.7.tar.xz.asc) = 71cd002c18ebb47861abd3309c8cf38972d3d916cca5595d895ba3940719243c66fa28595c2370a8846d9d1c4b3cb4ac5baeda9e9cf94be30302892d01df5e87 From 66c0a64ef8eb09a16c023375e069bd36cb30ee43 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Tue, 26 Aug 2025 10:01:22 +0200 Subject: [PATCH 094/115] rpminspect: Wrap strings with globs with single quotes It seems to be required since rpminspect 2.0: https://github.com/rpminspect/rpminspect/commit/1593c38ce46980e0279150706d1f7c7bdd82de28 --- rpminspect.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rpminspect.yaml b/rpminspect.yaml index 83dfb5e..8cc18cb 100644 --- a/rpminspect.yaml +++ b/rpminspect.yaml @@ -1,22 +1,22 @@ # exclude test XML data (not always valid) from XML validity check: xml: ignore: - - /usr/lib*/python*/test/xmltestdata/* - - /usr/lib*/python*/test/xmltestdata/*/* + - '/usr/lib*/python*/test/xmltestdata/*' + - '/usr/lib*/python*/test/xmltestdata/*/*' # exclude _socket from ipv4 only functions check, it has both ipv4 and ipv6 only badfuncs: allowed: - /usr/lib*/python*/lib-dynload/_socket.*: + '/usr/lib*/python*/lib-dynload/_socket.*': - inet_aton - inet_ntoa # exclude the debug build from annocheck entirely annocheck: ignore: - - /usr/bin/python*d - - /usr/lib*/libpython*d.so.1.0 - - /usr/lib*/python*/lib-dynload/*.cpython-*d-*-*-*.so + - '/usr/bin/python*d' + - '/usr/lib*/libpython*d.so.1.0' + - '/usr/lib*/python*/lib-dynload/*.cpython-*d-*-*-*.so' # don't report changed content of compiled files # that is expected with every toolchain update and not reproducible yet From 3643baab9a24912545754b507eb80a73384e72a9 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Wed, 24 Sep 2025 16:42:29 +0200 Subject: [PATCH 095/115] Include licenses of incorporated software (rhbz#2133426) Python includes a lot of differently licensed functions and modules. We gather the list from https://docs.python.org/3.13/license.html. Detect changes to Doc/license.rst with file hash automatically in %prep. --- python3.13.spec | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 578adc4..212f53b 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -518,9 +518,38 @@ This package contains /usr/bin/python - the "python" command that runs Python 3. %package -n %{pkgname}-libs Summary: Python runtime libraries -# Bundled libb2 is CC0, covered by grandfathering exception -# Bundled mimalloc is MIT -%global libs_license Python-2.0.1 AND CC0-1.0 AND MIT +# Python is generally licensed as Python-2.0.1 but also includes incorporated software +# Combined manually from https://docs.python.org/3.13/license.html +# Hash of Doc/license.rst which is compared in %%prep, generated with: +# $ sha256sum Doc/license.rst | cut -f1 -d" " +%global license_file_hash 62f2c9c2c75d511170eb464ad5f83b78cc1f37eb2eb49c2846c9aa6c4557ee99 +# Licenses of incorporated software: +# Mersenne Twister in _random C extension contains code under BSD-3-Clause +# socket.getaddrinfo() and socket.getnameinfo() are BSD-3-Clause +# test.support.asynchat and test.support.asyncore are MIT-CMU +# http.cookies is MIT-CMU +# trace is under temporary SPDX ref: https://gitlab.com/fedora/legal/fedora-license-data/-/issues/657 +# trace: LicenseRef-Fedora-Temporary-Python-trace +# uu is MIT-CMU +# xmlrpc.client is MIT-CMU +# test.test_epoll is MIT +# select kqueue interface is BSD-2-Clause +# SipHash algorithm in Python/pyhash.c is MIT +# strtod and dtoa are dtoa +# OpenSSL is not bundled +# expat is not bundled +# libffi is not bundled +# zlib is not bundled +# cfuhash used by tracemalloc is BSD-3-Clause +# libmpdec is not bundled +# C14N test suite in Lib/test/xmltestdata/c14n-20/ is BSD-3-Clause +# mimalloc is MIT +# parts of asyncio from uvloop are MIT +# Python/qsbr.c is adapted from code under BSD-2-Clause +# Bundled libb2 is not declared in the upstream document, but it's: +# CC0-1.0, covered by grandfathering exception +# We don't query upstream for changes, as 3.13 is the last Python version containing it. +%global libs_license Python-2.0.1 AND CC0-1.0 AND MIT AND BSD-3-Clause AND MIT-CMU AND LicenseRef-Fedora-Temporary-Python-trace AND BSD-2-Clause AND dtoa %if %{with rpmwheels} Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 License: %{libs_license} @@ -528,7 +557,7 @@ License: %{libs_license} Provides: bundled(python3dist(pip)) = %{pip_version} %pip_bundled_provides # License combined from Python libs + pip -License: %{libs_license} AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) +License: %{libs_license} AND Apache-2.0 AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) %endif %unversioned_obsoletes_of_python3_X_if_main libs @@ -723,7 +752,7 @@ Provides: bundled(python3dist(pip)) = %{pip_version} Provides: bundled(python3dist(setuptools)) = %{setuptools_version} %setuptools_bundled_provides # License combined from Python libs + pip + setuptools -License: %{libs_license} AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) +License: %{libs_license} AND Apache-2.0 AND ISC AND LGPL-2.1-only AND MPL-2.0 AND (Apache-2.0 OR BSD-2-Clause) %endif # This package doesn't depend on python3-libs, so we need to explicitly @@ -792,6 +821,14 @@ rm Lib/ensurepip/_bundled/pip-%{pip_version}-py3-none-any.whl rm Lib/test/wheeldata/setuptools-%{setuptools_version}-py3-none-any.whl %endif +# check if there were any changes to Doc/license.rst +# if so, a review of %%libs_license and %%license_file_hash is needed +found_hash=$(sha256sum Doc/license.rst | cut -f1 -d" ") +if [ "$found_hash" != %{license_file_hash} ]; then + echo "File hash mismatch: review Doc/license.rst for changes" + exit 1 +fi + # Remove all exe files to ensure we are not shipping prebuilt binaries # note that those are only used to create Microsoft Windows installers # and that functionality is broken on Linux anyway From a362f2a9e12e6ed3ce0aa106c1ae48a63316aa42 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 7 Oct 2025 17:28:26 +0200 Subject: [PATCH 096/115] Update to Python 3.13.8 --- 00251-change-user-install-location.patch | 8 ++++---- ...y-install-wheel-in-test-venvs-when-setuptools-71.patch | 4 ++-- ...-skip-tests-not-working-with-older-expat-version.patch | 8 ++++---- python3.13.spec | 5 ++++- sources | 4 ++-- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index a4a78b6..7fc8844 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -51,7 +51,7 @@ index aedf36399c..2ae49a8029 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index 510c7b9568..6e4e07e43b 100644 +index f7bd675bb3..f1ff347c3d 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -130,7 +130,7 @@ index 510c7b9568..6e4e07e43b 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index aca02c06bc..a4d0db0da8 100644 +index 9723300f51..310706652a 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -130,8 +130,19 @@ def test_get_path(self): @@ -154,7 +154,7 @@ index aca02c06bc..a4d0db0da8 100644 os.path.normpath(expected), ) -@@ -386,7 +397,7 @@ def test_get_config_h_filename(self): +@@ -393,7 +404,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -163,7 +163,7 @@ index aca02c06bc..a4d0db0da8 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -398,6 +409,8 @@ def test_symlink(self): # Issue 7880 +@@ -405,6 +416,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch index e7ca5a2..ee4cc9a 100644 --- a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch +++ b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch @@ -9,10 +9,10 @@ Subject: 00461: Downstream only: Install wheel in test venvs when setuptools < 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py -index c60fc03064..731828879f 100644 +index 4605938b87..a0055d6887 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py -@@ -2434,9 +2434,16 @@ def run_command(cmd): +@@ -2462,9 +2462,16 @@ def run_command(cmd): else: python = os.path.join(venv, 'bin', python_exe) diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch index af1bf77..a5c383a 100644 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -15,10 +15,10 @@ which is tested as working. 3 files changed, 10 insertions(+) diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py -index 1d56ccd71c..5ef5517828 100644 +index a091430463..55ebf34c52 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py -@@ -790,6 +790,8 @@ def start_element(name, _): +@@ -826,6 +826,8 @@ def start_element(name, _): self.assertEqual(started, ['doc']) @@ -41,7 +41,7 @@ index 9b3014a94a..90401e0d8f 100644 result = BytesIO() xmlgen = XMLGenerator(result) diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index 12efa006cd..adcea4b204 100644 +index 78598b35da..802d1399ea 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -1548,9 +1548,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): @@ -58,7 +58,7 @@ index 12efa006cd..adcea4b204 100644 def test_simple_xml_chunk_5(self): self.test_simple_xml(chunk_size=5, flush=True) -@@ -1775,6 +1779,8 @@ def test_flush_reparse_deferral_enabled(self): +@@ -1777,6 +1781,8 @@ def test_flush_reparse_deferral_enabled(self): self.assert_event_tags(parser, [('end', 'doc')]) diff --git a/python3.13.spec b/python3.13.spec index 212f53b..c24a443 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,7 +45,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.7 +%global general_version %{pybasever}.8 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -1776,6 +1776,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Oct 07 2025 Karolina Surma - 3.13.8-1 +- Update to Python 3.13.8 + * Thu Aug 14 2025 Miro Hrončok - 3.13.7-1 - Update to 3.13.7 diff --git a/sources b/sources index c08163a..858b07b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.7.tar.xz) = 73fa04db860e8b98c204f84d403598fcb802b19bfc8f2675df2fddb6b153b1643daf081746a043f57c8fa71b950a439581aa5204c2bfadb8cfd8864ca4f42f0d -SHA512 (Python-3.13.7.tar.xz.asc) = 71cd002c18ebb47861abd3309c8cf38972d3d916cca5595d895ba3940719243c66fa28595c2370a8846d9d1c4b3cb4ac5baeda9e9cf94be30302892d01df5e87 +SHA512 (Python-3.13.8.tar.xz) = 8569959f24083824f6644b839c6ebd587e67fb74b3c5fed9ef44bfbbba46076e98db33a27218b2d44edd15b3b05ae85e94b71491598cbb871d7d43a9d6fa2b84 +SHA512 (Python-3.13.8.tar.xz.asc) = ea5bae3f5a909d16526b614085cd4543153800348dd82ef90945ceed19acbab8db76f7c1279e39d26b9e69608aa0f7cf1eab9a562d00fd1c9badd5b0fafc5c21 From edb5d531040ec48f1c5e0773e513a08539da5896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 14 Oct 2025 23:40:57 +0200 Subject: [PATCH 097/115] Update to Python 3.13.9 --- python3.13.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index c24a443..d13fd25 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,7 +45,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.8 +%global general_version %{pybasever}.9 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -1776,6 +1776,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Oct 14 2025 Miro Hrončok - 3.13.9-1 +- Update to Python 3.13.9 + * Tue Oct 07 2025 Karolina Surma - 3.13.8-1 - Update to Python 3.13.8 diff --git a/sources b/sources index 858b07b..2959089 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.8.tar.xz) = 8569959f24083824f6644b839c6ebd587e67fb74b3c5fed9ef44bfbbba46076e98db33a27218b2d44edd15b3b05ae85e94b71491598cbb871d7d43a9d6fa2b84 -SHA512 (Python-3.13.8.tar.xz.asc) = ea5bae3f5a909d16526b614085cd4543153800348dd82ef90945ceed19acbab8db76f7c1279e39d26b9e69608aa0f7cf1eab9a562d00fd1c9badd5b0fafc5c21 +SHA512 (Python-3.13.9.tar.xz) = ffc9b6e545bf5cf8f3b945f85442eb4bd28cca9adb92d8c253f44078ec2e9758f802bf72c48e0d7e503c02b2dc754c58ee913cd3b7d8e8808fac2a0aa4e006a8 +SHA512 (Python-3.13.9.tar.xz.asc) = c33fba3a6b22dccc08beb7f13bd61a25a30f609a54da7c8dfd3b3b4a3490a7b24c11f9617a835388f22709fb09375d35febc417cf104a18f5bec3b43ec999e82 From 1f3785e7030deed72021a39b95b4e9b5208b7ebd Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Mon, 13 Oct 2025 10:16:25 +0200 Subject: [PATCH 098/115] trace is officially licensed as HPND-SMC https://gitlab.com/fedora/legal/fedora-license-data/-/issues/657#note_2815942473 --- python3.13.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index d13fd25..8965bf9 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -528,8 +528,7 @@ Summary: Python runtime libraries # socket.getaddrinfo() and socket.getnameinfo() are BSD-3-Clause # test.support.asynchat and test.support.asyncore are MIT-CMU # http.cookies is MIT-CMU -# trace is under temporary SPDX ref: https://gitlab.com/fedora/legal/fedora-license-data/-/issues/657 -# trace: LicenseRef-Fedora-Temporary-Python-trace +# trace is HPND-SMC # uu is MIT-CMU # xmlrpc.client is MIT-CMU # test.test_epoll is MIT @@ -549,7 +548,7 @@ Summary: Python runtime libraries # Bundled libb2 is not declared in the upstream document, but it's: # CC0-1.0, covered by grandfathering exception # We don't query upstream for changes, as 3.13 is the last Python version containing it. -%global libs_license Python-2.0.1 AND CC0-1.0 AND MIT AND BSD-3-Clause AND MIT-CMU AND LicenseRef-Fedora-Temporary-Python-trace AND BSD-2-Clause AND dtoa +%global libs_license Python-2.0.1 AND CC0-1.0 AND MIT AND BSD-3-Clause AND MIT-CMU AND HPND-SMC AND BSD-2-Clause AND dtoa %if %{with rpmwheels} Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 License: %{libs_license} From f17c52832ba6d12d2e7f5b641fcdcedcdc264802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 5 Sep 2025 13:26:16 +0000 Subject: [PATCH 099/115] Inject SBOM into the installed wheels (when using the bundled ones) --- python3.13.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python3.13.spec b/python3.13.spec index 8965bf9..c93edf0 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -1263,6 +1263,11 @@ for file in %{buildroot}%{pylibdir}/pydoc_data/topics.py $(grep --include='*.py' rm ${directory}/{__pycache__/${module}.cpython-%{pyshortver}.opt-?.pyc,${module}.py} done +%if %{without rpmwheels} +# Inject SBOM into the installed wheels (if the macro is available) +%{?python_wheel_inject_sbom:%python_wheel_inject_sbom %{buildroot}%{pylibdir}/ensurepip/_bundled/*.whl} +%endif + # ====================================================== # Checks for packaging issues # ====================================================== From efb1f534c5421c16f633bfa550ce8301f55aef9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 3 Dec 2025 09:43:54 +0100 Subject: [PATCH 100/115] Update to 3.13.10 --- 00251-change-user-install-location.patch | 2 +- ...eel-in-test-venvs-when-setuptools-71.patch | 32 ------------------- ...not-working-with-older-expat-version.patch | 10 +++--- python3.13.spec | 27 ++++++++-------- sources | 4 +-- 5 files changed, 21 insertions(+), 54 deletions(-) delete mode 100644 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 7fc8844..89bc027 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -30,7 +30,7 @@ Co-authored-by: Lumír Balhar 3 files changed, 72 insertions(+), 4 deletions(-) diff --git a/Lib/site.py b/Lib/site.py -index aedf36399c..2ae49a8029 100644 +index 041dca113a..ca6320df2f 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -415,8 +415,15 @@ def getsitepackages(prefixes=None): diff --git a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch b/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch deleted file mode 100644 index ee4cc9a..0000000 --- a/00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Fri, 25 Apr 2025 09:33:37 +0200 -Subject: 00461: Downstream only: Install wheel in test venvs when setuptools < - 71 - ---- - Lib/test/support/__init__.py | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py -index 4605938b87..a0055d6887 100644 ---- a/Lib/test/support/__init__.py -+++ b/Lib/test/support/__init__.py -@@ -2462,9 +2462,16 @@ def run_command(cmd): - else: - python = os.path.join(venv, 'bin', python_exe) - -+ setuptools_whl = _findwheel('setuptools') -+ whl_filename = os.path.basename(setuptools_whl) -+ setuptools_major = int(whl_filename.split('-')[1].split('.')[0]) -+ if setuptools_major >= 71: # we need 70.1+, but that's OK -+ wheels = (setuptools_whl,) -+ else: -+ wheels = (setuptools_whl, _findwheel('wheel')) - cmd = (python, '-X', 'dev', - '-m', 'pip', 'install', -- _findwheel('setuptools'), -+ *wheels, - ) - run_command(cmd) - diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch index a5c383a..493d7e2 100644 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -15,10 +15,10 @@ which is tested as working. 3 files changed, 10 insertions(+) diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py -index a091430463..55ebf34c52 100644 +index cd98407c34..042a3bb9df 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py -@@ -826,6 +826,8 @@ def start_element(name, _): +@@ -846,6 +846,8 @@ def start_element(name, _): self.assertEqual(started, ['doc']) @@ -41,10 +41,10 @@ index 9b3014a94a..90401e0d8f 100644 result = BytesIO() xmlgen = XMLGenerator(result) diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index 78598b35da..802d1399ea 100644 +index fba36d5b57..ccda19fa07 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py -@@ -1548,9 +1548,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): +@@ -1574,9 +1574,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): self.assert_event_tags(parser, [('end', 'root')]) self.assertIsNone(parser.close()) @@ -58,7 +58,7 @@ index 78598b35da..802d1399ea 100644 def test_simple_xml_chunk_5(self): self.test_simple_xml(chunk_size=5, flush=True) -@@ -1777,6 +1781,8 @@ def test_flush_reparse_deferral_enabled(self): +@@ -1803,6 +1807,8 @@ def test_flush_reparse_deferral_enabled(self): self.assert_event_tags(parser, [('end', 'doc')]) diff --git a/python3.13.spec b/python3.13.spec index c93edf0..662ff00 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,7 +45,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.9 +%global general_version %{pybasever}.10 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -109,30 +109,30 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 25.2 +%global pip_version 25.3 %global setuptools_version 79.0.1 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: Provides: bundled(python3dist(cachecontrol)) = 0.14.3 -Provides: bundled(python3dist(certifi)) = 2025.7.14 +Provides: bundled(python3dist(certifi)) = 2025.10.5 Provides: bundled(python3dist(dependency-groups)) = 1.3.1 Provides: bundled(python3dist(distlib)) = 0.4 Provides: bundled(python3dist(distro)) = 1.9 Provides: bundled(python3dist(idna)) = 3.10 -Provides: bundled(python3dist(msgpack)) = 1.1.1 +Provides: bundled(python3dist(msgpack)) = 1.1.2 Provides: bundled(python3dist(packaging)) = 25 -Provides: bundled(python3dist(platformdirs)) = 4.3.8 +Provides: bundled(python3dist(platformdirs)) = 4.5 Provides: bundled(python3dist(pygments)) = 2.19.2 Provides: bundled(python3dist(pyproject-hooks)) = 1.2 -Provides: bundled(python3dist(requests)) = 2.32.4 -Provides: bundled(python3dist(resolvelib)) = 1.2 -Provides: bundled(python3dist(rich)) = 14.1 +Provides: bundled(python3dist(requests)) = 2.32.5 +Provides: bundled(python3dist(resolvelib)) = 1.2.1 +Provides: bundled(python3dist(rich)) = 14.2 Provides: bundled(python3dist(setuptools)) = 70.3 -Provides: bundled(python3dist(tomli)) = 2.2.1 +Provides: bundled(python3dist(tomli)) = 2.3 Provides: bundled(python3dist(tomli-w)) = 1.2 -Provides: bundled(python3dist(truststore)) = 0.10.1 +Provides: bundled(python3dist(truststore)) = 0.10.4 Provides: bundled(python3dist(urllib3)) = 1.26.20 } # setuptools @@ -368,10 +368,6 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00461 # 920175020b21c0aff5edcc4c28d688b5061f591c -# Downstream only: Install wheel in test venvs when setuptools < 71 -Patch461: 00461-downstream-only-install-wheel-in-test-venvs-when-setuptools-71.patch - # 00464 # 292acffec7a379cb6d1f3c47b9e5a2f170bbadb6 # Enable PAC and BTI protections for aarch64 # @@ -1780,6 +1776,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Dec 03 2025 Tomáš Hrnčiar - 3.13.10-1 +- Update to 3.13.10 + * Tue Oct 14 2025 Miro Hrončok - 3.13.9-1 - Update to Python 3.13.9 diff --git a/sources b/sources index 2959089..5e79178 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.9.tar.xz) = ffc9b6e545bf5cf8f3b945f85442eb4bd28cca9adb92d8c253f44078ec2e9758f802bf72c48e0d7e503c02b2dc754c58ee913cd3b7d8e8808fac2a0aa4e006a8 -SHA512 (Python-3.13.9.tar.xz.asc) = c33fba3a6b22dccc08beb7f13bd61a25a30f609a54da7c8dfd3b3b4a3490a7b24c11f9617a835388f22709fb09375d35febc417cf104a18f5bec3b43ec999e82 +SHA512 (Python-3.13.10.tar.xz) = 7edf3c1008b1df3a067bf03b8218fbd9f5da7226ba17d8ec54e54a30aca5051e6435eb447a999a9665097dbe65fde27356103c3ea5227b5605b233482e037b07 +SHA512 (Python-3.13.10.tar.xz.asc) = b7ef2e4fe9d206e1d20c166224401f6b9bd782323d424e996e0a1cd38a0b7407b994bcc13a63bfa3558482c6775470769c4f11f873b515b8072b75c4cf835011 From 98ab1346cf2914ceb5c18778f985c0f324c0f66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 5 Dec 2025 22:38:46 +0100 Subject: [PATCH 101/115] Update to 3.13.11 --- python3.13.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python3.13.spec b/python3.13.spec index 662ff00..e03320d 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,7 +45,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.10 +%global general_version %{pybasever}.11 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -1776,6 +1776,9 @@ CheckPython freethreading # ====================================================== %changelog +* Fri Dec 05 2025 Miro Hrončok - 3.13.11-1 +- Update to 3.13.11 + * Wed Dec 03 2025 Tomáš Hrnčiar - 3.13.10-1 - Update to 3.13.10 diff --git a/sources b/sources index 5e79178..9cba034 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.10.tar.xz) = 7edf3c1008b1df3a067bf03b8218fbd9f5da7226ba17d8ec54e54a30aca5051e6435eb447a999a9665097dbe65fde27356103c3ea5227b5605b233482e037b07 -SHA512 (Python-3.13.10.tar.xz.asc) = b7ef2e4fe9d206e1d20c166224401f6b9bd782323d424e996e0a1cd38a0b7407b994bcc13a63bfa3558482c6775470769c4f11f873b515b8072b75c4cf835011 +SHA512 (Python-3.13.11.tar.xz) = 11a910785bb3edeb3888331f29d2514d539f08b07d3125186364ab0e261dab29c7e7c70fe08d89718c38b6053cbe932ac4a6062ac291871e6f4173d29425264a +SHA512 (Python-3.13.11.tar.xz.asc) = 10beaba6d0e84f0335c0add480114e98a64133ec70d320593349de86091ccbdd69743559297f9c8c5e9926089890fd0e7881388e86084f46a413e9579c59d23c From 1b3b52c26453ea6ee7fb228db8b2de3e444b7159 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Tue, 6 Jan 2026 16:51:22 +0100 Subject: [PATCH 102/115] Require at least the same expat version as used during the build In the past we have had a versioned requirement on expat, e.g.: https://src.fedoraproject.org/rpms/python3.13/c/c686992b6c25a39d0e4117053ddb669fd5998723 The explanation is still valid: if Python is built with an expat version with new symbols, and used with an installed older expat, it won't work, preventing crating new venvs, and many more. This has happened again now with expat 2.7.2 introducing new symbols. Reintroduce the versioned requirement and make it future-proof - the generated version will always match at least the one present in the buildroot during the Python build. --- python3.13.spec | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index e03320d..2f3fdd8 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -49,7 +49,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -580,6 +580,22 @@ Recommends: (%{pkgname}-tkinter%{?_isa} = %{version}-%{release} if tk%{?_isa}) # The zoneinfo module needs tzdata Requires: tzdata +# The requirement on libexpat is generated, but we need to version it. +# When built with a specific expat version, but installed with an older one, +# we sometimes get: +# ImportError: /usr/lib64/python3.X/lib-dynload/pyexpat.cpython-....so: +# undefined symbol: XML_... +# The pyexpat module has build-time checks for expat version to only use the +# available symbols. However, there is no runtime protection, so when the module +# is later installed with an older expat, it may error due to undefined symbols. +# This breaks many things, including python -m venv. +# We avoid this problem by requiring at least the same version of expat that +# was used during the build time. +# Other subpackages (like -debug) also need this, but they all depend on -libs. +%global expat_version %(LANG=C rpm -q --qf '%%{version}' expat.%{_target_cpu} | sed 's/.*not installed/0/') +Requires: expat >= %{expat_version} + + %description -n %{pkgname}-libs This package contains runtime libraries for use by Python: - the majority of the Python standard library @@ -756,6 +772,7 @@ License: %{libs_license} AND Apache-2.0 AND ISC AND LGPL-2.1-only AND MPL-2.0 AN Provides: bundled(libb2) = 0.98.1 Provides: bundled(mimalloc) = 2.12 Requires: tzdata +Requires: expat >= %{expat_version} %description -n python%{pybasever}-freethreading The provisional Free Threading (PEP 703) build of Python. @@ -1776,6 +1793,9 @@ CheckPython freethreading # ====================================================== %changelog +* Tue Jan 06 2026 Karolina Surma - 3.13.11-2 +- Require at least the same expat version as used during the build time + * Fri Dec 05 2025 Miro Hrončok - 3.13.11-1 - Update to 3.13.11 From faeed1b6c779b22d6e66a2ff2637599a0ae51732 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Mon, 12 Jan 2026 11:55:39 +0100 Subject: [PATCH 103/115] Extend the expat requirement to differentiate between 32 and 64 arches (cherry picked from python3.15 commit a5ca170d3f1e6e19f5df66f21482c2b10593af42) --- python3.13.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 2f3fdd8..46ff0fa 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -593,7 +593,7 @@ Requires: tzdata # was used during the build time. # Other subpackages (like -debug) also need this, but they all depend on -libs. %global expat_version %(LANG=C rpm -q --qf '%%{version}' expat.%{_target_cpu} | sed 's/.*not installed/0/') -Requires: expat >= %{expat_version} +Requires: expat%{?_isa} >= %{expat_version} %description -n %{pkgname}-libs From 1045416eaccacfaf4fdbf54eb85c828c53450958 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 10:40:12 +0000 Subject: [PATCH 104/115] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 46ff0fa..d2625e6 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -49,7 +49,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 3%{?dist} License: Python-2.0.1 @@ -1793,6 +1793,9 @@ CheckPython freethreading # ====================================================== %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 3.13.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Tue Jan 06 2026 Karolina Surma - 3.13.11-2 - Require at least the same expat version as used during the build time From ad7f5eb68961f55108a6f19402bda4b761564660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Fri, 6 Feb 2026 12:28:07 +0100 Subject: [PATCH 105/115] Update to 3.13.12 --- ...not-working-with-older-expat-version.patch | 2 +- ...piled-for-a-different-python-version.patch | 173 ++++++++++++++++++ python3.13.spec | 22 ++- sources | 4 +- 4 files changed, 196 insertions(+), 5 deletions(-) create mode 100644 00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch index 493d7e2..215ef31 100644 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -41,7 +41,7 @@ index 9b3014a94a..90401e0d8f 100644 result = BytesIO() xmlgen = XMLGenerator(result) diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index fba36d5b57..ccda19fa07 100644 +index 597ec83061..bf2db1779c 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -1574,9 +1574,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): diff --git a/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch b/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch new file mode 100644 index 0000000..2f47bac --- /dev/null +++ b/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch @@ -0,0 +1,173 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Petr Viktorin +Date: Mon, 9 Feb 2026 10:44:21 +0100 +Subject: 00477: Raise an error when importing stdlib modules compiled for a + different Python version + +This is a downstream workaround "implementing" python#137212 - +the mechanism for the check exists in Python 3.15+, where it needs to be +added to the standard library modules. +In Fedora, we need it also in previous Python versions, as we experience +segmentation fault when importing stdlib modules after update while +Python is running. + +_curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init, +which is modified with this patch, hence they need a +direct call to the check function. + +Co-Authored-By: Karolina Surma +--- + Include/moduleobject.h | 43 +++++++++++++++++++++++++++++++++++++++++ + Makefile.pre.in | 3 +++ + Modules/_cursesmodule.c | 6 ++++++ + Modules/_tkinter.c | 6 ++++++ + Modules/_tracemalloc.c | 6 ++++++ + Modules/readline.c | 6 ++++++ + Objects/moduleobject.c | 1 + + 7 files changed, 71 insertions(+) + +diff --git a/Include/moduleobject.h b/Include/moduleobject.h +index 2a17c891dd..64017c666c 100644 +--- a/Include/moduleobject.h ++++ b/Include/moduleobject.h +@@ -116,6 +116,49 @@ struct PyModuleDef { + freefunc m_free; + }; + ++#if defined(_PyHack_check_version_on_modinit) && defined(Py_BUILD_CORE) ++/* The mechanism for the check has been implemented on Python 3.15+: ++ * https://github.com/python/cpython/pull/137212. ++ * In Fedora, we need this in older Pythons too: ++ * if somebody attempts to import a module compiled for a different Python version, ++ * instead of segmentation fault a meaningful error is raised. ++ */ ++PyAPI_DATA(const unsigned long) Py_Version; ++ ++static inline int ++_PyHack_CheckInternalAPIVersion(const char *mod_name) ++{ ++ if (PY_VERSION_HEX != Py_Version) { ++ PyErr_Format( ++ PyExc_ImportError, ++ "internal Python C API version mismatch: " ++ "module %s compiled with %lu.%lu.%lu; " ++ "runtime version is %lu.%lu.%lu", ++ mod_name, ++ (const unsigned long)((PY_VERSION_HEX >> 24) & 0xFF), ++ (const unsigned long)((PY_VERSION_HEX >> 16) & 0xFF), ++ (const unsigned long)((PY_VERSION_HEX >> 8) & 0xFF), ++ (const unsigned long)((Py_Version >> 24) & 0xFF), ++ (const unsigned long)((Py_Version >> 16) & 0xFF), ++ (const unsigned long)((Py_Version >> 8) & 0xFF) ++ ); ++ return -1; ++ } ++ return 0; ++} ++ ++static inline PyObject * ++PyModuleDef_Init_with_check(PyModuleDef *def) ++{ ++ if (_PyHack_CheckInternalAPIVersion(def->m_name) < 0) { ++ return NULL; ++ } ++ return PyModuleDef_Init(def); ++} ++ ++#define PyModuleDef_Init PyModuleDef_Init_with_check ++#endif ++ + #ifdef __cplusplus + } + #endif +diff --git a/Makefile.pre.in b/Makefile.pre.in +index ecf77bdc41..91bfd06a78 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -3153,3 +3153,6 @@ MODULE__MULTIBYTECODEC_DEPS=$(srcdir)/Modules/cjkcodecs/multibytecodec.h + # Local Variables: + # mode: makefile + # End: ++ ++# Fedora-specific, downstream only ++PY_STDMODULE_CFLAGS += -D_PyHack_check_version_on_modinit=1 +diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c +index 0200f59020..bb647555c0 100644 +--- a/Modules/_cursesmodule.c ++++ b/Modules/_cursesmodule.c +@@ -4763,6 +4763,12 @@ curses_destructor(PyObject *op) + PyMODINIT_FUNC + PyInit__curses(void) + { ++ #ifdef _PyHack_check_version_on_modinit ++ if (_PyHack_CheckInternalAPIVersion("_curses") < 0) { ++ return NULL; ++ } ++ #endif ++ + PyObject *m, *d, *v, *c_api_object; + + /* Initialize object type */ +diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c +index 14efe18db5..70597c2815 100644 +--- a/Modules/_tkinter.c ++++ b/Modules/_tkinter.c +@@ -3431,6 +3431,12 @@ static struct PyModuleDef _tkintermodule = { + PyMODINIT_FUNC + PyInit__tkinter(void) + { ++ #ifdef _PyHack_check_version_on_modinit ++ if (_PyHack_CheckInternalAPIVersion("_tkinter") < 0) { ++ return NULL; ++ } ++ #endif ++ + PyObject *m, *uexe, *cexe; + + tcl_lock = PyThread_allocate_lock(); +diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c +index 0b85187e5f..87f358ed07 100644 +--- a/Modules/_tracemalloc.c ++++ b/Modules/_tracemalloc.c +@@ -215,6 +215,12 @@ static struct PyModuleDef module_def = { + PyMODINIT_FUNC + PyInit__tracemalloc(void) + { ++ #ifdef _PyHack_check_version_on_modinit ++ if (_PyHack_CheckInternalAPIVersion("_tracemalloc") < 0) { ++ return NULL; ++ } ++ #endif ++ + PyObject *m; + m = PyModule_Create(&module_def); + if (m == NULL) +diff --git a/Modules/readline.c b/Modules/readline.c +index f9362c312d..66f1ec65a6 100644 +--- a/Modules/readline.c ++++ b/Modules/readline.c +@@ -1540,6 +1540,12 @@ static struct PyModuleDef readlinemodule = { + PyMODINIT_FUNC + PyInit_readline(void) + { ++ #ifdef _PyHack_check_version_on_modinit ++ if (_PyHack_CheckInternalAPIVersion("readline") < 0) { ++ return NULL; ++ } ++ #endif ++ + const char *backend = "readline"; + PyObject *m; + readlinestate *mod_state; +diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c +index d787f29004..31175ceb3f 100644 +--- a/Objects/moduleobject.c ++++ b/Objects/moduleobject.c +@@ -43,6 +43,7 @@ _PyModule_IsExtension(PyObject *obj) + } + + ++#undef PyModuleDef_Init + PyObject* + PyModuleDef_Init(PyModuleDef* def) + { diff --git a/python3.13.spec b/python3.13.spec index d2625e6..49d4f5c 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,11 +45,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.11 +%global general_version %{pybasever}.12 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 3%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -394,6 +394,21 @@ Patch464: 00464-enable-pac-and-bti-protections-for-aarch64.patch # which is tested as working. Patch466: 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +# 00477 # 9c62c492e7f2e3b152dbf287c08d307c3f013221 +# Raise an error when importing stdlib modules compiled for a different Python version +# +# This is a downstream workaround "implementing" python#137212 - +# the mechanism for the check exists in Python 3.15+, where it needs to be +# added to the standard library modules. +# In Fedora, we need it also in previous Python versions, as we experience +# segmentation fault when importing stdlib modules after update while +# Python is running. +# +# _curses, _tkinter, _tracemalloc and readline are not calling PyModuleDef_Init, +# which is modified with this patch, hence they need a +# direct call to the check function. +Patch477: 00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1793,6 +1808,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Feb 04 2026 Tomáš Hrnčiar - 3.13.12-1 +- Update to 3.13.12 + * Sat Jan 17 2026 Fedora Release Engineering - 3.13.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild diff --git a/sources b/sources index 9cba034..67ba30c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.11.tar.xz) = 11a910785bb3edeb3888331f29d2514d539f08b07d3125186364ab0e261dab29c7e7c70fe08d89718c38b6053cbe932ac4a6062ac291871e6f4173d29425264a -SHA512 (Python-3.13.11.tar.xz.asc) = 10beaba6d0e84f0335c0add480114e98a64133ec70d320593349de86091ccbdd69743559297f9c8c5e9926089890fd0e7881388e86084f46a413e9579c59d23c +SHA512 (Python-3.13.12.tar.xz) = 5edecdf13999d8629f31543dffdcba521dbb5633577e481ee49275e377509a2f6d700624c26f95b57a8ff9501378d10d7c07c1d0e7e19be0d6c88f05b6315a13 +SHA512 (Python-3.13.12.tar.xz.asc) = 6d42bc51b3658e1b092e7ab44306f6fc968646a7a9aeb63a3c443d1f75e27153a2138e88c15cebf8d559ce6d7744acecd4e6026c6d0be6fde070f804042d4aea From b909398e15b11e691b444782103e3290985b908f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Fri, 6 Feb 2026 12:30:14 +0100 Subject: [PATCH 106/115] Backport patches to fix CVEs CVE-2025-15366, CVE-2025-15367 --- 00474-cve-2025-15366.patch | 59 ++++++++++++++++++++++++++++++++++++++ 00475-cve-2025-15367.patch | 59 ++++++++++++++++++++++++++++++++++++++ python3.13.spec | 12 ++++++++ 3 files changed, 130 insertions(+) create mode 100644 00474-cve-2025-15366.patch create mode 100644 00475-cve-2025-15367.patch diff --git a/00474-cve-2025-15366.patch b/00474-cve-2025-15366.patch new file mode 100644 index 0000000..32aa4c3 --- /dev/null +++ b/00474-cve-2025-15366.patch @@ -0,0 +1,59 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Seth Michael Larson +Date: Tue, 20 Jan 2026 14:45:42 -0600 +Subject: 00474: CVE-2025-15366 + +Reject control characters in IMAP commands +--- + Lib/imaplib.py | 4 +++- + Lib/test/test_imaplib.py | 6 ++++++ + .../Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst | 1 + + 3 files changed, 10 insertions(+), 1 deletion(-) + create mode 100644 Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst + +diff --git a/Lib/imaplib.py b/Lib/imaplib.py +index 141e639894..f282e5c061 100644 +--- a/Lib/imaplib.py ++++ b/Lib/imaplib.py +@@ -132,7 +132,7 @@ + # We compile these in _mode_xxx. + _Literal = br'.*{(?P\d+)}$' + _Untagged_status = br'\* (?P\d+) (?P[A-Z-]+)( (?P.*))?' +- ++_control_chars = re.compile(b'[\x00-\x1F\x7F]') + + + class IMAP4: +@@ -1000,6 +1000,8 @@ def _command(self, name, *args): + if arg is None: continue + if isinstance(arg, str): + arg = bytes(arg, self._encoding) ++ if _control_chars.search(arg): ++ raise ValueError("Control characters not allowed in commands") + data = data + b' ' + arg + + literal = self.literal +diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py +index 9f1f682d02..820c2a5db5 100644 +--- a/Lib/test/test_imaplib.py ++++ b/Lib/test/test_imaplib.py +@@ -515,6 +515,12 @@ def test_login(self): + self.assertEqual(data[0], b'LOGIN completed') + self.assertEqual(client.state, 'AUTH') + ++ def test_control_characters(self): ++ client, _ = self._setup(SimpleIMAPHandler) ++ for c0 in support.control_characters_c0(): ++ with self.assertRaises(ValueError): ++ client.login(f'user{c0}', 'pass') ++ + def test_logout(self): + client, _ = self._setup(SimpleIMAPHandler) + typ, data = client.login('user', 'pass') +diff --git a/Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst b/Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst +new file mode 100644 +index 0000000000..4e13fe92bc +--- /dev/null ++++ b/Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst +@@ -0,0 +1 @@ ++Reject control characters in IMAP commands. diff --git a/00475-cve-2025-15367.patch b/00475-cve-2025-15367.patch new file mode 100644 index 0000000..2812c2d --- /dev/null +++ b/00475-cve-2025-15367.patch @@ -0,0 +1,59 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Seth Michael Larson +Date: Tue, 20 Jan 2026 14:46:32 -0600 +Subject: 00475: CVE-2025-15367 + +Reject control characters in POP3 commands +--- + Lib/poplib.py | 2 ++ + Lib/test/test_poplib.py | 8 ++++++++ + .../2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst | 1 + + 3 files changed, 11 insertions(+) + create mode 100644 Misc/NEWS.d/next/Security/2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst + +diff --git a/Lib/poplib.py b/Lib/poplib.py +index 4469bff44b..b97274c5c3 100644 +--- a/Lib/poplib.py ++++ b/Lib/poplib.py +@@ -122,6 +122,8 @@ def _putline(self, line): + def _putcmd(self, line): + if self._debugging: print('*cmd*', repr(line)) + line = bytes(line, self.encoding) ++ if re.search(b'[\x00-\x1F\x7F]', line): ++ raise ValueError('Control characters not allowed in commands') + self._putline(line) + + +diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py +index eb6dab4015..bd621caee4 100644 +--- a/Lib/test/test_poplib.py ++++ b/Lib/test/test_poplib.py +@@ -18,6 +18,7 @@ + from test.support import asynchat + from test.support import asyncore + from test.support.testcase import ExtraAssertions ++from test.support import control_characters_c0 + + + test_support.requires_working_socket(module=True) +@@ -396,6 +397,13 @@ def test_quit(self): + self.assertIsNone(self.client.sock) + self.assertIsNone(self.client.file) + ++ def test_control_characters(self): ++ for c0 in control_characters_c0(): ++ with self.assertRaises(ValueError): ++ self.client.user(f'user{c0}') ++ with self.assertRaises(ValueError): ++ self.client.pass_(f'{c0}pass') ++ + @requires_ssl + def test_stls_capa(self): + capa = self.client.capa() +diff --git a/Misc/NEWS.d/next/Security/2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst b/Misc/NEWS.d/next/Security/2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst +new file mode 100644 +index 0000000000..3cde4df3e0 +--- /dev/null ++++ b/Misc/NEWS.d/next/Security/2026-01-16-11-43-47.gh-issue-143923.DuytMe.rst +@@ -0,0 +1 @@ ++Reject control characters in POP3 commands. diff --git a/python3.13.spec b/python3.13.spec index 49d4f5c..df66054 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -394,6 +394,18 @@ Patch464: 00464-enable-pac-and-bti-protections-for-aarch64.patch # which is tested as working. Patch466: 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +# 00474 # 837ddca0372fa87ff9cee47142200caa21e77def +# CVE-2025-15366 +# +# Reject control characters in IMAP commands +Patch474: 00474-cve-2025-15366.patch + +# 00475 # d44fac01037662db286449a78c8fb819788f764c +# CVE-2025-15367 +# +# Reject control characters in POP3 commands +Patch475: 00475-cve-2025-15367.patch + # 00477 # 9c62c492e7f2e3b152dbf287c08d307c3f013221 # Raise an error when importing stdlib modules compiled for a different Python version # From 007c7d59dd2e360c4aa0883ebb141042da71251f Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Thu, 26 Mar 2026 09:24:47 +0100 Subject: [PATCH 107/115] Security fix for CVE-2026-4519 (rhbz#2449729) --- 00478-cve-2026-4519.patch | 114 ++++++++++++++++++++++++++++++++++++++ python3.13.spec | 11 +++- 2 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 00478-cve-2026-4519.patch diff --git a/00478-cve-2026-4519.patch b/00478-cve-2026-4519.patch new file mode 100644 index 0000000..aa4e921 --- /dev/null +++ b/00478-cve-2026-4519.patch @@ -0,0 +1,114 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Miss Islington (bot)" + <31488909+miss-islington@users.noreply.github.com> +Date: Tue, 24 Mar 2026 00:17:50 +0100 +Subject: 00478: CVE-2026-4519 + +Reject leading dashes in webbrowser URLs (GH-146215) + +(cherry picked from commit 82a24a4442312bdcfc4c799885e8b3e00990f02b) + +Co-authored-by: Seth Michael Larson +--- + Lib/test/test_webbrowser.py | 5 +++++ + Lib/webbrowser.py | 13 +++++++++++++ + .../2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst | 1 + + 3 files changed, 19 insertions(+) + create mode 100644 Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst + +diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py +index 4fcbc5c2e5..171388e64d 100644 +--- a/Lib/test/test_webbrowser.py ++++ b/Lib/test/test_webbrowser.py +@@ -65,6 +65,11 @@ def test_open(self): + options=[], + arguments=[URL]) + ++ def test_reject_dash_prefixes(self): ++ browser = self.browser_class(name=CMD_NAME) ++ with self.assertRaises(ValueError): ++ browser.open(f"--key=val {URL}") ++ + + class BackgroundBrowserCommandTest(CommandTestMixin, unittest.TestCase): + +diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py +index 2f9555ad60..e322cbf5d1 100755 +--- a/Lib/webbrowser.py ++++ b/Lib/webbrowser.py +@@ -164,6 +164,12 @@ def open_new(self, url): + def open_new_tab(self, url): + return self.open(url, 2) + ++ @staticmethod ++ def _check_url(url): ++ """Ensures that the URL is safe to pass to subprocesses as a parameter""" ++ if url and url.lstrip().startswith("-"): ++ raise ValueError(f"Invalid URL: {url}") ++ + + class GenericBrowser(BaseBrowser): + """Class for all browsers started with a command +@@ -181,6 +187,7 @@ def __init__(self, name): + + def open(self, url, new=0, autoraise=True): + sys.audit("webbrowser.open", url) ++ self._check_url(url) + cmdline = [self.name] + [arg.replace("%s", url) + for arg in self.args] + try: +@@ -201,6 +208,7 @@ def open(self, url, new=0, autoraise=True): + cmdline = [self.name] + [arg.replace("%s", url) + for arg in self.args] + sys.audit("webbrowser.open", url) ++ self._check_url(url) + try: + if sys.platform[:3] == 'win': + p = subprocess.Popen(cmdline) +@@ -267,6 +275,7 @@ def _invoke(self, args, remote, autoraise, url=None): + + def open(self, url, new=0, autoraise=True): + sys.audit("webbrowser.open", url) ++ self._check_url(url) + if new == 0: + action = self.remote_action + elif new == 1: +@@ -358,6 +367,7 @@ class Konqueror(BaseBrowser): + + def open(self, url, new=0, autoraise=True): + sys.audit("webbrowser.open", url) ++ self._check_url(url) + # XXX Currently I know no way to prevent KFM from opening a new win. + if new == 2: + action = "newTab" +@@ -576,6 +586,7 @@ def register_standard_browsers(): + class WindowsDefault(BaseBrowser): + def open(self, url, new=0, autoraise=True): + sys.audit("webbrowser.open", url) ++ self._check_url(url) + try: + os.startfile(url) + except OSError: +@@ -596,6 +607,7 @@ def __init__(self, name='default'): + + def open(self, url, new=0, autoraise=True): + sys.audit("webbrowser.open", url) ++ self._check_url(url) + url = url.replace('"', '%22') + if self.name == 'default': + script = f'open location "{url}"' # opens in default browser +@@ -627,6 +639,7 @@ def open(self, url, new=0, autoraise=True): + class IOSBrowser(BaseBrowser): + def open(self, url, new=0, autoraise=True): + sys.audit("webbrowser.open", url) ++ self._check_url(url) + # If ctypes isn't available, we can't open a browser + if objc is None: + return False +diff --git a/Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst b/Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst +new file mode 100644 +index 0000000000..0f27eae99a +--- /dev/null ++++ b/Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst +@@ -0,0 +1 @@ ++Reject leading dashes in URLs passed to :func:`webbrowser.open` diff --git a/python3.13.spec b/python3.13.spec index df66054..c16bc56 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -49,7 +49,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -421,6 +421,12 @@ Patch475: 00475-cve-2025-15367.patch # direct call to the check function. Patch477: 00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch +# 00478 # 6f5526308e189515c79efb05770d4b2b5aefc0d0 +# CVE-2026-4519 +# +# Reject leading dashes in webbrowser URLs (GH-146215) +Patch478: 00478-cve-2026-4519.patch + # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1820,6 +1826,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Mar 26 2026 Lumír Balhar - 3.13.12-2 +- Security fix for CVE-2026-4519 (rhbz#2449729) + * Wed Feb 04 2026 Tomáš Hrnčiar - 3.13.12-1 - Update to 3.13.12 From c444274dd9193f109a90b697558a386124bfa88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 11 Mar 2026 19:39:18 +0100 Subject: [PATCH 108/115] Only explicitly require expat >= installed version when expat < 2.7.4 See https://src.fedoraproject.org/rpms/expat/c/4da0543472 (cherry picked from python3.15 commit ce1bde3e67443b7cf5df33bf58cb2ec75cc2c8e2) --- python3.13.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index c16bc56..7df50c8 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -625,8 +625,12 @@ Requires: tzdata # We avoid this problem by requiring at least the same version of expat that # was used during the build time. # Other subpackages (like -debug) also need this, but they all depend on -libs. +# Since expat 2.7.4, the library has versioned symbols and this is no longer needed, +# as the generated requirement will be in the form of libexpat.so.1(LIBEXPAT_2.7.2) etc. %global expat_version %(LANG=C rpm -q --qf '%%{version}' expat.%{_target_cpu} | sed 's/.*not installed/0/') +%if v"%{expat_version}" < v"2.7.4" Requires: expat%{?_isa} >= %{expat_version} +%endif %description -n %{pkgname}-libs @@ -805,7 +809,9 @@ License: %{libs_license} AND Apache-2.0 AND ISC AND LGPL-2.1-only AND MPL-2.0 AN Provides: bundled(libb2) = 0.98.1 Provides: bundled(mimalloc) = 2.12 Requires: tzdata -Requires: expat >= %{expat_version} +%if v"%{expat_version}" < v"2.7.4" +Requires: expat%{?_isa} >= %{expat_version} +%endif %description -n python%{pybasever}-freethreading The provisional Free Threading (PEP 703) build of Python. From c731000e1eb1c378524d3d69641757947bac08d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 8 Apr 2026 12:07:43 +0200 Subject: [PATCH 109/115] Update to 3.13.13 --- 00251-change-user-install-location.patch | 8 +- ...not-working-with-older-expat-version.patch | 4 +- 00478-cve-2026-4519.patch | 114 ------------------ python3.13.spec | 25 ++-- sources | 4 +- 5 files changed, 19 insertions(+), 136 deletions(-) delete mode 100644 00478-cve-2026-4519.patch diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 89bc027..7289b79 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -51,7 +51,7 @@ index 041dca113a..ca6320df2f 100644 if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py -index f7bd675bb3..f1ff347c3d 100644 +index 43edebce34..40e85568ea 100644 --- a/Lib/sysconfig/__init__.py +++ b/Lib/sysconfig/__init__.py @@ -106,6 +106,12 @@ @@ -130,7 +130,7 @@ index f7bd675bb3..f1ff347c3d 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 9723300f51..310706652a 100644 +index ce17206a3c..fd95071099 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -130,8 +130,19 @@ def test_get_path(self): @@ -154,7 +154,7 @@ index 9723300f51..310706652a 100644 os.path.normpath(expected), ) -@@ -393,7 +404,7 @@ def test_get_config_h_filename(self): +@@ -395,7 +406,7 @@ def test_get_config_h_filename(self): self.assertTrue(os.path.isfile(config_h), config_h) def test_get_scheme_names(self): @@ -163,7 +163,7 @@ index 9723300f51..310706652a 100644 if HAS_USER_BASE: wanted.extend(['nt_user', 'osx_framework_user', 'posix_user']) self.assertEqual(get_scheme_names(), tuple(sorted(wanted))) -@@ -405,6 +416,8 @@ def test_symlink(self): # Issue 7880 +@@ -407,6 +418,8 @@ def test_symlink(self): # Issue 7880 cmd = "-c", "import sysconfig; print(sysconfig.get_platform())" self.assertEqual(py.call_real(*cmd), py.call_link(*cmd)) diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch index 215ef31..643501b 100644 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -15,10 +15,10 @@ which is tested as working. 3 files changed, 10 insertions(+) diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py -index cd98407c34..042a3bb9df 100644 +index 2309353503..fca62245d4 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py -@@ -846,6 +846,8 @@ def start_element(name, _): +@@ -901,6 +901,8 @@ def start_element(name, _): self.assertEqual(started, ['doc']) diff --git a/00478-cve-2026-4519.patch b/00478-cve-2026-4519.patch deleted file mode 100644 index aa4e921..0000000 --- a/00478-cve-2026-4519.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Tue, 24 Mar 2026 00:17:50 +0100 -Subject: 00478: CVE-2026-4519 - -Reject leading dashes in webbrowser URLs (GH-146215) - -(cherry picked from commit 82a24a4442312bdcfc4c799885e8b3e00990f02b) - -Co-authored-by: Seth Michael Larson ---- - Lib/test/test_webbrowser.py | 5 +++++ - Lib/webbrowser.py | 13 +++++++++++++ - .../2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst | 1 + - 3 files changed, 19 insertions(+) - create mode 100644 Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst - -diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py -index 4fcbc5c2e5..171388e64d 100644 ---- a/Lib/test/test_webbrowser.py -+++ b/Lib/test/test_webbrowser.py -@@ -65,6 +65,11 @@ def test_open(self): - options=[], - arguments=[URL]) - -+ def test_reject_dash_prefixes(self): -+ browser = self.browser_class(name=CMD_NAME) -+ with self.assertRaises(ValueError): -+ browser.open(f"--key=val {URL}") -+ - - class BackgroundBrowserCommandTest(CommandTestMixin, unittest.TestCase): - -diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py -index 2f9555ad60..e322cbf5d1 100755 ---- a/Lib/webbrowser.py -+++ b/Lib/webbrowser.py -@@ -164,6 +164,12 @@ def open_new(self, url): - def open_new_tab(self, url): - return self.open(url, 2) - -+ @staticmethod -+ def _check_url(url): -+ """Ensures that the URL is safe to pass to subprocesses as a parameter""" -+ if url and url.lstrip().startswith("-"): -+ raise ValueError(f"Invalid URL: {url}") -+ - - class GenericBrowser(BaseBrowser): - """Class for all browsers started with a command -@@ -181,6 +187,7 @@ def __init__(self, name): - - def open(self, url, new=0, autoraise=True): - sys.audit("webbrowser.open", url) -+ self._check_url(url) - cmdline = [self.name] + [arg.replace("%s", url) - for arg in self.args] - try: -@@ -201,6 +208,7 @@ def open(self, url, new=0, autoraise=True): - cmdline = [self.name] + [arg.replace("%s", url) - for arg in self.args] - sys.audit("webbrowser.open", url) -+ self._check_url(url) - try: - if sys.platform[:3] == 'win': - p = subprocess.Popen(cmdline) -@@ -267,6 +275,7 @@ def _invoke(self, args, remote, autoraise, url=None): - - def open(self, url, new=0, autoraise=True): - sys.audit("webbrowser.open", url) -+ self._check_url(url) - if new == 0: - action = self.remote_action - elif new == 1: -@@ -358,6 +367,7 @@ class Konqueror(BaseBrowser): - - def open(self, url, new=0, autoraise=True): - sys.audit("webbrowser.open", url) -+ self._check_url(url) - # XXX Currently I know no way to prevent KFM from opening a new win. - if new == 2: - action = "newTab" -@@ -576,6 +586,7 @@ def register_standard_browsers(): - class WindowsDefault(BaseBrowser): - def open(self, url, new=0, autoraise=True): - sys.audit("webbrowser.open", url) -+ self._check_url(url) - try: - os.startfile(url) - except OSError: -@@ -596,6 +607,7 @@ def __init__(self, name='default'): - - def open(self, url, new=0, autoraise=True): - sys.audit("webbrowser.open", url) -+ self._check_url(url) - url = url.replace('"', '%22') - if self.name == 'default': - script = f'open location "{url}"' # opens in default browser -@@ -627,6 +639,7 @@ def open(self, url, new=0, autoraise=True): - class IOSBrowser(BaseBrowser): - def open(self, url, new=0, autoraise=True): - sys.audit("webbrowser.open", url) -+ self._check_url(url) - # If ctypes isn't available, we can't open a browser - if objc is None: - return False -diff --git a/Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst b/Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst -new file mode 100644 -index 0000000000..0f27eae99a ---- /dev/null -+++ b/Misc/NEWS.d/next/Security/2026-01-16-12-04-49.gh-issue-143930.zYC5x3.rst -@@ -0,0 +1 @@ -+Reject leading dashes in URLs passed to :func:`webbrowser.open` diff --git a/python3.13.spec b/python3.13.spec index 7df50c8..0a196bb 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,11 +45,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.12 +%global general_version %{pybasever}.13 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -109,21 +109,21 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 25.3 +%global pip_version 26.0.1 %global setuptools_version 79.0.1 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: -Provides: bundled(python3dist(cachecontrol)) = 0.14.3 -Provides: bundled(python3dist(certifi)) = 2025.10.5 +Provides: bundled(python3dist(cachecontrol)) = 0.14.4 +Provides: bundled(python3dist(certifi)) = 2026.1.4 Provides: bundled(python3dist(dependency-groups)) = 1.3.1 Provides: bundled(python3dist(distlib)) = 0.4 Provides: bundled(python3dist(distro)) = 1.9 -Provides: bundled(python3dist(idna)) = 3.10 +Provides: bundled(python3dist(idna)) = 3.11 Provides: bundled(python3dist(msgpack)) = 1.1.2 -Provides: bundled(python3dist(packaging)) = 25 -Provides: bundled(python3dist(platformdirs)) = 4.5 +Provides: bundled(python3dist(packaging)) = 26 +Provides: bundled(python3dist(platformdirs)) = 4.5.1 Provides: bundled(python3dist(pygments)) = 2.19.2 Provides: bundled(python3dist(pyproject-hooks)) = 1.2 Provides: bundled(python3dist(requests)) = 2.32.5 @@ -421,12 +421,6 @@ Patch475: 00475-cve-2025-15367.patch # direct call to the check function. Patch477: 00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch -# 00478 # 6f5526308e189515c79efb05770d4b2b5aefc0d0 -# CVE-2026-4519 -# -# Reject leading dashes in webbrowser URLs (GH-146215) -Patch478: 00478-cve-2026-4519.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc., @@ -1832,6 +1826,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Apr 08 2026 Tomáš Hrnčiar - 3.13.13-1 +- Update to 3.13.13 + * Thu Mar 26 2026 Lumír Balhar - 3.13.12-2 - Security fix for CVE-2026-4519 (rhbz#2449729) diff --git a/sources b/sources index 67ba30c..8ca0534 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.12.tar.xz) = 5edecdf13999d8629f31543dffdcba521dbb5633577e481ee49275e377509a2f6d700624c26f95b57a8ff9501378d10d7c07c1d0e7e19be0d6c88f05b6315a13 -SHA512 (Python-3.13.12.tar.xz.asc) = 6d42bc51b3658e1b092e7ab44306f6fc968646a7a9aeb63a3c443d1f75e27153a2138e88c15cebf8d559ce6d7744acecd4e6026c6d0be6fde070f804042d4aea +SHA512 (Python-3.13.13.tar.xz) = 0ef615150a52865fe7ca0d0e106cf98488f113a56e5ae1b1437673f03880423839d04abe1999006f9835c77d8802d5ae94a1bdf63d18074a9a19c81e6f7b69e8 +SHA512 (Python-3.13.13.tar.xz.asc) = 21e5235cd9a9df3546370feb55ac32539e08601b79ee7b1e39006028f192be6be0434f2f8384fdcc993b70bde7471be3b36ce9850abf0473d1fe2c7cdc98304b From 58718512eda7b324fa61f424133a12d280f4f819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 9 Apr 2026 13:16:25 +0200 Subject: [PATCH 110/115] Explicitly build with OpenSSL 3 for now https://fedoraproject.org/wiki/Changes/OpenSSL40 --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index 0a196bb..a0ddc22 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -268,7 +268,6 @@ BuildRequires: libuuid-devel BuildRequires: make BuildRequires: mpdecimal-devel BuildRequires: ncurses-devel -BuildRequires: openssl-devel BuildRequires: pkgconfig BuildRequires: python-rpm-macros BuildRequires: readline-devel @@ -281,6 +280,10 @@ BuildRequires: xz-devel BuildRequires: zlib-devel BuildRequires: /usr/bin/dtrace +# Support for OpenSSL 4 only landed in Python 3.15 for now +# https://github.com/python/cpython/issues/146207 +BuildRequires: (openssl-devel < 1:4 or openssl3-devel) + %if %{undefined rhel} BuildRequires: libb2-devel %endif From a5e28d44e7880e566f0217425f9750aea8467eb5 Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Thu, 11 Jun 2026 16:05:46 +0200 Subject: [PATCH 111/115] Update to Python 3.13.14 --- ...-pac-and-bti-protections-for-aarch64.patch | 102 ------------------ ...not-working-with-older-expat-version.patch | 10 +- 00474-cve-2025-15366.patch | 6 +- ...piled-for-a-different-python-version.patch | 14 +-- python3.13.spec | 35 ++---- sources | 4 +- 6 files changed, 27 insertions(+), 144 deletions(-) delete mode 100644 00464-enable-pac-and-bti-protections-for-aarch64.patch diff --git a/00464-enable-pac-and-bti-protections-for-aarch64.patch b/00464-enable-pac-and-bti-protections-for-aarch64.patch deleted file mode 100644 index 1a7acf3..0000000 --- a/00464-enable-pac-and-bti-protections-for-aarch64.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Charalampos Stratakis -Date: Tue, 3 Jun 2025 03:02:15 +0200 -Subject: 00464: Enable PAC and BTI protections for aarch64 - -Apply protection against ROP/JOP attacks for aarch64 on asm_trampoline.S - -The BTI flag must be applied in the assembler sources for this class -of attacks to be mitigated on newer aarch64 processors. - -Upstream PR: https://github.com/python/cpython/pull/130864/files - -The upstream patch is incomplete but only for the case where -frame pointers are not used on 3.13+. - -Since on Fedora we always compile with frame pointers the BTI/PAC -hardware protections can be enabled without losing Perf unwinding. ---- - Python/asm_trampoline.S | 4 +++ - Python/asm_trampoline_aarch64.h | 50 +++++++++++++++++++++++++++++++++ - 2 files changed, 54 insertions(+) - create mode 100644 Python/asm_trampoline_aarch64.h - -diff --git a/Python/asm_trampoline.S b/Python/asm_trampoline.S -index a14e68c0e8..2513cde4e7 100644 ---- a/Python/asm_trampoline.S -+++ b/Python/asm_trampoline.S -@@ -1,3 +1,5 @@ -+#include "asm_trampoline_aarch64.h" -+ - .text - .globl _Py_trampoline_func_start - # The following assembly is equivalent to: -@@ -21,10 +23,12 @@ _Py_trampoline_func_start: - #if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__) - // ARM64 little endian, 64bit ABI - // generate with aarch64-linux-gnu-gcc 12.1 -+ SIGN_LR - stp x29, x30, [sp, -16]! - mov x29, sp - blr x3 - ldp x29, x30, [sp], 16 -+ VERIFY_LR - ret - #endif - #ifdef __riscv -diff --git a/Python/asm_trampoline_aarch64.h b/Python/asm_trampoline_aarch64.h -new file mode 100644 -index 0000000000..4b0ec4a7dc ---- /dev/null -+++ b/Python/asm_trampoline_aarch64.h -@@ -0,0 +1,50 @@ -+#ifndef ASM_TRAMPOLINE_AARCH_64_H_ -+#define ASM_TRAMPOLINE_AARCH_64_H_ -+ -+/* -+ * References: -+ * - https://developer.arm.com/documentation/101028/0012/5--Feature-test-macros -+ * - https://github.com/ARM-software/abi-aa/blob/main/aaelf64/aaelf64.rst -+ */ -+ -+#if defined(__ARM_FEATURE_BTI_DEFAULT) && __ARM_FEATURE_BTI_DEFAULT == 1 -+ #define BTI_J hint 36 /* bti j: for jumps, IE br instructions */ -+ #define BTI_C hint 34 /* bti c: for calls, IE bl instructions */ -+ #define GNU_PROPERTY_AARCH64_BTI 1 /* bit 0 GNU Notes is for BTI support */ -+#else -+ #define BTI_J -+ #define BTI_C -+ #define GNU_PROPERTY_AARCH64_BTI 0 -+#endif -+ -+#if defined(__ARM_FEATURE_PAC_DEFAULT) -+ #if __ARM_FEATURE_PAC_DEFAULT & 1 -+ #define SIGN_LR hint 25 /* paciasp: sign with the A key */ -+ #define VERIFY_LR hint 29 /* autiasp: verify with the A key */ -+ #elif __ARM_FEATURE_PAC_DEFAULT & 2 -+ #define SIGN_LR hint 27 /* pacibsp: sign with the b key */ -+ #define VERIFY_LR hint 31 /* autibsp: verify with the b key */ -+ #endif -+ #define GNU_PROPERTY_AARCH64_POINTER_AUTH 2 /* bit 1 GNU Notes is for PAC support */ -+#else -+ #define SIGN_LR BTI_C -+ #define VERIFY_LR -+ #define GNU_PROPERTY_AARCH64_POINTER_AUTH 0 -+#endif -+ -+/* Add the BTI and PAC support to GNU Notes section */ -+#if GNU_PROPERTY_AARCH64_BTI != 0 || GNU_PROPERTY_AARCH64_POINTER_AUTH != 0 -+ .pushsection .note.gnu.property, "a"; /* Start a new allocatable section */ -+ .balign 8; /* align it on a byte boundry */ -+ .long 4; /* size of "GNU\0" */ -+ .long 0x10; /* size of descriptor */ -+ .long 0x5; /* NT_GNU_PROPERTY_TYPE_0 */ -+ .asciz "GNU"; -+ .long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */ -+ .long 4; /* Four bytes of data */ -+ .long (GNU_PROPERTY_AARCH64_BTI|GNU_PROPERTY_AARCH64_POINTER_AUTH); /* BTI or PAC is enabled */ -+ .long 0; /* padding for 8 byte alignment */ -+ .popsection; /* end the section */ -+#endif -+ -+#endif diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch index 643501b..7105bf4 100644 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -15,10 +15,10 @@ which is tested as working. 3 files changed, 10 insertions(+) diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py -index 2309353503..fca62245d4 100644 +index ebd8c955dc..678815596b 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py -@@ -901,6 +901,8 @@ def start_element(name, _): +@@ -1013,6 +1013,8 @@ def start_element(name, _): self.assertEqual(started, ['doc']) @@ -41,10 +41,10 @@ index 9b3014a94a..90401e0d8f 100644 result = BytesIO() xmlgen = XMLGenerator(result) diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index 597ec83061..bf2db1779c 100644 +index c306b7d036..476e6f7956 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py -@@ -1574,9 +1574,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): +@@ -1599,9 +1599,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): self.assert_event_tags(parser, [('end', 'root')]) self.assertIsNone(parser.close()) @@ -58,7 +58,7 @@ index 597ec83061..bf2db1779c 100644 def test_simple_xml_chunk_5(self): self.test_simple_xml(chunk_size=5, flush=True) -@@ -1803,6 +1807,8 @@ def test_flush_reparse_deferral_enabled(self): +@@ -1828,6 +1832,8 @@ def test_flush_reparse_deferral_enabled(self): self.assert_event_tags(parser, [('end', 'doc')]) diff --git a/00474-cve-2025-15366.patch b/00474-cve-2025-15366.patch index 32aa4c3..d055956 100644 --- a/00474-cve-2025-15366.patch +++ b/00474-cve-2025-15366.patch @@ -12,7 +12,7 @@ Reject control characters in IMAP commands create mode 100644 Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst diff --git a/Lib/imaplib.py b/Lib/imaplib.py -index 141e639894..f282e5c061 100644 +index db16f3c802..e7fc0b55fd 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -132,7 +132,7 @@ @@ -34,10 +34,10 @@ index 141e639894..f282e5c061 100644 literal = self.literal diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py -index 9f1f682d02..820c2a5db5 100644 +index 6573b4e7f3..bc01ce9f13 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py -@@ -515,6 +515,12 @@ def test_login(self): +@@ -525,6 +525,12 @@ def test_login(self): self.assertEqual(data[0], b'LOGIN completed') self.assertEqual(client.state, 'AUTH') diff --git a/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch b/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch index 2f47bac..51fbe50 100644 --- a/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch +++ b/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch @@ -81,7 +81,7 @@ index 2a17c891dd..64017c666c 100644 } #endif diff --git a/Makefile.pre.in b/Makefile.pre.in -index ecf77bdc41..91bfd06a78 100644 +index 8589a28b72..9aaeb5e5b4 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -3153,3 +3153,6 @@ MODULE__MULTIBYTECODEC_DEPS=$(srcdir)/Modules/cjkcodecs/multibytecodec.h @@ -92,10 +92,10 @@ index ecf77bdc41..91bfd06a78 100644 +# Fedora-specific, downstream only +PY_STDMODULE_CFLAGS += -D_PyHack_check_version_on_modinit=1 diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c -index 0200f59020..bb647555c0 100644 +index e6b5271357..e536ab51af 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c -@@ -4763,6 +4763,12 @@ curses_destructor(PyObject *op) +@@ -4783,6 +4783,12 @@ curses_destructor(PyObject *op) PyMODINIT_FUNC PyInit__curses(void) { @@ -109,10 +109,10 @@ index 0200f59020..bb647555c0 100644 /* Initialize object type */ diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c -index 14efe18db5..70597c2815 100644 +index de93994aa0..10f95215bd 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c -@@ -3431,6 +3431,12 @@ static struct PyModuleDef _tkintermodule = { +@@ -3432,6 +3432,12 @@ static struct PyModuleDef _tkintermodule = { PyMODINIT_FUNC PyInit__tkinter(void) { @@ -143,10 +143,10 @@ index 0b85187e5f..87f358ed07 100644 m = PyModule_Create(&module_def); if (m == NULL) diff --git a/Modules/readline.c b/Modules/readline.c -index f9362c312d..66f1ec65a6 100644 +index 7a612deae4..8b2f47eec1 100644 --- a/Modules/readline.c +++ b/Modules/readline.c -@@ -1540,6 +1540,12 @@ static struct PyModuleDef readlinemodule = { +@@ -1548,6 +1548,12 @@ static struct PyModuleDef readlinemodule = { PyMODINIT_FUNC PyInit_readline(void) { diff --git a/python3.13.spec b/python3.13.spec index a0ddc22..ba9fce7 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,7 +45,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.13 +%global general_version %{pybasever}.14 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -109,31 +109,30 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 26.0.1 +%global pip_version 26.1.2 %global setuptools_version 79.0.1 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: Provides: bundled(python3dist(cachecontrol)) = 0.14.4 -Provides: bundled(python3dist(certifi)) = 2026.1.4 -Provides: bundled(python3dist(dependency-groups)) = 1.3.1 +Provides: bundled(python3dist(certifi)) = 2026.2.25 Provides: bundled(python3dist(distlib)) = 0.4 Provides: bundled(python3dist(distro)) = 1.9 Provides: bundled(python3dist(idna)) = 3.11 Provides: bundled(python3dist(msgpack)) = 1.1.2 -Provides: bundled(python3dist(packaging)) = 26 +Provides: bundled(python3dist(packaging)) = 26.2 Provides: bundled(python3dist(platformdirs)) = 4.5.1 Provides: bundled(python3dist(pygments)) = 2.19.2 Provides: bundled(python3dist(pyproject-hooks)) = 1.2 -Provides: bundled(python3dist(requests)) = 2.32.5 +Provides: bundled(python3dist(requests)) = 2.33.1 Provides: bundled(python3dist(resolvelib)) = 1.2.1 Provides: bundled(python3dist(rich)) = 14.2 Provides: bundled(python3dist(setuptools)) = 70.3 -Provides: bundled(python3dist(tomli)) = 2.3 +Provides: bundled(python3dist(tomli)) = 2.3.1 Provides: bundled(python3dist(tomli-w)) = 1.2 Provides: bundled(python3dist(truststore)) = 0.10.4 -Provides: bundled(python3dist(urllib3)) = 1.26.20 +Provides: bundled(python3dist(urllib3)) = 2.6.3 } # setuptools # vendor.txt not in .whl @@ -371,23 +370,6 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00464 # 292acffec7a379cb6d1f3c47b9e5a2f170bbadb6 -# Enable PAC and BTI protections for aarch64 -# -# Apply protection against ROP/JOP attacks for aarch64 on asm_trampoline.S -# -# The BTI flag must be applied in the assembler sources for this class -# of attacks to be mitigated on newer aarch64 processors. -# -# Upstream PR: https://github.com/python/cpython/pull/130864/files -# -# The upstream patch is incomplete but only for the case where -# frame pointers are not used on 3.13+. -# -# Since on Fedora we always compile with frame pointers the BTI/PAC -# hardware protections can be enabled without losing Perf unwinding. -Patch464: 00464-enable-pac-and-bti-protections-for-aarch64.patch - # 00466 # e10760fb955ee33d2917f8a57bb4e24d71e5341c # Downstream only: Skip tests not working with older expat version # @@ -1829,6 +1811,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Jun 11 2026 Karolina Surma - 3.13.14-1 +- Update to Python 3.13.14 + * Wed Apr 08 2026 Tomáš Hrnčiar - 3.13.13-1 - Update to 3.13.13 diff --git a/sources b/sources index 8ca0534..69e5ac7 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.13.tar.xz) = 0ef615150a52865fe7ca0d0e106cf98488f113a56e5ae1b1437673f03880423839d04abe1999006f9835c77d8802d5ae94a1bdf63d18074a9a19c81e6f7b69e8 -SHA512 (Python-3.13.13.tar.xz.asc) = 21e5235cd9a9df3546370feb55ac32539e08601b79ee7b1e39006028f192be6be0434f2f8384fdcc993b70bde7471be3b36ce9850abf0473d1fe2c7cdc98304b +SHA512 (Python-3.13.14.tar.xz) = 0790da65f8ce88a13b06d3b287ace5a1f36b0a8f630a3af00fbbdf93b6ef0944dea05173a20c9e1336d280ef9a97ae2b95a44a4b487a7bbb71fda53b6331c0eb +SHA512 (Python-3.13.14.tar.xz.asc) = a5cfab862ac03447838d13c4d1a9b085a8c8a947c958fd42cecb42929817b1448c1b23a124c87456abd43a1cadfcfb427f394eead9eaf0b84f3296fa263dba6c From ae2158c990e6504c71f7c8428c5af8c7a25134f1 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Wed, 24 Jun 2026 22:07:41 +0200 Subject: [PATCH 112/115] Run a new test to monitor changes in required symbols --- plan.fmf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plan.fmf b/plan.fmf index 432f1a3..9c9afb8 100644 --- a/plan.fmf +++ b/plan.fmf @@ -43,6 +43,9 @@ discover: - name: marshalparser path: /marshalparser test: "VERSION=${pybasever} SAMPLE=10 ./test_marshalparser_compatibility.sh" + - name: required_symbols + path: /required-symbols + test: "VERSION=${pybasever} ./check.sh" prepare: - name: Install dependencies @@ -62,8 +65,9 @@ prepare: - virtualenv # for virtualenv tests - glibc-all-langpacks # for locale tests - marshalparser # for testing compatibility (magic numbers) with marshalparser + - binutils # for nm (symbol inspection) - rpm # for debugging - - dnf # for upgrade + - dnf # for upgrade and downgrade - name: Update packages how: shell script: dnf upgrade -y From 8cc71e2467fe13498edb67f60965a3f4c52b895f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jul 2026 22:48:21 +0000 Subject: [PATCH 113/115] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- python3.13.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python3.13.spec b/python3.13.spec index ba9fce7..0c163a2 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -49,7 +49,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -1811,6 +1811,9 @@ CheckPython freethreading # ====================================================== %changelog +* Thu Jul 16 2026 Fedora Release Engineering - 3.13.14-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Thu Jun 11 2026 Karolina Surma - 3.13.14-1 - Update to Python 3.13.14 From b93f3ee7d7c859567d3f017a008ec6c7fc83fe5b Mon Sep 17 00:00:00 2001 From: Karolina Surma Date: Mon, 10 Aug 2026 11:12:25 +0200 Subject: [PATCH 114/115] Update to Python 3.13.15 --- ...not-working-with-older-expat-version.patch | 6 +- 00474-cve-2025-15366.patch | 59 ------------------- ...piled-for-a-different-python-version.patch | 12 ++-- plan.fmf | 5 +- python3.13.spec | 40 +++++++------ sources | 4 +- 6 files changed, 35 insertions(+), 91 deletions(-) delete mode 100644 00474-cve-2025-15366.patch diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch index 7105bf4..349deeb 100644 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch @@ -15,10 +15,10 @@ which is tested as working. 3 files changed, 10 insertions(+) diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py -index ebd8c955dc..678815596b 100644 +index ae7cec6540..4770c5cc4f 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py -@@ -1013,6 +1013,8 @@ def start_element(name, _): +@@ -1033,6 +1033,8 @@ def start_element(name, _): self.assertEqual(started, ['doc']) @@ -41,7 +41,7 @@ index 9b3014a94a..90401e0d8f 100644 result = BytesIO() xmlgen = XMLGenerator(result) diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index c306b7d036..476e6f7956 100644 +index 4a76a5be1e..d740e30123 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -1599,9 +1599,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): diff --git a/00474-cve-2025-15366.patch b/00474-cve-2025-15366.patch deleted file mode 100644 index d055956..0000000 --- a/00474-cve-2025-15366.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Seth Michael Larson -Date: Tue, 20 Jan 2026 14:45:42 -0600 -Subject: 00474: CVE-2025-15366 - -Reject control characters in IMAP commands ---- - Lib/imaplib.py | 4 +++- - Lib/test/test_imaplib.py | 6 ++++++ - .../Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst | 1 + - 3 files changed, 10 insertions(+), 1 deletion(-) - create mode 100644 Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst - -diff --git a/Lib/imaplib.py b/Lib/imaplib.py -index db16f3c802..e7fc0b55fd 100644 ---- a/Lib/imaplib.py -+++ b/Lib/imaplib.py -@@ -132,7 +132,7 @@ - # We compile these in _mode_xxx. - _Literal = br'.*{(?P\d+)}$' - _Untagged_status = br'\* (?P\d+) (?P[A-Z-]+)( (?P.*))?' -- -+_control_chars = re.compile(b'[\x00-\x1F\x7F]') - - - class IMAP4: -@@ -1000,6 +1000,8 @@ def _command(self, name, *args): - if arg is None: continue - if isinstance(arg, str): - arg = bytes(arg, self._encoding) -+ if _control_chars.search(arg): -+ raise ValueError("Control characters not allowed in commands") - data = data + b' ' + arg - - literal = self.literal -diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py -index 6573b4e7f3..bc01ce9f13 100644 ---- a/Lib/test/test_imaplib.py -+++ b/Lib/test/test_imaplib.py -@@ -525,6 +525,12 @@ def test_login(self): - self.assertEqual(data[0], b'LOGIN completed') - self.assertEqual(client.state, 'AUTH') - -+ def test_control_characters(self): -+ client, _ = self._setup(SimpleIMAPHandler) -+ for c0 in support.control_characters_c0(): -+ with self.assertRaises(ValueError): -+ client.login(f'user{c0}', 'pass') -+ - def test_logout(self): - client, _ = self._setup(SimpleIMAPHandler) - typ, data = client.login('user', 'pass') -diff --git a/Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst b/Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst -new file mode 100644 -index 0000000000..4e13fe92bc ---- /dev/null -+++ b/Misc/NEWS.d/next/Security/2026-01-16-11-41-06.gh-issue-143921.AeCOor.rst -@@ -0,0 +1 @@ -+Reject control characters in IMAP commands. diff --git a/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch b/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch index 51fbe50..f860aa1 100644 --- a/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch +++ b/00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-different-python-version.patch @@ -81,10 +81,10 @@ index 2a17c891dd..64017c666c 100644 } #endif diff --git a/Makefile.pre.in b/Makefile.pre.in -index 8589a28b72..9aaeb5e5b4 100644 +index 2363b99a25..f1a07645f0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -3153,3 +3153,6 @@ MODULE__MULTIBYTECODEC_DEPS=$(srcdir)/Modules/cjkcodecs/multibytecodec.h +@@ -3159,3 +3159,6 @@ MODULE__MULTIBYTECODEC_DEPS=$(srcdir)/Modules/cjkcodecs/multibytecodec.h # Local Variables: # mode: makefile # End: @@ -92,10 +92,10 @@ index 8589a28b72..9aaeb5e5b4 100644 +# Fedora-specific, downstream only +PY_STDMODULE_CFLAGS += -D_PyHack_check_version_on_modinit=1 diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c -index e6b5271357..e536ab51af 100644 +index 1996488a0e..cfdffd8ec4 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c -@@ -4783,6 +4783,12 @@ curses_destructor(PyObject *op) +@@ -5011,6 +5011,12 @@ curses_destructor(PyObject *op) PyMODINIT_FUNC PyInit__curses(void) { @@ -109,10 +109,10 @@ index e6b5271357..e536ab51af 100644 /* Initialize object type */ diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c -index de93994aa0..10f95215bd 100644 +index 4e8d75e8e1..32e58755aa 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c -@@ -3432,6 +3432,12 @@ static struct PyModuleDef _tkintermodule = { +@@ -3499,6 +3499,12 @@ static struct PyModuleDef _tkintermodule = { PyMODINIT_FUNC PyInit__tkinter(void) { diff --git a/plan.fmf b/plan.fmf index 9c9afb8..71d0124 100644 --- a/plan.fmf +++ b/plan.fmf @@ -24,10 +24,11 @@ discover: test: "PYTHON=python${pybasever}d TOX=false VERSION=${pybasever} CYTHON=false ./venv.sh" - name: selftest path: /selftest - test: "VERSION=${pybasever} X='-i test_check_probes' ./parallel.sh" + # test_subparser_inherits_reparse_deferral fails on EPEL9: https://github.com/python/cpython/issues/155485 + test: "VERSION=${pybasever} X='-i test_check_probes -i test_subparser_inherits_reparse_deferral' ./parallel.sh" - name: debugtest path: /selftest - test: "VERSION=${pybasever} PYTHON=python${pybasever}d X='-i test_check_probes' ./parallel.sh" + test: "VERSION=${pybasever} PYTHON=python${pybasever}d X='-i test_check_probes -i test_subparser_inherits_reparse_deferral' ./parallel.sh" - name: optimizedflags path: /flags test: "python${pybasever} ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" diff --git a/python3.13.spec b/python3.13.spec index 0c163a2..0879de7 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -45,11 +45,11 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.14 +%global general_version %{pybasever}.15 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 2%{?dist} +Release: 1%{?dist} License: Python-2.0.1 @@ -109,30 +109,30 @@ License: Python-2.0.1 # This needs to be manually updated when we update Python. # Explore the sources tarball (you need the version before %%prep is executed): # $ tar -tf Python-%%{upstream_version}.tar.xz | grep whl -%global pip_version 26.1.2 +%global pip_version 26.2.1 %global setuptools_version 79.0.1 # All of those also include a list of indirect bundled libs: # pip # $ %%{_rpmconfigdir}/pythonbundles.py <(unzip -p Lib/ensurepip/_bundled/pip-*.whl pip/_vendor/vendor.txt) %global pip_bundled_provides %{expand: Provides: bundled(python3dist(cachecontrol)) = 0.14.4 -Provides: bundled(python3dist(certifi)) = 2026.2.25 -Provides: bundled(python3dist(distlib)) = 0.4 +Provides: bundled(python3dist(certifi)) = 2026.6.17 +Provides: bundled(python3dist(distlib)) = 0.4.2 Provides: bundled(python3dist(distro)) = 1.9 -Provides: bundled(python3dist(idna)) = 3.11 +Provides: bundled(python3dist(idna)) = 3.18 Provides: bundled(python3dist(msgpack)) = 1.1.2 Provides: bundled(python3dist(packaging)) = 26.2 -Provides: bundled(python3dist(platformdirs)) = 4.5.1 -Provides: bundled(python3dist(pygments)) = 2.19.2 +Provides: bundled(python3dist(platformdirs)) = 4.10 +Provides: bundled(python3dist(pygments)) = 2.20 Provides: bundled(python3dist(pyproject-hooks)) = 1.2 -Provides: bundled(python3dist(requests)) = 2.33.1 +Provides: bundled(python3dist(requests)) = 2.34.2 Provides: bundled(python3dist(resolvelib)) = 1.2.1 Provides: bundled(python3dist(rich)) = 14.2 Provides: bundled(python3dist(setuptools)) = 70.3 -Provides: bundled(python3dist(tomli)) = 2.3.1 +Provides: bundled(python3dist(tomli)) = 2.4.1 Provides: bundled(python3dist(tomli-w)) = 1.2 Provides: bundled(python3dist(truststore)) = 0.10.4 -Provides: bundled(python3dist(urllib3)) = 2.6.3 +Provides: bundled(python3dist(urllib3)) = 2.7 } # setuptools # vendor.txt not in .whl @@ -379,12 +379,6 @@ Patch251: 00251-change-user-install-location.patch # which is tested as working. Patch466: 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch -# 00474 # 837ddca0372fa87ff9cee47142200caa21e77def -# CVE-2025-15366 -# -# Reject control characters in IMAP commands -Patch474: 00474-cve-2025-15366.patch - # 00475 # d44fac01037662db286449a78c8fb819788f764c # CVE-2025-15367 # @@ -530,7 +524,7 @@ Summary: Python runtime libraries # Combined manually from https://docs.python.org/3.13/license.html # Hash of Doc/license.rst which is compared in %%prep, generated with: # $ sha256sum Doc/license.rst | cut -f1 -d" " -%global license_file_hash 62f2c9c2c75d511170eb464ad5f83b78cc1f37eb2eb49c2846c9aa6c4557ee99 +%global license_file_hash 952ac05720d7f1dcb63589b35eb0931b1442eb250230a4ad31198eddf0ad6abc # Licenses of incorporated software: # Mersenne Twister in _random C extension contains code under BSD-3-Clause # socket.getaddrinfo() and socket.getnameinfo() are BSD-3-Clause @@ -553,10 +547,11 @@ Summary: Python runtime libraries # mimalloc is MIT # parts of asyncio from uvloop are MIT # Python/qsbr.c is adapted from code under BSD-2-Clause +# An extract of the `Unicode Character Database` converted to an internal format is Unicode-3.0 # Bundled libb2 is not declared in the upstream document, but it's: # CC0-1.0, covered by grandfathering exception # We don't query upstream for changes, as 3.13 is the last Python version containing it. -%global libs_license Python-2.0.1 AND CC0-1.0 AND MIT AND BSD-3-Clause AND MIT-CMU AND HPND-SMC AND BSD-2-Clause AND dtoa +%global libs_license Python-2.0.1 AND CC0-1.0 AND MIT AND BSD-3-Clause AND MIT-CMU AND HPND-SMC AND BSD-2-Clause AND dtoa AND Unicode-3.0 %if %{with rpmwheels} Requires: %{python_wheel_pkg_prefix}-pip-wheel >= 23.1.2 License: %{libs_license} @@ -1364,6 +1359,7 @@ CheckPython() { # test.test_concurrent_futures.test_deadlock tends to time out on s390x and ppc64le in # freethreading{,-debug} build, skipping it to shorten the build time # see: https://github.com/python/cpython/issues/121719 + # test_subparser_inherits_reparse_deferral: https://github.com/python/cpython/issues/155485 LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest %{_smp_mflags} \ %ifarch riscv64 @@ -1380,6 +1376,9 @@ CheckPython() { -x test_signal \ -i test_deadlock \ %endif + %if 0%{?rhel} == 9 + -i test_subparser_inherits_reparse_deferral \ + %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1811,6 +1810,9 @@ CheckPython freethreading # ====================================================== %changelog +* Mon Aug 10 2026 Karolina Surma - 3.13.15-1 +- Update to Python 3.13.15 + * Thu Jul 16 2026 Fedora Release Engineering - 3.13.14-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild diff --git a/sources b/sources index 69e5ac7..d6a2436 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.13.14.tar.xz) = 0790da65f8ce88a13b06d3b287ace5a1f36b0a8f630a3af00fbbdf93b6ef0944dea05173a20c9e1336d280ef9a97ae2b95a44a4b487a7bbb71fda53b6331c0eb -SHA512 (Python-3.13.14.tar.xz.asc) = a5cfab862ac03447838d13c4d1a9b085a8c8a947c958fd42cecb42929817b1448c1b23a124c87456abd43a1cadfcfb427f394eead9eaf0b84f3296fa263dba6c +SHA512 (Python-3.13.15.tar.xz) = b0ab766a3de0b4cfdbf0b93300d7330c734d3f7057577bb03e95e39da4cdade81993e769c7fa6dfdcc13b9d43a3b399d9cd89b5477b413662e9e691c1b7886b8 +SHA512 (Python-3.13.15.tar.xz.asc) = 662c00be95f62e80db43cf42099fef91f764ff7a4433cadf7eb19dedb5e4775adb12878d5ed2295fcea187731de186163ad9672ab72cde62a2335ca58ec1ad86 From 0ca3f59c07cb0d9bf01a0746d00773ed0c625755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 12 Aug 2026 17:31:43 +0200 Subject: [PATCH 115/115] On EL 9, also supports reparse deferral in expat This replaces one downstream-only patch with another. Yet arguably, this is the safer thing to do. Read the patch description for details; won't copy paste them here. Also, require expat >= version-release when expat < 2.7.4. Assisted-By: Claude Opus 4.6 --- ...rsion-threshold-for-reparse-deferral.patch | 133 ++++++++++++++++++ ...not-working-with-older-expat-version.patch | 69 --------- plan.fmf | 5 +- python3.13.spec | 39 +++-- 4 files changed, 160 insertions(+), 86 deletions(-) create mode 100644 00466-downstream-only-lower-xml_combined_version-threshold-for-reparse-deferral.patch delete mode 100644 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch diff --git a/00466-downstream-only-lower-xml_combined_version-threshold-for-reparse-deferral.patch b/00466-downstream-only-lower-xml_combined_version-threshold-for-reparse-deferral.patch new file mode 100644 index 0000000..15de467 --- /dev/null +++ b/00466-downstream-only-lower-xml_combined_version-threshold-for-reparse-deferral.patch @@ -0,0 +1,133 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Wed, 12 Aug 2026 15:18:39 +0200 +Subject: 00466: Downstream only: Lower XML_COMBINED_VERSION threshold for + reparse deferral + +RHEL 9 expat 2.5.0 has XML_SetReparseDeferralEnabled backported +via the CVE-2023-52425 fix, but XML_COMBINED_VERSION remains 20500. +CPython's #if XML_COMBINED_VERSION >= 20600 guards compile the setter +as a no-op, so SetReparseDeferralEnabled silently does nothing and +GetReparseDeferralEnabled always returns False, even though the expat +library actually supports (and enables) reparse deferral. + +Lower the threshold from 20600 to 20500 so that CPython uses the +backported function. This makes the Python API actually work on RHEL 9 +and fixes test failures (test_reparse_deferral_disabled, +test_flush_reparse_deferral_disabled, test_simple_xml_chunk_*). + +The spec file BuildRequires expat-devel >= 2.5.0-2 to ensure the +backported function is available. +--- + Lib/test/test_pyexpat.py | 6 +++--- + Lib/test/test_sax.py | 4 ++-- + Lib/test/test_xml_etree.py | 4 ++-- + Modules/pyexpat.c | 6 +++--- + 4 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py +index ae7cec6540..7f73a8c5e7 100644 +--- a/Lib/test/test_pyexpat.py ++++ b/Lib/test/test_pyexpat.py +@@ -1001,7 +1001,7 @@ def test_error_path_no_crash(self): + class ReparseDeferralTest(unittest.TestCase): + def test_getter_setter_round_trip(self): + parser = expat.ParserCreate() +- enabled = (expat.version_info >= (2, 6, 0)) ++ enabled = (expat.version_info >= (2, 5, 0)) + + self.assertIs(parser.GetReparseDeferralEnabled(), enabled) + parser.SetReparseDeferralEnabled(False) +@@ -1010,7 +1010,7 @@ def test_getter_setter_round_trip(self): + self.assertIs(parser.GetReparseDeferralEnabled(), enabled) + + def test_reparse_deferral_enabled(self): +- if expat.version_info < (2, 6, 0): ++ if expat.version_info < (2, 5, 0): + self.skipTest(f'Expat {expat.version_info} does not ' + 'support reparse deferral') + +@@ -1041,7 +1041,7 @@ def start_element(name, _): + + parser = expat.ParserCreate() + parser.StartElementHandler = start_element +- if expat.version_info >= (2, 6, 0): ++ if expat.version_info >= (2, 5, 0): + parser.SetReparseDeferralEnabled(False) + self.assertFalse(parser.GetReparseDeferralEnabled()) + +diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py +index 9b3014a94a..0e38c9488e 100644 +--- a/Lib/test/test_sax.py ++++ b/Lib/test/test_sax.py +@@ -1215,7 +1215,7 @@ def test_expat_incremental_reset(self): + + self.assertEqual(result.getvalue(), start + b"text") + +- @unittest.skipIf(pyexpat.version_info < (2, 6, 0), ++ @unittest.skipIf(pyexpat.version_info < (2, 5, 0), + f'Expat {pyexpat.version_info} does not ' + 'support reparse deferral') + def test_flush_reparse_deferral_enabled(self): +@@ -1249,7 +1249,7 @@ def test_flush_reparse_deferral_disabled(self): + for chunk in (""): + parser.feed(chunk) + +- if pyexpat.version_info >= (2, 6, 0): ++ if pyexpat.version_info >= (2, 5, 0): + parser._parser.SetReparseDeferralEnabled(False) + self.assertEqual(result.getvalue(), start) # i.e. no elements started + +diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py +index 4a76a5be1e..effb899d7b 100644 +--- a/Lib/test/test_xml_etree.py ++++ b/Lib/test/test_xml_etree.py +@@ -1804,7 +1804,7 @@ def test_unknown_event(self): + with self.assertRaisesRegex(ValueError, "unknown event 'bogus'"): + ET.XMLPullParser(events=(x.decode() for x in (b'start', b'end', b'bogus'))) + +- @unittest.skipIf(pyexpat.version_info < (2, 6, 0), ++ @unittest.skipIf(pyexpat.version_info < (2, 5, 0), + f'Expat {pyexpat.version_info} does not ' + 'support reparse deferral') + def test_flush_reparse_deferral_enabled(self): +@@ -1834,7 +1834,7 @@ def test_flush_reparse_deferral_disabled(self): + for chunk in (""): + parser.feed(chunk) + +- if pyexpat.version_info >= (2, 6, 0): ++ if pyexpat.version_info >= (2, 5, 0): + if not ET is pyET: + self.skipTest(f'XMLParser.(Get|Set)ReparseDeferralEnabled ' + 'methods not available in C') +diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c +index 9e5d84eb5e..b008fe66c1 100644 +--- a/Modules/pyexpat.c ++++ b/Modules/pyexpat.c +@@ -781,7 +781,7 @@ pyexpat_xmlparser_SetReparseDeferralEnabled_impl(xmlparseobject *self, + int enabled) + /*[clinic end generated code: output=5ec539e3b63c8c49 input=021eb9e0bafc32c5]*/ + { +-#if XML_COMBINED_VERSION >= 20600 ++#if XML_COMBINED_VERSION >= 20500 + XML_SetReparseDeferralEnabled(self->itself, enabled ? XML_TRUE : XML_FALSE); + self->reparse_deferral_enabled = (bool)enabled; + #endif +@@ -1446,7 +1446,7 @@ newxmlparseobject(pyexpat_state *state, const char *encoding, + self->ns_prefixes = 0; + self->handlers = NULL; + self->intern = Py_XNewRef(intern); +-#if XML_COMBINED_VERSION >= 20600 ++#if XML_COMBINED_VERSION >= 20500 + self->reparse_deferral_enabled = true; + #else + self->reparse_deferral_enabled = false; +@@ -2332,7 +2332,7 @@ pyexpat_exec(PyObject *mod) + #else + capi->SetHashSalt16Bytes = NULL; + #endif +-#if XML_COMBINED_VERSION >= 20600 ++#if XML_COMBINED_VERSION >= 20500 + capi->SetReparseDeferralEnabled = XML_SetReparseDeferralEnabled; + #else + capi->SetReparseDeferralEnabled = NULL; diff --git a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch b/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch deleted file mode 100644 index 349deeb..0000000 --- a/00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Tue, 24 Jun 2025 11:12:13 +0200 -Subject: 00466: Downstream only: Skip tests not working with older expat - version - -We want to run these tests in Fedora and EPEL 10, but not in EPEL 9, -which has too old version of expat. We set the upper bound version -in the conditionalized skip to a release available in CentOS Stream 10, -which is tested as working. ---- - Lib/test/test_pyexpat.py | 2 ++ - Lib/test/test_sax.py | 2 ++ - Lib/test/test_xml_etree.py | 6 ++++++ - 3 files changed, 10 insertions(+) - -diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py -index ae7cec6540..4770c5cc4f 100644 ---- a/Lib/test/test_pyexpat.py -+++ b/Lib/test/test_pyexpat.py -@@ -1033,6 +1033,8 @@ def start_element(name, _): - - self.assertEqual(started, ['doc']) - -+ @unittest.skipIf(expat.version_info < (2, 7, 1), -+ f"Skip for expat < 2.7.1 (version available in RHEL 10)") - def test_reparse_deferral_disabled(self): - started = [] - -diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py -index 9b3014a94a..90401e0d8f 100644 ---- a/Lib/test/test_sax.py -+++ b/Lib/test/test_sax.py -@@ -1240,6 +1240,8 @@ def test_flush_reparse_deferral_enabled(self): - - self.assertEqual(result.getvalue(), start + b"") - -+ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), -+ f"Skip for expat < 2.7.1 (version available in RHEL 10)") - def test_flush_reparse_deferral_disabled(self): - result = BytesIO() - xmlgen = XMLGenerator(result) -diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py -index 4a76a5be1e..d740e30123 100644 ---- a/Lib/test/test_xml_etree.py -+++ b/Lib/test/test_xml_etree.py -@@ -1599,9 +1599,13 @@ def test_simple_xml(self, chunk_size=None, flush=False): - self.assert_event_tags(parser, [('end', 'root')]) - self.assertIsNone(parser.close()) - -+ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), -+ f"Skip for expat < 2.7.1 (version available in RHEL 10)") - def test_simple_xml_chunk_1(self): - self.test_simple_xml(chunk_size=1, flush=True) - -+ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), -+ f"Skip for expat < 2.7.1 (version available in RHEL 10)") - def test_simple_xml_chunk_5(self): - self.test_simple_xml(chunk_size=5, flush=True) - -@@ -1828,6 +1832,8 @@ def test_flush_reparse_deferral_enabled(self): - - self.assert_event_tags(parser, [('end', 'doc')]) - -+ @unittest.skipIf(pyexpat.version_info < (2, 7, 1), -+ f"Skip for expat < 2.7.1 (version available in RHEL 10)") - def test_flush_reparse_deferral_disabled(self): - parser = ET.XMLPullParser(events=('start', 'end')) - diff --git a/plan.fmf b/plan.fmf index 71d0124..9c9afb8 100644 --- a/plan.fmf +++ b/plan.fmf @@ -24,11 +24,10 @@ discover: test: "PYTHON=python${pybasever}d TOX=false VERSION=${pybasever} CYTHON=false ./venv.sh" - name: selftest path: /selftest - # test_subparser_inherits_reparse_deferral fails on EPEL9: https://github.com/python/cpython/issues/155485 - test: "VERSION=${pybasever} X='-i test_check_probes -i test_subparser_inherits_reparse_deferral' ./parallel.sh" + test: "VERSION=${pybasever} X='-i test_check_probes' ./parallel.sh" - name: debugtest path: /selftest - test: "VERSION=${pybasever} PYTHON=python${pybasever}d X='-i test_check_probes -i test_subparser_inherits_reparse_deferral' ./parallel.sh" + test: "VERSION=${pybasever} PYTHON=python${pybasever}d X='-i test_check_probes' ./parallel.sh" - name: optimizedflags path: /flags test: "python${pybasever} ./assertflags.py -O3 CFLAGS PY_BUILTIN_MODULE_CFLAGS PY_CFLAGS PY_CORE_CFLAGS PY_CFLAGS_NODIST PY_STDMODULE_CFLAGS" diff --git a/python3.13.spec b/python3.13.spec index 0879de7..4045e62 100644 --- a/python3.13.spec +++ b/python3.13.spec @@ -49,7 +49,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -254,7 +254,7 @@ Obsoletes: python%{pybasever}%{?1:-%{1}}\ BuildRequires: autoconf BuildRequires: bluez-libs-devel BuildRequires: bzip2-devel -BuildRequires: expat-devel +BuildRequires: expat-devel >= 2.5.0-2 BuildRequires: findutils BuildRequires: gcc BuildRequires: gdbm-devel @@ -370,14 +370,24 @@ Source11: idle3.appdata.xml # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00466 # e10760fb955ee33d2917f8a57bb4e24d71e5341c -# Downstream only: Skip tests not working with older expat version +# 00466 # 713a1368544eddd55088d67f88a23ce31722a4cb +# Downstream only: Lower XML_COMBINED_VERSION threshold for reparse deferral # -# We want to run these tests in Fedora and EPEL 10, but not in EPEL 9, -# which has too old version of expat. We set the upper bound version -# in the conditionalized skip to a release available in CentOS Stream 10, -# which is tested as working. -Patch466: 00466-downstream-only-skip-tests-not-working-with-older-expat-version.patch +# RHEL 9 expat 2.5.0 has XML_SetReparseDeferralEnabled backported +# via the CVE-2023-52425 fix, but XML_COMBINED_VERSION remains 20500. +# CPython's #if XML_COMBINED_VERSION >= 20600 guards compile the setter +# as a no-op, so SetReparseDeferralEnabled silently does nothing and +# GetReparseDeferralEnabled always returns False, even though the expat +# library actually supports (and enables) reparse deferral. +# +# Lower the threshold from 20600 to 20500 so that CPython uses the +# backported function. This makes the Python API actually work on RHEL 9 +# and fixes test failures (test_reparse_deferral_disabled, +# test_flush_reparse_deferral_disabled, test_simple_xml_chunk_*). +# +# The spec file BuildRequires expat-devel >= 2.5.0-2 to ensure the +# backported function is available. +Patch466: 00466-downstream-only-lower-xml_combined_version-threshold-for-reparse-deferral.patch # 00475 # d44fac01037662db286449a78c8fb819788f764c # CVE-2025-15367 @@ -598,10 +608,12 @@ Requires: tzdata # This breaks many things, including python -m venv. # We avoid this problem by requiring at least the same version of expat that # was used during the build time. +# We also include release, in case pyxpat uses ABI that was backported +# (e.g. XML_SetReparseDeferralEnabled was added in c9s expat 2.5.0-2). # Other subpackages (like -debug) also need this, but they all depend on -libs. # Since expat 2.7.4, the library has versioned symbols and this is no longer needed, # as the generated requirement will be in the form of libexpat.so.1(LIBEXPAT_2.7.2) etc. -%global expat_version %(LANG=C rpm -q --qf '%%{version}' expat.%{_target_cpu} | sed 's/.*not installed/0/') +%global expat_version %(LANG=C rpm -q --qf '%%{version}-%%{release}' expat.%{_target_cpu} | sed 's/.*not installed/0/') %if v"%{expat_version}" < v"2.7.4" Requires: expat%{?_isa} >= %{expat_version} %endif @@ -1359,7 +1371,6 @@ CheckPython() { # test.test_concurrent_futures.test_deadlock tends to time out on s390x and ppc64le in # freethreading{,-debug} build, skipping it to shorten the build time # see: https://github.com/python/cpython/issues/121719 - # test_subparser_inherits_reparse_deferral: https://github.com/python/cpython/issues/155485 LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \ -wW --slowest %{_smp_mflags} \ %ifarch riscv64 @@ -1376,9 +1387,6 @@ CheckPython() { -x test_signal \ -i test_deadlock \ %endif - %if 0%{?rhel} == 9 - -i test_subparser_inherits_reparse_deferral \ - %endif echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName @@ -1810,6 +1818,9 @@ CheckPython freethreading # ====================================================== %changelog +* Wed Aug 12 2026 Miro Hrončok - 3.13.15-2 +- On EPEL 9, also supports reparse deferral in expat + * Mon Aug 10 2026 Karolina Surma - 3.13.15-1 - Update to Python 3.13.15