Commit graph

130207 commits

Author SHA1 Message Date
Zachary Ware
7359bb8dac
gh-144551: Update OpenSSL version references in Mac/BuildScript/ (GH-144810) 2026-02-13 16:50:15 -06:00
Zachary Ware
543f56fe8d
gh-144551: Update Windows builds to use OpenSSL 3.5.5 (GH-144796) 2026-02-13 15:43:05 -06:00
Rafael Weingartner-Ortner
629a363ddd
gh-136672: Docs: Move parts of Enum HOWTO to API Docs (GH-139176)
To avoid duplicate content in the Enum HOWTO and
API documentation which is not automatically synced,
the section about supported __dunder__ and _sunder
names is moved from HOWTO to API docs.

See also https://github.com/python/cpython/pull/136791
2026-02-13 11:51:56 -08:00
Zachary Ware
b933ef9261
gh-144551: Update CI to use latest OpenSSL versions (GH-144794)
Also update _ssl_data_36.h to include an added symbol from 3.6.1.
2026-02-13 13:06:07 -06:00
Zachary Ware
928602c0ac
gh-144551: Update Windows builds to use OpenSSL 3.0.19 (GH-144793) 2026-02-13 18:48:52 +00:00
Colin McAllister
d625f7da33
gh-144787: [tests] Allow TLS v1.2 to be minimum version (GH-144790)
Allow TLS v1.2 to be minimum version

Updates test_min_max_version to allow TLS v1.2 to be minimum version if
TLS 1.0 and 1.1 are disabled in OpenSSL.
2026-02-13 17:17:53 +00:00
Priyanshu Singh
82b92e3cd1
gh-143637: Fix re-entrant mutation of ancillary data in socket.sendmsg() (#143892)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-02-13 16:35:08 +01:00
Robsdedude
945bf8ce1b
gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736) 2026-02-12 18:15:23 -05:00
Seth Michael Larson
66da7bf6fe
gh-143916: Allow HTAB in wsgiref header values
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-12 20:40:21 +00:00
Victor Stinner
b488f338cf
gh-135906: Test more internal headers in test_cext/test_cppext (#144751) 2026-02-12 19:40:42 +01:00
James
e66f4a5a9c
gh-80667: Fix case-sensitivity of some Unicode literal escapes (GH-107281)
Lookup for CJK ideograms and Hangul syllables is now case-insensitive,
as is the case for other character names.
2026-02-12 18:50:40 +02:00
Victor Stinner
9e5e1f9988
gh-121617: Include <string.h> for Py_CLEAR() macro (#144666)
Python.h now also includes <string.h> in the limited C API version 3.11
and newer to fix the Py_CLEAR() macro which uses memcpy().

Add a Py_CLEAR() test in test_cext.

Modify also _Py_TYPEOF to use C23 typeof() if available.
2026-02-12 17:03:55 +01:00
Victor Stinner
eb6ebdbc95
gh-138744: Upgrade Windows to 2025 in GitHub Actions (#144682)
Replace windows-2022 with windows-2025.
2026-02-12 16:19:50 +01:00
Bartosz Sławecki
b6b72e7663
gh-144285: Improve AttributeError attribute suggestions (#144299) 2026-02-12 14:12:49 +00:00
Pablo Galindo Salgado
072cd7c336
gh-142349: Fix refcount corruption in lazy import specialization (#144733)
Remove spurious Py_DECREF on borrowed ref in LOAD_GLOBAL specialization

_PyDict_LookupIndexAndValue() returns a borrowed reference via
_Py_dict_lookup(), but specialize_load_global_lock_held() called
Py_DECREF(value) on it when bailing out for lazy imports. Each time
the adaptive counter fired while a lazy import was still in globals,
this stole one reference from the dict's object. With 8+ threads
racing through LOAD_GLOBAL during concurrent lazy import resolution,
enough triggers accumulated to drive the refcount to zero while the
dict and other threads still referenced the object, causing
use-after-free.
2026-02-12 11:45:28 +00:00
Stan Ulbrych
2e3e76e5cd
gh-57095: Add note about input splitting in datetime.*.strptime (GH-131049)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-12 11:35:42 +01:00
Stan Ulbrych
51a408ed77
Add missing step to Modules/expat/refresh.sh instructions (GH-144719) 2026-02-12 09:55:26 +01:00
Pablo Galindo Salgado
7854597d88
gh-142349: Fix build errors from PEP 810 (#144726) 2026-02-12 08:18:36 +00:00
Adorilson Bezerra
f912c835b9
gh-106318: Fix incorrectly rendered code block in str.isalnum() docs (GH-144718) 2026-02-12 08:40:17 +01:00
Pablo Galindo Salgado
46d5106cfa
gh-142349: Implement PEP 810 - Explicit lazy imports (#142351)
Co-authored-by: T. Wouters <twouters@meta.com >
Co-authored-by: Brittany Reynoso <breynoso@meta.com>
Co-authored-by: Dino Viehland <dinoviehland@meta.com>
2026-02-12 00:15:33 +00:00
Roman Volosatovs
cac0c98450
gh-144675: update to WASI SDK 30 (#144676)
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-02-11 16:12:08 -08:00
William Meehan
3e0322ff16
gh-84424: Use numeric_changed for UCD.numeric (GH-19457)
This was causing ucd_3_2_0.numeric() to pick up only decimal
changes between Unicode 3.2.0 and the current version.
2026-02-11 20:58:24 +00:00
Victor Stinner
c6e418d174
gh-141563: Enable test_cppext internal C API tests on macOS (#144711)
Build the C API in C++11 mode on macOS.
2026-02-11 18:38:23 +01:00
Ronald Eddy Jr
3718f4be60
Fix typos and grammar errors across documentation (#144709) 2026-02-11 16:35:25 +00:00
Hugo van Kemenade
cf23fcd5f7 Merge branch 'main' of https://github.com/python/cpython 2026-02-11 17:34:44 +02:00
Hugo van Kemenade
7cfeb8c756 Post 3.15.0a6 2026-02-11 17:33:36 +02:00
Kumar Aditya
347d3594d3
gh-143300: implement PyUnstable_SetImmortal for marking objects as immortal (#144543) 2026-02-11 20:59:31 +05:30
Hugo van Kemenade
81484c5629
gh-144639: Ruff: target Python 3.14 syntax in Lib/test (#144656)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2026-02-11 14:12:31 +00:00
Lysandros Nikolaou
35dc547ab5
gh-142518: Document thread-safety guarantees of dict operations (#144184)
* Address feedback; move thread safety section below see-also
* Address feedback - don't mention equality comparison only
* Change admonition to rubric; cross-reference glossary

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-11 14:33:00 +01:00
Ned Batchelder
37430cac94
Docs: remove links of modules to themselves (#144695) 2026-02-11 07:56:36 -05:00
Lysandros Nikolaou
12dbae4c02
gh-142518: Define lock-free and per-object lock (#144548)
- Add definitions of lock-free and per-object lock to the glossary
- Cross-reference these from list thread safety notes
- Change admonition to rubric
2026-02-11 13:55:36 +01:00
bkap123
17ab556e39
gh-144321: Fix named tuple bug when input is a non-sequence iterable (#144600) 2026-02-11 12:44:22 +00:00
Hugo van Kemenade
15b216f30d Python 3.15.0a6 2026-02-11 14:23:15 +02:00
Adorilson Bezerra
936d60dbe1
gh-106318: Improve str.rstrip() method doc (#143893)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-11 09:41:37 +01:00
Joshua Root
d5f96c8665
gh-140421: Disable perf trampoline on older macOS (#144647)
Trampoline requires clock_gettime() which was added in macOS 10.12.
2026-02-10 23:27:16 -05:00
László Kiss Kollár
d18dbd5e1c
gh-138122: Add sampling profiler visualisation to docs (#142772)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2026-02-10 23:09:07 +00:00
Dov Murik
87c9789b9a
docs: profiling.sampling: Fix sampling-rate default value description typo (#144686) 2026-02-10 21:55:40 +00:00
Victor Stinner
b67a64d7e2
gh-141563: Fix test_cppext on macOS (#144685)
Don't test internal header files including mimalloc on macOS since
mimalloc emits compiler warnings:

  In file included from extension.cpp:21:
  In file included from Include/internal/pycore_backoff.h:15:
  In file included from Include/internal/pycore_interp_structs.h:15:
  In file included from Include/internal/pycore_tstate.h:14:
  In file included from Include/internal/pycore_mimalloc.h:43:
  Include/internal/mimalloc/mimalloc.h:464:85: error: defaulted
  function definitions are a C++11 extension
  [-Werror,-Wc++11-extensions]
    mi_stl_allocator() mi_attr_noexcept = default;
                                                                                      ^
  Include/internal/mimalloc/mimalloc.h:465:85: error: defaulted
  function definitions are a C++11 extension
  [-Werror,-Wc++11-extensions]
    mi_stl_allocator(const mi_stl_allocator&) mi_attr_noexcept = default;

Log also CXX and CXXFLAGS env vars in test_cppext. Log also CPPFLAGS
in test_cext.
2026-02-10 20:31:12 +01:00
Victor Stinner
eb6d0e0b2b
gh-141563: Fix test_cext on Windows (#144677)
The 'module' argument is now always needed to call the test_datetime
method.
2026-02-10 17:27:44 +00:00
Hugo van Kemenade
b4a620d2d7
gh-133879: Copyedit "What's new in Python 3.15" (#144661)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-10 18:49:20 +02:00
Victor Stinner
23d45f0c24
gh-141563: Don't test datetime.h with the limited C API (#144673)
Fix test_cext and test_cppext.
2026-02-10 15:45:24 +00:00
Victor Stinner
3dadc22a27
gh-141563: Add missing cast to _PyDateTime_IMPORT() (#144667)
Fix compilation on C++.

Add test on PyDateTime_IMPORT in test_cext and test_cppext.
2026-02-10 14:47:12 +00:00
Nybblista
cc81707e40
gh-144629: Add test for the PyFunction_GetAnnotations() function (#144630) 2026-02-10 14:38:24 +00:00
Sacul
6c8ca1c378
gh-134584: Optimize _BINARY_OP_SUBSCR_LIST_SLICE (GH-144659) 2026-02-10 22:33:32 +08:00
Aarni Koskela
40a82abe93 Clarify the docs for args in asyncio callbacks (#143873)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-02-10 13:10:01 +00:00
Gregory P. Smith
ac8b5b6890
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>
2026-02-10 14:08:33 +01:00
Victor Stinner
b121dc4347
gh-144652: Support Windows exit status in support get_signal_name() (#144653)
Format Windows exit status as hexadecimal.
2026-02-10 12:15:14 +01:00
Alper
73fa6be2fe
gh-144490: Fix mimalloc debug build for C++ (#144620) 2026-02-10 11:56:52 +01:00
kovan
9b8d59c136
gh-72798: Add mapping example to str.translate documentation (#144454)
Add an example showing how to use str.translate() with a dictionary
mapping directly, demonstrating character replacement and deletion.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:13:40 +01:00
Pablo Galindo Salgado
2c1ca6bb5b
gh-144563: Fix remote debugging with duplicate libpython mappings from ctypes (#144595)
When _ctypes is imported, it may call dlopen on the libpython shared
library, causing the dynamic linker to load a second mapping of the
library into the process address space. The remote debugging code
iterates memory regions from low addresses upward and returns the first
mapping whose filename matches libpython. After _ctypes is imported, it
finds the dlopen'd copy first, but that copy's PyRuntime section was
never initialized, so reading debug offsets from it fails.

Fix this by validating each candidate PyRuntime address before accepting
it. The validation reads the first 8 bytes and checks for the "xdebugpy"
cookie that is only present in an initialized PyRuntime. Uninitialized
duplicate mappings will fail this check and be skipped, allowing the
search to continue to the real, initialized PyRuntime.
2026-02-10 10:04:50 +00:00