(cherry picked from commit 81268a3e2a)
Co-authored-by: Wulian233 <1055917385@qq.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
A runtime check is needed to support cross-compiling.
Remove the _Py_NORMALIZE_CENTURY macro.
Remove _pydatetime.py's _can_support_c99.
(cherry picked from commit 719e5c3f71)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-136823: Update documentation on excluded headers in Python.h (GH-136824)
(cherry picked from commit c2428ca9ea)
Co-authored-by: Sina Zel taat <111974143+SZeltaat@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
gh-136516: Mention installation artifacts as de-facto resources (GH-136419)
Files like NUL on windows are, from `importlib.resources` point of
view, an artifact caused by installing to a filesystem directory.
Mention these.
(cherry picked from commit fac4964fdb)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-139698: Fix typo in What's New 3.14 (GH-139699)
(cherry picked from commit d396a32b3d)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
There were a few thread-safety issues when profiling or tracing all
threads via PyEval_SetProfileAllThreads or PyEval_SetTraceAllThreads:
* The loop over thread states could crash if a thread exits concurrently
(in both the free threading and default build)
* The modification of `c_profilefunc` and `c_tracefunc` wasn't
thread-safe on the free threading build.
(cherry picked from commit a10152f8fd)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-126662: naming consistency for `signal.ItimerError` (GH-126712)
(cherry picked from commit d5fa437dfb)
Co-authored-by: Stephen Morton <git@tungol.org>
gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (GH-137415)
Fix name of the Python encoding in Unicode errors of the code page
codec: use "cp65000" and "cp65001" instead of "CP_UTF7" and "CP_UTF8"
which are not valid Python code names.
(cherry picked from commit ce1b747ff6)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-71810: Fix _PyLong_AsByteArray() undefined behavior (GH-138873)
Don't read p[-1] when p is an empty string: when n==0.
(cherry picked from commit 8b5ce31c2b)
Co-authored-by: Victor Stinner <vstinner@python.org>
Kill the REPL subprocess once it prints the output from the command
immediately before the `time.sleep()`.
(cherry picked from commit 98d462cf4d)
Co-authored-by: Sam Gross <colesbury@gmail.com>
gh-135329: Use longer timeout in pyrepl test_repl_eio() (GH-139503)
Replace hardcoded 5 seconds with support.SHORT_TIMEOUT.
Fix the following error on slow CI such as GitHub Action UBSan:
test test_pyrepl failed -- Traceback (most recent call last):
File "Lib/test/test_pyrepl/test_unix_console.py", line 362, in test_repl_eio
_, err = proc.communicate(timeout=5) # sleep for pty to settle
~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "Lib/subprocess.py", line 1219, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "Lib/subprocess.py", line 2126, in _communicate
self._check_timeout(endtime, orig_timeout, stdout, stderr)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Lib/subprocess.py", line 1266, in _check_timeout
raise TimeoutExpired(
...<2 lines>...
stderr=b''.join(stderr_seq) if stderr_seq else None)
subprocess.TimeoutExpired: Command '[...]' timed out after 5 seconds
(cherry picked from commit c985822d86)
Co-authored-by: Victor Stinner <vstinner@python.org>
Replacing the slot isn't thread-safe if the GIL is disabled. Don't
require that the slot has been replaced when specializing.
(cherry picked from commit 485b16b4f7)
gh-139516: Fix lambda colon start format spec in f-string in tokenizer (GH-139657)
(cherry picked from commit 539461d9ec)
Co-authored-by: Tomasz Pytel <tompytel@gmail.com>
gh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon thread support (GH-134606)
This reapplies GH-128640.
(cherry picked from commit a64881363b)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-112729: Correctly fail when the process is out of memory during interpreter creation (GH-139164)
(cherry picked from commit d06113c7a7)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-138756: Fix leak of inittab memory in PyInitConfig_Free() (GH-138792)
(cherry picked from commit 3d521a62e7)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-138756: Fix memory leak in PyInitConfig_Free() (GH-138759)
Clear also memory of PyConfig members.
(cherry picked from commit 96dee64c73)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-139573: Update macOS installer to use OpenSSL 3.0.18 (GH-139575)
(cherry picked from commit 23410f0a9e)
Co-authored-by: Zachary Ware <zach@python.org>
gh-139310: skip `test_aead_aes_gcm` for Linux kernel between 6.16.0 and 6.17.x (GH-139552)
Currently, Fedora 42 uses a custom Linux Kernel 6.16.9 that backported an upstream change
from 6.17-rc7 [1,3] but not its subsequent fix [2]. Until the issue is resolved upstream,
we skip the failing test `test_socket.test_aead_aes_gcm` for kernel versions between 6.16
and 6.17.x.
[1] 1b34cbbf4f
[2] d0ca0df179.
[3] 45bcf60fe4
(cherry picked from commit 41712c4e09)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-139573: Update OpenSSL version used in iOS builds (GH-139582)
Update OpenSSL version used in iOS builds.
(cherry picked from commit 20758f9bb1)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
gh-139573: Update Windows builds to use OpenSSL 3.0.18 (GH-139574)
(cherry picked from commit 063cef9999)
Co-authored-by: Zachary Ware <zach@python.org>