]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

7 months agogh-131738: optimize builtin any/all/tuple calls with a generator expression arg ...
Irit Katriel [Fri, 28 Mar 2025 10:35:20 +0000 (10:35 +0000)] 
gh-131738: optimize builtin any/all/tuple calls with a generator expression arg (#131737)

7 months agogh-126835: Refine constant folding tests in `test_peepholer.py::TestTranforms` (...
Yan Yanchii [Fri, 28 Mar 2025 10:10:22 +0000 (11:10 +0100)] 
gh-126835: Refine constant folding tests in `test_peepholer.py::TestTranforms` (#131826)

7 months agogh-131818: Add imply `-P` in `-I`'s help message (#131819)
Hang [Fri, 28 Mar 2025 07:49:13 +0000 (15:49 +0800)] 
gh-131818: Add imply `-P` in `-I`'s help message (#131819)

7 months agogh-119180: Use equality when comparing against `annotationlib.Format` (#131755)
Victorien [Fri, 28 Mar 2025 04:56:09 +0000 (05:56 +0100)] 
gh-119180: Use equality when comparing against `annotationlib.Format` (#131755)

7 months agogh-128770: raise warnings as errors in test suite - except for test_socket which...
Thomas Grainger [Thu, 27 Mar 2025 19:06:52 +0000 (19:06 +0000)] 
gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings, and internal test warnings that are now logged (#128973)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agoGH-130415: Remove redundant sym_matches_type calls in the JIT optimizer (GH-131778)
Brandt Bucher [Thu, 27 Mar 2025 16:12:30 +0000 (09:12 -0700)] 
GH-130415: Remove redundant sym_matches_type calls in the JIT optimizer (GH-131778)

7 months agogh-128438: Use `EnvironmentVarGuard` for `datetimetester.py` to manage environment...
Wulian233 [Thu, 27 Mar 2025 16:07:09 +0000 (00:07 +0800)] 
gh-128438: Use `EnvironmentVarGuard` for `datetimetester.py` to manage environment varibales (#130002)

7 months agogh-131178: Add tests for `tokenize` command-line interface (#131274)
Semyon Moroz [Thu, 27 Mar 2025 16:04:16 +0000 (20:04 +0400)] 
gh-131178: Add tests for `tokenize` command-line interface (#131274)

7 months agogh-131525: Cache the result of tuple_hash (#131529)
Michael Droettboom [Thu, 27 Mar 2025 13:57:06 +0000 (09:57 -0400)] 
gh-131525: Cache the result of tuple_hash (#131529)

* gh-131525: Cache the result of tuple_hash

* Fix debug builds

* Add blurb

* Fix formatting

* Pre-compute empty tuple singleton

* Mostly set the cache within tuple_alloc

* Fixes for TSAN

* Pre-compute empty tuple singleton

* Fix for 32-bit platforms

* Assert that op != NULL in _PyTuple_RESET_HASH_CACHE

* Use FT_ATOMIC_STORE_SSIZE_RELAXED macro

* Update Include/internal/pycore_tuple.h

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Fix alignment

* atomic load

* Update Objects/tupleobject.c

Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
7 months agogh-118761: Always lazy import `re` in `locale` (#129860)
Semyon Moroz [Thu, 27 Mar 2025 13:47:08 +0000 (17:47 +0400)] 
gh-118761: Always lazy import `re` in `locale` (#129860)

7 months agogh-111178: Skip undefined behavior checks in _PyPegen_lookahead() (#131714)
Victor Stinner [Thu, 27 Mar 2025 09:03:58 +0000 (10:03 +0100)] 
gh-111178: Skip undefined behavior checks in _PyPegen_lookahead() (#131714)

For example, expression_rule() return type is 'expr_ty', whereas
_PyPegen_lookahead() uses 'void*'.

7 months agogh-131712: Build _suggestions extension on Windows (#131759)
Victor Stinner [Thu, 27 Mar 2025 08:53:39 +0000 (09:53 +0100)] 
gh-131712: Build _suggestions extension on Windows (#131759)

Add a test checking that the '_suggestions' extension is available.

7 months agoGH-131729: Consider in-memory state when merging storage and stack (GH-131773)
Mark Shannon [Thu, 27 Mar 2025 08:32:45 +0000 (08:32 +0000)] 
GH-131729: Consider in-memory state when merging storage and stack (GH-131773)

7 months agoRevise `pycore_stackref.h` comments. (#130601)
Neil Schemenauer [Thu, 27 Mar 2025 08:30:25 +0000 (01:30 -0700)] 
Revise `pycore_stackref.h` comments. (#130601)

7 months agogh-131782: Fix cast to match type of `bits` in `_Py_TryIncrefCompareStackRef` (#131783)
Neil Schemenauer [Thu, 27 Mar 2025 08:28:59 +0000 (01:28 -0700)] 
gh-131782: Fix cast to match type of `bits` in `_Py_TryIncrefCompareStackRef` (#131783)

7 months agogh-131763: Replace the redundant check with assert in remove_tools (#131765)
Sergey Muraviov [Wed, 26 Mar 2025 22:36:04 +0000 (01:36 +0300)] 
gh-131763: Replace the redundant check with assert in remove_tools (#131765)

7 months agogh-131236: allow to generate multiple UUIDs at once via CLI (#131218)
Simon Legner [Wed, 26 Mar 2025 20:49:28 +0000 (21:49 +0100)] 
gh-131236: allow to generate multiple UUIDs at once via CLI (#131218)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
7 months agoGH-119866: Don't clear frame->stackpointer on release builds (GH-131750)
Brandt Bucher [Wed, 26 Mar 2025 19:00:16 +0000 (12:00 -0700)] 
GH-119866: Don't clear frame->stackpointer on release builds (GH-131750)

7 months agogh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value...
rialbat [Wed, 26 Mar 2025 18:44:56 +0000 (21:44 +0300)] 
gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (#131764)

7 months agogh-131586: Avoid refcount contention in some "special" calls (#131588)
Sam Gross [Wed, 26 Mar 2025 18:38:47 +0000 (14:38 -0400)] 
gh-131586: Avoid refcount contention in some "special" calls (#131588)

In the free threaded build, the `_PyObject_LookupSpecial()` call can lead to
reference count contention on the returned function object becuase it
doesn't use stackrefs. Refactor some of the callers to use
`_PyObject_MaybeCallSpecialNoArgs`, which uses stackrefs internally.

This fixes the scaling bottleneck in the "lookup_special" microbenchmark
in `ftscalingbench.py`. However, the are still some uses of
`_PyObject_LookupSpecial()` that need to be addressed in future PRs.

7 months agogh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064)
Sam Gross [Wed, 26 Mar 2025 16:08:20 +0000 (12:08 -0400)] 
gh-123358: Use `_PyStackRef` in `LOAD_DEREF` (gh-130064)

Concurrent accesses from multiple threads to the same `cell` object did not
scale well in the free-threaded build. Use `_PyStackRef` and optimistically
avoid locking to improve scaling.

With the locks around cell reads gone, some of the free threading tests were
prone to starvation: the readers were able to run in a tight loop and the
writer threads weren't scheduled frequently enough to make timely progress.
Adjust the tests to avoid this.

Co-authored-by: Donghee Na <donghee.na@python.org>
7 months agoGH-131729: Code-gen better liveness analysis (GH-131732)
Mark Shannon [Wed, 26 Mar 2025 15:21:35 +0000 (15:21 +0000)] 
GH-131729: Code-gen better liveness analysis (GH-131732)

* 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 analysis to optimizer generated code

* Fix RETURN_VALUE in optimizer

7 months agogh-131741: Add documentation for Windows version detection change in `platform` ...
Idan Noiman [Wed, 26 Mar 2025 14:50:37 +0000 (16:50 +0200)] 
gh-131741: Add documentation for Windows version detection change in `platform` (#131742)

Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wulian <1055917385@qq.com>
7 months agogh-131649: fix test_string_literals SyntaxWarning (#131650)
Thomas Grainger [Wed, 26 Mar 2025 14:01:18 +0000 (14:01 +0000)] 
gh-131649: fix test_string_literals SyntaxWarning (#131650)

7 months agogh-117657: Fix data race in `compare_unicode_unicode_threadsafe` (gh-131746)
Sam Gross [Wed, 26 Mar 2025 13:01:57 +0000 (09:01 -0400)] 
gh-117657: Fix data race in `compare_unicode_unicode_threadsafe` (gh-131746)

We can't safely check the type of the found key until we incref it or if we know that it's immortal.

7 months agodocument that `sys._is_gil_enabled` is CPython-specific (#131748)
Ralf Gommers [Wed, 26 Mar 2025 12:02:52 +0000 (13:02 +0100)] 
document that `sys._is_gil_enabled` is CPython-specific (#131748)

7 months agogh-130881: Handle conditionally defined annotations (#130935)
Jelle Zijlstra [Wed, 26 Mar 2025 03:48:19 +0000 (20:48 -0700)] 
gh-130881: Handle conditionally defined annotations (#130935)

7 months agogh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (gh-131744)
Donghee Na [Wed, 26 Mar 2025 00:45:29 +0000 (09:45 +0900)] 
gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (gh-131744)

7 months agoGH-130673: Gracefully handle missing sections in JIT build (GH-130906)
Bojun Ren [Tue, 25 Mar 2025 23:35:39 +0000 (07:35 +0800)] 
GH-130673: Gracefully handle missing sections in JIT build (GH-130906)

7 months agoGH-131691: Fix exception handling setting for clang-cl on Windows (GH-131730)
Chris Eibl [Tue, 25 Mar 2025 23:07:52 +0000 (00:07 +0100)] 
GH-131691: Fix exception handling setting for clang-cl on Windows (GH-131730)

The /EHa option for Clang-CL behaves differently than the same option for MSVC, which is why we don't use it for both compilers.

7 months agogh-129900: Fix `SystemExit` return codes when the REPL is started from the command...
Peter Bierma [Tue, 25 Mar 2025 19:48:46 +0000 (15:48 -0400)] 
gh-129900: Fix `SystemExit` return codes when the REPL is started from the command line (#129901)

7 months agogh-131647: fix 'sys.path_hooks is empty' warning in test_importlib (#131648)
Thomas Grainger [Tue, 25 Mar 2025 17:16:15 +0000 (17:16 +0000)] 
gh-131647: fix 'sys.path_hooks is empty' warning in test_importlib (#131648)

7 months agoGH-130887: Always remove trailing jumps in AArch64 JIT stencils (GH-131042)
Diego Russo [Tue, 25 Mar 2025 17:15:36 +0000 (17:15 +0000)] 
GH-130887: Always remove trailing jumps in AArch64 JIT stencils (GH-131042)

7 months agogh-131719: add NULL pointer check to `_PyMem_FreeDelayed` (gh-131720)
Tomasz Pytel [Tue, 25 Mar 2025 14:49:18 +0000 (10:49 -0400)] 
gh-131719: add NULL pointer check to `_PyMem_FreeDelayed` (gh-131720)

7 months agogh-131711: Preventing the use of a null pointer in set_tp_mro (#131713)
Sergey Muraviov [Tue, 25 Mar 2025 13:28:38 +0000 (16:28 +0300)] 
gh-131711: Preventing the use of a null pointer in set_tp_mro (#131713)

7 months agogh-127945: fix thread safety of ctypes state (#131710)
Kumar Aditya [Tue, 25 Mar 2025 11:33:05 +0000 (17:03 +0530)] 
gh-127945: fix thread safety of ctypes state (#131710)

This fixes thread safety of `array_cache` and `swapped_suffix` by initializing them in module exec to make it thread safety.

7 months agogh-127945: add locking to malloc closure in free-threading (#131662)
Kumar Aditya [Tue, 25 Mar 2025 11:18:46 +0000 (16:48 +0530)] 
gh-127945: add locking to malloc closure in free-threading (#131662)

The freelist is not thread safe in free-threading so this adds lock around it make it thread safe in free-threading.

7 months agogh-131707: fix unawaited coroutine warning in test_coroutines.Corouti… (#131708)
Thomas Grainger [Tue, 25 Mar 2025 08:29:51 +0000 (08:29 +0000)] 
gh-131707: fix unawaited coroutine warning in test_coroutines.Corouti… (#131708)

gh-131707: fix unawaited coroutine warning in test_coroutines.CoroutineTest.test_17

7 months agogh-128446: Run Windows CI tests on each commit (#131702)
Adam Turner [Tue, 25 Mar 2025 07:06:15 +0000 (07:06 +0000)] 
gh-128446: Run Windows CI tests on each commit (#131702)

7 months agogh-131666: mark `anext_awaitable.close` as a `METH_NOARGS` instead of `METH_VARARGS...
Bénédikt Tran [Tue, 25 Mar 2025 03:33:22 +0000 (04:33 +0100)] 
gh-131666: mark `anext_awaitable.close` as a `METH_NOARGS` instead of `METH_VARARGS` (#131671)