gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736)
(cherry picked from commit 945bf8ce1b)
Co-authored-by: Robsdedude <dev@rouvenbauer.de>
Lookup for CJK ideograms and Hangul syllables is now case-insensitive,
as is the case for other character names.
(cherry picked from commit e66f4a5a9c)
Co-authored-by: James <snoopjedi@gmail.com>
This was causing ucd_3_2_0.numeric() to pick up only decimal
changes between Unicode 3.2.0 and the current version.
(cherry picked from commit 3e0322ff16)
Co-authored-by: William Meehan <wmeehan@fb.com>
gh-143650: Fix importlib race condition on import failure (GH-143651)
Fix a race condition where a thread could receive a partially-initialized
module when another thread's import fails. The race occurs when:
1. Thread 1 starts importing, adds module to sys.modules
2. Thread 2 sees the module in sys.modules via the fast path
3. Thread 1's import fails, removes module from sys.modules
4. Thread 2 returns a stale module reference not in sys.modules
The fix adds verification after the "skip lock" optimization in both Python
and C code paths to check if the module is still in sys.modules. If the
module was removed (due to import failure), we retry the import so the
caller receives the actual exception from the import failure rather than
a stale module reference.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
cherry picked from ac8b5b6890
[3.14] gh-138744: Skip test_dtrace on Windows (GH-144657)
(cherry picked from commit 8b4210c30e)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Ken Jin <kenjin@python.org>
(cherry picked from commit d5cb9f6a9b)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
- generate_sbom.py: Exclude the refresh script from SBOM
- Modules/expat/refresh.sh: Expand the list of manual steps
(cherry picked from commit 51d309988b)
For `enum.bin`, update versionadded directive from 3.10 to 3.11 (GH-144574)
(cherry picked from commit d73634935c)
Co-authored-by: Guo Ci <zguoci@gmail.com>
gh-143700: document `secrets.DEFAULT_ENTROPY` as an opaque value (GH-144568)
(cherry picked from commit 934997218e)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-142044: Add note to prefer `asyncio.timeout[_at]` over `asyncio.Timeout` (GH-144449)
(cherry picked from commit 0e7c06a858)
Co-authored-by: kovan <xaum.io@gmail.com>
[3.14] gh-144330: Initialize classmethod and staticmethod in new (GH-144498)
gh-144330: Initialize classmethod and staticmethod in new
Initialize cm_callable and sm_callable to None in classmethod and
staticmethod constructor.
(cherry picked from commit 160810de89)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Aniket Singh Yadav <singhyadavaniket43@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
(cherry picked from commit 2fb9cde118)
Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
(cherry picked from commit 67ddba9aa9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-127313: Use getLogger() without argument to get root logger in logging cookbook (GH-143683)
Use getLogger() to get root logger in logging cookbook
(cherry picked from commit 53fecbe6e1)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Run a long living subprocess which handles multiple requests instead of
running a new subprocess for each request.
(cherry picked from commit 29acc08c8d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Modifies handling of `.gz` files in Android app payloads, and ensures that
when the Android testbed streams logs, stream flushes aren't treated as
newlines. This improves the output of test suites that use "one dot per test"
progress indicators.
(cherry picked from commit cb1dc91dcb)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
gh-142555: Fix null pointer dereference in array.__setitem__ via re-entrant __index__ (GH-142713)
(cherry picked from commit 39f16a93ef)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Fix and simplify a test of `test_repr_rlock` about multiprocessing.RLock primitive.
(cherry picked from commit a98a6bd112)
Co-authored-by: Duprat <yduprat@gmail.com>
The emulator images for API level 34 and 35 have significant issues with image size and
internet connectivity. Reverts the default API level used for testbed testing to 33.
(cherry picked from commit 6543720b63)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
gh-144194: Fix mmap failure check in perf_jit_trampoline.c (#143713)
mmap() returns MAP_FAILED ((void*)-1) on error, not NULL. The current
check never detects mmap failures, so jitdump initialization proceeds
even when the memory mapping fails.
(cherry picked from commit 8fe8a94a7c)
Co-authored-by: stratakis <cstratak@redhat.com>
gh-144100: Fix crash for POINTER(str) used in ctypes argtypes (#144108)
(cherry picked from commit 8f459255eb)
Co-authored-by: VanshAgarwal24036 <148854295+VanshAgarwal24036@users.noreply.github.com>
gh-126014: test_makefile_test_folders: Ignore basically-empty directories (GH-140466)
The code in test_makefile was attempting to ignore any
non-interesting files, but missed some corners:
1. There is never a *file* called `__pycache__`.
2. A directory containing only a `__pycache__` subdirectory should be
ignored.
3. A directory containing only hidden files should be ignored.
Simplify this all into a couple of filters that let us check for empty
lists.
(cherry picked from commit 17d447e993)
Co-authored-by: Stefano Rivera <stefano@rivera.za.net>