]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
7 months agogh-131015: Add test for bytes formatting errors (#131881)
Ageev Maxim [Sat, 5 Apr 2025 08:30:16 +0000 (11:30 +0300)] 
gh-131015: Add test for bytes formatting errors (#131881)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131912: Improve description of grouping options in the format specification docs...
Prometheus3375 [Sat, 5 Apr 2025 08:28:50 +0000 (11:28 +0300)] 
gh-131912: Improve description of grouping options in the format specification docs (#132030)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-129463, gh-128593: Simplify ForwardRef (#129465)
Jelle Zijlstra [Sat, 5 Apr 2025 04:36:34 +0000 (21:36 -0700)] 
gh-129463, gh-128593: Simplify ForwardRef (#129465)

7 months agogh-109599: Expose `CapsuleType` via the `_types` module (#131969)
Adam Turner [Fri, 4 Apr 2025 22:37:41 +0000 (23:37 +0100)] 
gh-109599: Expose `CapsuleType` via the `_types` module (#131969)

7 months agogh-131933: Document UnionType/Union merger in What's New (#131941)
Jelle Zijlstra [Fri, 4 Apr 2025 18:15:31 +0000 (11:15 -0700)] 
gh-131933: Document UnionType/Union merger in What's New (#131941)

Co-authored-by: Alex Waygood
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agoFix typo in `template_replace()` test helper docstring (#132094)
Victorien [Fri, 4 Apr 2025 17:38:09 +0000 (19:38 +0200)] 
Fix typo in `template_replace()` test helper docstring (#132094)

7 months agogh-100239: fix bug in comparison (#132093)
Irit Katriel [Fri, 4 Apr 2025 17:09:49 +0000 (18:09 +0100)] 
gh-100239: fix bug in comparison (#132093)

7 months agogh-99108: Implement HACL* HMAC (#130157)
Bénédikt Tran [Fri, 4 Apr 2025 17:04:00 +0000 (19:04 +0200)] 
gh-99108: Implement HACL* HMAC (#130157)

A new extension module, `_hmac`, now exposes the HACL* HMAC (formally verified) implementation.

The HACL* implementation is used as a fallback implementation when the OpenSSL implementation of HMAC
is not available or disabled. For now, only named hash algorithms are recognized and SIMD support provided
by HACL* for the BLAKE2 hash functions is not yet used.

7 months agoGH-131498: Cases generator: manage stacks automatically (GH-132074)
Mark Shannon [Fri, 4 Apr 2025 16:59:36 +0000 (17:59 +0100)] 
GH-131498: Cases generator: manage stacks automatically (GH-132074)

7 months agogh-118761: Lazily import annotationlib in typing (#132060)
Jelle Zijlstra [Fri, 4 Apr 2025 15:57:10 +0000 (08:57 -0700)] 
gh-118761: Lazily import annotationlib in typing (#132060)

annotationlib is used quite a few times in typing.py, but I think the
usages are just rare enough that this makes sense.

The import would get triggered by:
- Using get_type_hints(), evaluate_forward_ref(), and similar introspection
  functions
- Using a string annotation anywhere that goes through _type_convert (e.g.,
  "Final['x']" will trigger an annotationlib import in order to access the
  ForwardRef class).
- Creating a TypedDict or NamedTuple (unless it's empty or PEP 563 is on).

Lots of programs will want to use typing without any of these, so the tradeoff
seems worth it.

7 months agogh-131938: Update exception message for `Element.remove()` when an element is not...
Bénédikt Tran [Fri, 4 Apr 2025 15:04:07 +0000 (17:04 +0200)] 
gh-131938: Update exception message for `Element.remove()` when an element is not found (#131972)

The exception message for `xml.etree.ElementTree.Element.remove` when an element is not found
has been updated from "list.remove(x): x not in list" to "Element.remove(x): element not found".

7 months agogh-100239: more refined specialisation stats for BINARY_OP/SUBSCR (#132068)
Irit Katriel [Fri, 4 Apr 2025 14:33:31 +0000 (15:33 +0100)] 
gh-100239: more refined specialisation stats for BINARY_OP/SUBSCR (#132068)

7 months agogh-130115: fix thread identifiers for 32-bit musl (#130391)
Vincent Fazio [Fri, 4 Apr 2025 14:31:37 +0000 (09:31 -0500)] 
gh-130115: fix thread identifiers for 32-bit musl (#130391)

CPython's pthread-based thread identifier relies on pthread_t being able
to be represented as an unsigned integer type.

This is true in most Linux libc implementations where it's defined as an
unsigned long, however musl typedefs it as a struct *.

If the pointer has the high bit set and is cast to PyThread_ident_t, the
resultant value can be sign-extended [0]. This can cause issues when
comparing against threading._MainThread's identifier. The main thread's
identifier value is retrieved via _get_main_thread_ident which is backed
by an unsigned long which truncates sign extended bits.

  >>> hex(threading.main_thread().ident)
  '0xb6f33f3c'
  >>> hex(threading.current_thread().ident)
  '0xffffffffb6f33f3c'

Work around this by conditionally compiling in some code for non-glibc
based Linux platforms that are at risk of sign-extension to return a
PyLong based on the main thread's unsigned long thread identifier if the
current thread is the main thread.

[0]: https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Arrays-and-pointers-implementation.html

---------

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
7 months agogh-132075: Fix possible use of sockaddr structures with uninitialized members (GH...
Serhiy Storchaka [Fri, 4 Apr 2025 14:09:58 +0000 (17:09 +0300)] 
gh-132075: Fix possible use of sockaddr structures with uninitialized members (GH-132076)

Now all structure members are initialized with zeroes by default.

7 months agogh-118761: Defer import of functools in annotationlib (#132059)
Jelle Zijlstra [Fri, 4 Apr 2025 13:42:22 +0000 (06:42 -0700)] 
gh-118761: Defer import of functools in annotationlib (#132059)

7 months agogh-130655: Add a test for corrupt `.mo` files in `gettext` (#131911)
Tomas R. [Fri, 4 Apr 2025 13:26:59 +0000 (15:26 +0200)] 
gh-130655: Add a test for corrupt `.mo` files in `gettext` (#131911)

7 months agogh-130655: Add a test for bad magic numbers in `.mo` files parsed by `gettext` (...
Tomas R. [Fri, 4 Apr 2025 13:26:15 +0000 (15:26 +0200)] 
gh-130655: Add a test for bad magic numbers in `.mo` files parsed by `gettext` (#131909)

7 months agogh-128632: fix segfault on nested __classdict__ type param (#128744)
Tomasz Pytel [Fri, 4 Apr 2025 13:23:35 +0000 (09:23 -0400)] 
gh-128632: fix segfault on nested __classdict__ type param (#128744)

7 months agogh-105499: Defer "import warnings" in typing (#132061)
Jelle Zijlstra [Fri, 4 Apr 2025 13:19:42 +0000 (06:19 -0700)] 
gh-105499: Defer "import warnings" in typing (#132061)

A bunch of other warnings in typing.py were already deferred, but
I added a few non-lazy ones.

7 months agoGH-131288: Use `_AddressOfReturnAddress` for MSVC in pycore_ceval.h (gh-131289)
Chris Eibl [Fri, 4 Apr 2025 13:03:12 +0000 (15:03 +0200)] 
GH-131288: Use `_AddressOfReturnAddress` for MSVC in pycore_ceval.h (gh-131289)

Use `_AddressOfReturnAddress` in `_Py_get_machine_stack_pointer` to silence MSVC warning in pycore_ceval.h for release builds.

7 months agogh-125434: Display thread name in faulthandler (#132016)
Victor Stinner [Fri, 4 Apr 2025 12:24:41 +0000 (14:24 +0200)] 
gh-125434: Display thread name in faulthandler (#132016)

7 months agoAdd tests for Bluetooth RFCOMM, HCI and SCO (GH-132023)
Serhiy Storchaka [Fri, 4 Apr 2025 11:33:09 +0000 (14:33 +0300)] 
Add tests for Bluetooth RFCOMM, HCI and SCO (GH-132023)

7 months agoGH-131770: increase assumed WASI stack size to 131072 (wasi-sdk default) (#131844)
Filipe Laíns 🇵🇸 [Fri, 4 Apr 2025 08:34:02 +0000 (09:34 +0100)] 
GH-131770: increase assumed WASI stack size to 131072 (wasi-sdk default) (#131844)

https://github.com/WebAssembly/wasi-libc/blob/e9524a0980b9bb6bb92e87a41ed1055bdda5bb86/libc-top-half/musl/src/internal/pthread_impl.h#L220

Signed-off-by: Filipe Laíns <lains@riseup.net>
7 months agoEnable Windows on Arm GitHub runners (#131994)
Diego Russo [Thu, 3 Apr 2025 20:32:29 +0000 (21:32 +0100)] 
Enable Windows on Arm GitHub runners (#131994)

7 months agogh-132038: Make perf version check in test_perf_profiler more robust (#132039)
Itamar Oren [Thu, 3 Apr 2025 17:37:08 +0000 (10:37 -0700)] 
gh-132038: Make perf version check in test_perf_profiler more robust (#132039)

Should work also if the version string includes a commit hash, like `perf version 6.12.9.g242e6068fd5c`

7 months agogh-128661: Remove DeprecationWarning in evaluate_forward_ref (#128930)
Jelle Zijlstra [Thu, 3 Apr 2025 16:52:17 +0000 (09:52 -0700)] 
gh-128661: Remove DeprecationWarning in evaluate_forward_ref (#128930)

It doesn't make sense to use a deprecation for evaluate_forward_ref,
as it is a new function in Python 3.14 and doesn't have compatibility
guarantees.

I considered making it throw an error if type_params it not passed and
there is no owner. However, I think this is too unfriendly for users. The
case where this param is really needed is fairly esoteric and I don't think
this case is worth the pain of forcing users to write "type_params=()".

7 months agogh-131423: Update OpenSSL build tag to 3.0.16.2 to fix ARM64 crash (GH-132051)
Steve Dower [Thu, 3 Apr 2025 16:35:21 +0000 (17:35 +0100)] 
gh-131423: Update OpenSSL build tag to 3.0.16.2 to fix ARM64 crash (GH-132051)

7 months agogh-131591: Implement PEP 768 (#131937)
Pablo Galindo Salgado [Thu, 3 Apr 2025 15:20:01 +0000 (16:20 +0100)] 
gh-131591: Implement PEP 768 (#131937)

Co-authored-by: Ivona Stojanovic <stojanovic.i@hotmail.com>
Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
7 months agoGH-131904: Fix Py_STACKREF_DEBUG build (GH-132022)
Mark Shannon [Thu, 3 Apr 2025 08:40:37 +0000 (09:40 +0100)] 
GH-131904: Fix Py_STACKREF_DEBUG build (GH-132022)

7 months agoRemove deferred ``typing`` import in ``annotationlib`` (#132034)
Adam Turner [Thu, 3 Apr 2025 03:30:31 +0000 (04:30 +0100)] 
Remove deferred ``typing`` import in ``annotationlib`` (#132034)

7 months agogh-60115: Support frozen modules for linecache.getline() (#131638)
Tian Gao [Wed, 2 Apr 2025 23:50:01 +0000 (19:50 -0400)] 
gh-60115: Support frozen modules for linecache.getline() (#131638)

7 months agogh-118761: Fix star-import of ast (#132025)
Jelle Zijlstra [Wed, 2 Apr 2025 18:15:05 +0000 (11:15 -0700)] 
gh-118761: Fix star-import of ast (#132025)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agogh-111178: Skip test_perf_profiler on function sanitizer (#132020)
Victor Stinner [Wed, 2 Apr 2025 16:46:10 +0000 (18:46 +0200)] 
gh-111178: Skip test_perf_profiler on function sanitizer (#132020)

Add 'function' parameter to check_sanitizer() of test.support.

7 months agogh-118761: Optimise import time for ast (#131953)
Adam Turner [Wed, 2 Apr 2025 16:22:15 +0000 (17:22 +0100)] 
gh-118761: Optimise import time for ast (#131953)

7 months agoGH-131498: Cases generator: Parse down to C statement level. (GH-131948)
Mark Shannon [Wed, 2 Apr 2025 15:31:59 +0000 (16:31 +0100)] 
GH-131498: Cases generator: Parse down to C statement level. (GH-131948)

* Parse down to statement level in the cases generator

* Add handling for #if macros, treating them much like normal ifs.

7 months agogh-131974: Fix usages of `locked_deref` in `ctypes` (#131975)
Peter Bierma [Wed, 2 Apr 2025 15:04:25 +0000 (11:04 -0400)] 
gh-131974: Fix usages of `locked_deref` in `ctypes` (#131975)

7 months agogh-131544: Update docs for PyType_AddWatcher (gh-132015)
Donghee Na [Wed, 2 Apr 2025 15:04:07 +0000 (00:04 +0900)] 
gh-131544: Update docs for PyType_AddWatcher (gh-132015)

7 months agogh-59705: Fix solaris detection in test_threading.test_set_name() (#132012)
Jakub Kulík [Wed, 2 Apr 2025 14:34:43 +0000 (16:34 +0200)] 
gh-59705: Fix solaris detection in test_threading.test_set_name() (#132012)

7 months agogh-132013: use relaxed atomics in hash of frozenset (#132014)
Kumar Aditya [Wed, 2 Apr 2025 14:31:05 +0000 (20:01 +0530)] 
gh-132013: use relaxed atomics in hash of frozenset (#132014)

Use relaxed atomics in hash of `frozenset` to fix TSAN warning.

7 months agogh-131888: fix ResourceWarning in test_ftplib (#131889)
Thomas Grainger [Wed, 2 Apr 2025 12:30:19 +0000 (13:30 +0100)] 
gh-131888: fix ResourceWarning in test_ftplib (#131889)

7 months agogh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (#132003)
sobolevn [Wed, 2 Apr 2025 11:48:47 +0000 (14:48 +0300)] 
gh-132002: Fix crash of `ContextVar` on unhashable `str` subtype (#132003)

7 months agogh-130197: pygettext: Test the --escape option (GH-131902)
Tomas R. [Wed, 2 Apr 2025 08:46:54 +0000 (10:46 +0200)] 
gh-130197: pygettext: Test the --escape option (GH-131902)

7 months agoGH-128055: fix test_sysconfigdata_json outside the builddir (#128070)
Filipe Laíns 🇵🇸 [Wed, 2 Apr 2025 05:44:43 +0000 (06:44 +0100)] 
GH-128055: fix test_sysconfigdata_json outside the builddir (#128070)

7 months agoGH-131726: Split up _CHECK_VALIDITY_AND_SET_IP (GH-131810)
Brandt Bucher [Tue, 1 Apr 2025 23:55:05 +0000 (16:55 -0700)] 
GH-131726: Split up _CHECK_VALIDITY_AND_SET_IP (GH-131810)

7 months agoGH-131798: Allow the JIT to remove more int/float/str guards (GH-131800)
Brandt Bucher [Tue, 1 Apr 2025 22:10:15 +0000 (15:10 -0700)] 
GH-131798: Allow the JIT to remove more int/float/str guards (GH-131800)

7 months agogh-131987: Bump the magic number (#131991)
mpage [Tue, 1 Apr 2025 21:53:49 +0000 (14:53 -0700)] 
gh-131987: Bump the magic number (#131991)

This should have been done as part of 053c285 but got blown away
in a merge.

7 months agogh-131831: Implement PEP 758 – Allow except and except* expressions without parenthes...
Pablo Galindo Salgado [Tue, 1 Apr 2025 19:04:56 +0000 (20:04 +0100)] 
gh-131831: Implement PEP 758 – Allow except and except* expressions without parentheses (#131833)

7 months agogh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)
mpage [Tue, 1 Apr 2025 17:18:42 +0000 (10:18 -0700)] 
gh-130704: Strength reduce `LOAD_FAST{_LOAD_FAST}` (#130708)

Optimize `LOAD_FAST` opcodes into faster versions that load borrowed references onto the operand stack when we can prove that the lifetime of the local outlives the lifetime of the temporary that is loaded onto the stack.

7 months agoGH-131296: Disable MSVC-specific optimization in sre.c when compiling with clang...
Chris Eibl [Tue, 1 Apr 2025 16:29:45 +0000 (18:29 +0200)] 
GH-131296: Disable MSVC-specific optimization in sre.c when compiling with clang-cl (GH-131593)

7 months agogh-111178: remove redundant casts for functions with correct signatures (#131673)
Bénédikt Tran [Tue, 1 Apr 2025 15:18:11 +0000 (17:18 +0200)] 
gh-111178: remove redundant casts for functions with correct signatures (#131673)

7 months agogh-111178: Fix getsockaddrarg() undefined behavior (#131668)
Victor Stinner [Tue, 1 Apr 2025 13:54:27 +0000 (15:54 +0200)] 
gh-111178: Fix getsockaddrarg() undefined behavior (#131668)

Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.

On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.

7 months agogh-131736: only apply `security_level` workaround in `test_ssl` for security levels... 131559/head
Will Childs-Klein [Tue, 1 Apr 2025 07:58:47 +0000 (03:58 -0400)] 
gh-131736: only apply `security_level` workaround in `test_ssl` for security levels greater than 1 (#131739)

7 months agoMinor improvements to the programming FAQ (#127261)
Rafael Fontenelle [Tue, 1 Apr 2025 07:19:06 +0000 (04:19 -0300)] 
Minor improvements to the programming FAQ (#127261)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months agogh-121249: Note struct module changes in What's New (#131867)
Sergey B Kirpichev [Tue, 1 Apr 2025 07:16:36 +0000 (10:16 +0300)] 
gh-121249: Note struct module changes in What's New (#131867)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
7 months ago gh-125957: sync argument naming in sphinx docs of the cmath and help() (#125958)
Sergey B Kirpichev [Tue, 1 Apr 2025 07:16:11 +0000 (10:16 +0300)] 
 gh-125957: sync argument naming in sphinx docs of the cmath and help() (#125958)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131531: Add `android.py package` command (#131532)
Malcolm Smith [Tue, 1 Apr 2025 00:46:29 +0000 (01:46 +0100)] 
gh-131531: Add `android.py package` command (#131532)

Adds a `package` entry point to the `android.py` build script to support
creating an Android distribution artefact.

7 months agogh-129917: Update installers to use SQLite 3.49.1 (#131025)
Erlend E. Aasland [Mon, 31 Mar 2025 21:13:17 +0000 (23:13 +0200)] 
gh-129917: Update installers to use SQLite 3.49.1 (#131025)

Co-authored-by: Ned Deily <nad@python.org>
7 months agoGH-131296: Add missing UNREACHABLE mark in thread_nt.h (GH-131589)
Chris Eibl [Mon, 31 Mar 2025 19:28:35 +0000 (21:28 +0200)] 
GH-131296: Add missing UNREACHABLE mark in thread_nt.h (GH-131589)

7 months agogh-131675: Fix `mi_atomic_yield` in mimalloc on 32-bit ARM (gh-131784)
Vincent Fazio [Mon, 31 Mar 2025 18:29:12 +0000 (13:29 -0500)] 
gh-131675: Fix `mi_atomic_yield` in mimalloc on 32-bit ARM (gh-131784)

Use the standard `__ARM_ARCH` macro, which is supported by GCC and Clang.

The branching logic for of `__ARMEL__` has been removed so if the target
architecture supports v7+ instructions, a yield is emitted, otherwise a nop
is emitted. This covers both big and little endian scenarios.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
7 months agogh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (#131866)
stratakis [Mon, 31 Mar 2025 17:53:49 +0000 (19:53 +0200)] 
gh-131865: Properly apply exported CFLAGS for dtrace/systemtap builds (#131866)

When using --with-dtrace the resulting object file could be missing
specific CFLAGS exported by the build system due to the systemtap
script using specific defaults.

Exporting the CC and CFLAGS variables before the dtrace invocation
allows us to properly apply CFLAGS exported by the build system
even when cross-compiling.

The fix does not affect the dtrace invocation on Solaris/macOS.

7 months agogh-107369: Optimise ``textwrap.indent()`` (#131923)
Adam Turner [Mon, 31 Mar 2025 17:31:39 +0000 (18:31 +0100)] 
gh-107369: Optimise ``textwrap.indent()`` (#131923)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131936: Strengthen check in `_suggestions._generate_suggestions` (#131945)
Peter Bierma [Mon, 31 Mar 2025 17:30:29 +0000 (13:30 -0400)] 
gh-131936: Strengthen check in `_suggestions._generate_suggestions` (#131945)

7 months agogh-105499: typing: Remove an unused function (#131946)
Jelle Zijlstra [Mon, 31 Mar 2025 17:27:03 +0000 (10:27 -0700)] 
gh-105499: typing: Remove an unused function (#131946)

Leftover from #105511 I believe. GitHub code search found no usages other
than copies of typing.py and lists of stdlib functions.

7 months agoGH-131296: Fix incompatible pointer type warning in _winapi.c (GH-131600)
Chris Eibl [Mon, 31 Mar 2025 16:33:55 +0000 (18:33 +0200)] 
GH-131296: Fix incompatible pointer type warning in _winapi.c (GH-131600)

7 months agoGH-131296: Fix clang-cl warnings on Windows in sqlite3 (GH-131906)
Chris Eibl [Mon, 31 Mar 2025 15:15:31 +0000 (17:15 +0200)] 
GH-131296: Fix clang-cl warnings on Windows in sqlite3 (GH-131906)

7 months agoGH-131296: Fix parenthesis warnings on Windows-specific code (GH-131905)
Chris Eibl [Mon, 31 Mar 2025 14:54:30 +0000 (16:54 +0200)] 
GH-131296: Fix parenthesis warnings on Windows-specific code (GH-131905)

7 months agoGH-131296: Fix clang-cl warning on Windows in liblzma (GH-131897)
Chris Eibl [Mon, 31 Mar 2025 14:50:44 +0000 (16:50 +0200)] 
GH-131296: Fix clang-cl warning on Windows in liblzma (GH-131897)

Also removes warnings suppression for MSVC that no longer need to be suppressed.

7 months agoFix PEP number in `ast_opt.c` for new `finally` check (#131928)
sobolevn [Mon, 31 Mar 2025 13:29:23 +0000 (16:29 +0300)] 
Fix PEP number in `ast_opt.c` for new `finally` check (#131928)

7 months agogh-131525: Remove `_HashedSeq` wrapper from `lru_cache` (gh-131922)
Lukas Geiger [Mon, 31 Mar 2025 13:23:41 +0000 (14:23 +0100)] 
gh-131525: Remove `_HashedSeq` wrapper from `lru_cache` (gh-131922)

7 months agoGH-131498: Another refactoring of the code generator (GH-131827)
Mark Shannon [Mon, 31 Mar 2025 12:52:48 +0000 (13:52 +0100)] 
GH-131498: Another refactoring of the code generator (GH-131827)

* Rename 'defined' attribute to 'in_local' to more accurately reflect how it is used

* Make death of variables explicit even for array variables.

* Convert in_memory from boolean to stack offset

* Don't apply liveness analyis to optimizer generated code

* Add 'out' parameter to stack.pop

7 months agogh-130843: expose 48-bit timestamp for UUIDv7 (#131838)
Bénédikt Tran [Mon, 31 Mar 2025 12:32:54 +0000 (14:32 +0200)] 
gh-130843: expose 48-bit timestamp for UUIDv7 (#131838)

7 months agogh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` when concurrent mutation...
Bénédikt Tran [Mon, 31 Mar 2025 10:31:26 +0000 (12:31 +0200)] 
gh-126033: fix UAF in `xml.etree.ElementTree.Element.remove` when concurrent mutations happen (#126124)

7 months agogh-126037: fix UAF in `xml.etree.ElementTree.Element.find*` when concurrent mutation...
Bénédikt Tran [Mon, 31 Mar 2025 10:26:52 +0000 (12:26 +0200)] 
gh-126037:  fix UAF in `xml.etree.ElementTree.Element.find*` when concurrent mutations happen (#127964)

We fix a use-after-free in the `find`, `findtext` and `findall` methods of `xml.etree.ElementTree.Element`
objects that can be triggered when the tag to find implements an `__eq__` method that mutates the
element being queried.

7 months agogh-130167: Optimise ``textwrap.dedent()`` (#131919)
Adam Turner [Mon, 31 Mar 2025 00:35:12 +0000 (01:35 +0100)] 
gh-130167: Optimise ``textwrap.dedent()`` (#131919)

Co-authored-by: Marius Juston <marius.juston@hotmail.fr>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agoGH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)
Amit Lavon [Sun, 30 Mar 2025 23:07:25 +0000 (16:07 -0700)] 
GH-131798: Remove type checks for _TO_BOOL_STR (GH-131816)

7 months agogh-131895: fix clang `$PATH` on Darwin runners for tail-calling interpreter (#131903)
Bénédikt Tran [Sun, 30 Mar 2025 18:48:00 +0000 (20:48 +0200)] 
gh-131895: fix clang `$PATH` on Darwin runners for tail-calling interpreter (#131903)

7 months agoUpdate cryptographic CODEOWNERS entry (#131892)
Bénédikt Tran [Sun, 30 Mar 2025 17:55:05 +0000 (19:55 +0200)] 
Update cryptographic CODEOWNERS entry (#131892)

update cryptographic CODEOWNERS entry

7 months agogh-127794: Validate email header names according to RFC 5322 (#127820)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Sun, 30 Mar 2025 12:29:29 +0000 (17:59 +0530)] 
gh-127794: Validate email header names according to RFC 5322 (#127820)

`email.message.Message` objects now validate header names specified via `__setitem__`
or `add_header` according to RFC 5322, §2.2 [1].

In particular, callers should expect a ValueError to be raised for invalid header names.

[1]: https://datatracker.ietf.org/doc/html/rfc5322#section-2.2

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
7 months agogh-131178: Update help message for `timeit` CLI (#131326)
Semyon Moroz [Sun, 30 Mar 2025 11:19:38 +0000 (15:19 +0400)] 
gh-131178: Update help message for `timeit` CLI (#131326)

7 months agogh-127945: mark `TestLocalization` as thread unsafe in ctypes (#131899)
Kumar Aditya [Sun, 30 Mar 2025 11:08:42 +0000 (16:38 +0530)] 
gh-127945: mark `TestLocalization` as thread unsafe in ctypes (#131899)

7 months agogh-127945: acquire critical section around `PyCFuncPtr_call` (#131898)
Kumar Aditya [Sun, 30 Mar 2025 11:01:12 +0000 (16:31 +0530)] 
gh-127945: acquire critical section around `PyCFuncPtr_call` (#131898)

7 months agogh-127945: make initialization of `error_object_name` thread safe in ctypes (#131896)
Kumar Aditya [Sun, 30 Mar 2025 10:50:35 +0000 (16:20 +0530)] 
gh-127945: make initialization of `error_object_name` thread safe in ctypes (#131896)

7 months agogh-127945: fix thread safety of creating instances of ctypes structures (#131716)
Kumar Aditya [Sun, 30 Mar 2025 09:52:30 +0000 (15:22 +0530)] 
gh-127945: fix thread safety of creating instances of ctypes structures (#131716)

7 months agogh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments...
Adam Dangoor [Sun, 30 Mar 2025 09:22:57 +0000 (10:22 +0100)] 
gh-131885: Document that `dict.setdefault` and `dict.get` take no keyword arguments (#128208)

7 months agogh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (#129996)
Alexander Ershov [Sun, 30 Mar 2025 08:19:36 +0000 (15:19 +0700)] 
gh-129994: update docs when using `dualstack_ipv6` in `socket.create_server` (#129996)

7 months agoGH-129149: Add fast path for medium-sized integers in `PyLong_From*` functions (...
Chris Eibl [Sun, 30 Mar 2025 08:12:42 +0000 (10:12 +0200)] 
GH-129149: Add fast path for medium-sized integers in `PyLong_From*` functions (#131211)

Add a fast path for medium-sized integers in `PyLong_FromInt{32,64}` and `PyLong_FromUInt{32,64}`.

7 months agogh-130924: Do not create cells for usages of names in local annotations (#131843)
Jelle Zijlstra [Sat, 29 Mar 2025 21:15:48 +0000 (14:15 -0700)] 
gh-130924: Do not create cells for usages of names in local annotations (#131843)

7 months agogh-131853: Fix test_msgfmt on big-endian platforms (GH-131879)
Serhiy Storchaka [Sat, 29 Mar 2025 17:14:37 +0000 (19:14 +0200)] 
gh-131853: Fix test_msgfmt on big-endian platforms (GH-131879)

Use a generated .mo file instead of a checked in one.

7 months agogh-131853: Test binary header in msgfmt generated file (GH-131854)
Stan Ulbrych [Sat, 29 Mar 2025 12:27:50 +0000 (12:27 +0000)] 
gh-131853: Test binary header in msgfmt generated file (GH-131854)

7 months agogh-131050: skip `test_dh_params` when TLS library lacks FFDHE ciphersuites (#131051)
Will Childs-Klein [Sat, 29 Mar 2025 10:31:48 +0000 (06:31 -0400)] 
gh-131050: skip `test_dh_params` when TLS library lacks FFDHE ciphersuites (#131051)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-127541: Update os.walk example (GH-127765)
Totosuki [Sat, 29 Mar 2025 06:25:13 +0000 (15:25 +0900)] 
gh-127541: Update os.walk example (GH-127765)

Update os.walk example to be more modern, skip `__pycache__` dirs rather than `CVS` dirs.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agogh-131740: minor readability fix in PyUnstable_GC_VisitObjects (gh-131786)
Martin DeMello [Fri, 28 Mar 2025 23:58:17 +0000 (16:58 -0700)] 
gh-131740: minor readability fix in PyUnstable_GC_VisitObjects (gh-131786)

Minor readability fix in PyUnstable_GC_VisitObjects

Replaces `if (visit_generation())` with `if (visit_generation() < 0)`,
since we are checking for the failure case, and it's confusing to have
that be implicitly `true`.

Also fixes a misspelt variable name.

7 months agogh-130373: Avoid locking in _LOAD_ATTR_WITH_HINT (#130372)
Dino Viehland [Fri, 28 Mar 2025 22:16:41 +0000 (15:16 -0700)] 
gh-130373: Avoid locking in _LOAD_ATTR_WITH_HINT (#130372)

Avoid locking in _LOAD_ATTR_WITH_HINT

7 months agodocs: -I also implies -P (#131539)
Ned Batchelder [Fri, 28 Mar 2025 18:59:03 +0000 (12:59 -0600)] 
docs: -I also implies -P (#131539)

7 months agogh-131423: Update to OpenSSL 3.0.16. (GH-131839)
Steve Dower [Fri, 28 Mar 2025 15:07:57 +0000 (15:07 +0000)] 
gh-131423: Update to OpenSSL 3.0.16. (GH-131839)

The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804.
This PR also prevents making calls that are now unsafe without uplink, and updates
the tests to property interpret these failures as unsupported.

7 months agoGH-131678: fix Windows tail-call CI does not run the test cases (GH-131690)
Chris Eibl [Fri, 28 Mar 2025 15:00:36 +0000 (16:00 +0100)] 
GH-131678: fix Windows tail-call CI does not run the test cases (GH-131690)

7 months agogh-131807: fix ResourceWarning in test_ucn.py (#131808)
Thomas Grainger [Fri, 28 Mar 2025 14:55:40 +0000 (14:55 +0000)] 
gh-131807: fix ResourceWarning in test_ucn.py (#131808)

Co-authored-by: Victor Stinner <vstinner@python.org>
7 months agoUse `assert*` comparison methods in `test_timer_comparison` (#129513)
alexey semenyuk [Fri, 28 Mar 2025 14:25:13 +0000 (19:25 +0500)] 
Use `assert*` comparison methods in `test_timer_comparison` (#129513)

7 months agogh-117174: Adapt `test_multiple_statements_fail_early` to new REPL behavior (follow...
Bartosz Sławecki [Fri, 28 Mar 2025 14:09:31 +0000 (15:09 +0100)] 
gh-117174: Adapt `test_multiple_statements_fail_early` to new REPL behavior (follow-up gh-131065) (#131836)

Adapt test to new REPL behavior (follow-up gh-117174)

7 months agogh-128002: run all asyncio tests with tsan CI (#131797)
Kumar Aditya [Fri, 28 Mar 2025 14:00:36 +0000 (19:30 +0530)] 
gh-128002: run all asyncio tests with tsan CI (#131797)