Update to Python 3.14.0a3

selftest and debugtest in tests/tests.yml exclude test_sysconfigdata_json
for now, reported upstream as:
https://github.com/python/cpython/issues/128055
This commit is contained in:
Karolina Surma 2024-12-17 19:27:38 +01:00
commit 31971f96ff
5 changed files with 26 additions and 83 deletions

View file

@ -30,10 +30,10 @@ Co-authored-by: Lumír Balhar <frenzy.madness@gmail.com>
3 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/Lib/site.py b/Lib/site.py
index 54f07ab5b4..69ceaa443e 100644
index 92bd1ccdad..951784f3b4 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -414,8 +414,15 @@ def getsitepackages(prefixes=None):
@@ -420,8 +420,15 @@ def getsitepackages(prefixes=None):
return sitepackages
def addsitepackages(known_paths, prefixes=None):
@ -51,7 +51,7 @@ index 54f07ab5b4..69ceaa443e 100644
if os.path.isdir(sitedir):
addsitedir(sitedir, known_paths)
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index 67a071963d..0aa8313d6b 100644
index ed7b6a335d..2b1ee37775 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -106,6 +106,12 @@
@ -130,10 +130,10 @@ index 67a071963d..0aa8313d6b 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 9bbf8d0c6c..609bf5c373 100644
index ce504dc21a..054e514130 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -130,8 +130,19 @@ def test_get_path(self):
@@ -138,8 +138,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 9bbf8d0c6c..609bf5c373 100644
os.path.normpath(expected),
)
@@ -386,7 +397,7 @@ def test_get_config_h_filename(self):
@@ -394,7 +405,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 9bbf8d0c6c..609bf5c373 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
@@ -406,6 +417,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))

View file

@ -1,60 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "J. Nick Koston" <nick@koston.org>
Date: Thu, 5 Dec 2024 22:33:03 -0600
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: Kumar Aditya <kumaraditya@python.org>
---
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`.

View file

@ -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
@ -351,14 +351,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.,
@ -1247,8 +1239,8 @@ 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_ctypes.test_generated_structs.GeneratedTest.test_generated_data is skipped since
# 3.14.0a1, see: https://github.com/python/cpython/issues/121938
# test_*_repeat_respect_immortality and test_immortals failures were reported:
# https://github.com/python/cpython/issues/128058
LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
-wW --slowest %{_smp_mflags} \
%ifarch riscv64
@ -1266,7 +1258,9 @@ CheckPython() {
-i test_deadlock \
%endif
%ifarch %{ix86}
-i test_generated_data \
-i test_tuple_repeat_respect_immortality \
-i test_list_repeat_respect_immortality \
-i test_immortals \
%endif
echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
@ -1375,6 +1369,8 @@ CheckPython freethreading
%pure_python_modules %{pylibdir}
%{pylibdir}/_sysconfig_vars_%{ABIFLAGS_optimized}_linux_%{platform_triplet}.json
# This will be in the tkinter package
%exclude %{pylibdir}/turtle.py
%exclude %{pylibdir}/__pycache__/turtle*%{bytecode_suffixes}
@ -1600,6 +1596,7 @@ CheckPython freethreading
%{pylibdir}/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}.py
%{pylibdir}/__pycache__/_sysconfigdata_%{ABIFLAGS_debug}_linux_%{platform_triplet}%{bytecode_suffixes}
%{pylibdir}/_sysconfig_vars_%{ABIFLAGS_debug}_linux_%{platform_triplet}.json
%endif # with debug_build
@ -1621,6 +1618,8 @@ CheckPython freethreading
%{pylibdir_freethreading}/tkinter/
%{pylibdir_freethreading}/turtledemo/
%{pylibdir_freethreading}/_sysconfig_vars_%{ABIFLAGS_freethreading}_linux_%{platform_triplet}.json
# This will be in the -freethreading-debug package
%if %{with debug_build}
%exclude %{pylibdir_freethreading}/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}.py
@ -1672,6 +1671,7 @@ CheckPython freethreading
%{pylibdir_freethreading}/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}.py
%{pylibdir_freethreading}/__pycache__/_sysconfigdata_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}%{bytecode_suffixes}
%{pylibdir_freethreading}/_sysconfig_vars_%{ABIFLAGS_freethreading_debug}_linux_%{platform_triplet}.json
%endif # with freethreading_build && debug_build
@ -1696,6 +1696,9 @@ CheckPython freethreading
# ======================================================
%changelog
* Tue Dec 17 2024 Karolina Surma <ksurma@redhat.com> - 3.14.0~a3-1
- Update to Python 3.14.0a3
* Sun Dec 08 2024 Charalampos Stratakis <cstratak@redhat.com> - 3.14.0~a2-2
- Security fix for CVE-2024-12254
- Fixes: rhbz#2330928

View file

@ -1 +1 @@
SHA512 (Python-3.14.0a2.tar.xz) = face78a7ef5d1a14b7e8c478125c660fe9745e793a5443932684c8426f0023324236c67ad73198e4286ba8793628452ae4d4d6332f007c009b285ba83ca1fc48
SHA512 (Python-3.14.0a3.tar.xz) = e26c9736f00af680b5f1ff1ba0f06562c48550836088d79dd8b4c97016d52f9f76979de32fa8556e9d750a5dad488643e897807ab6cb0c1424882151fe5f3337

View file

@ -30,10 +30,10 @@
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"
run: "VERSION={{ pybasever }} X='-i test_check_probes -i test_sysconfigdata_json' ./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_sysconfigdata_json' ./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"