]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
18 months agoTest syntax error on comma-less tuple-style sequence patterns (#115485)
da-woods [Wed, 1 May 2024 08:33:28 +0000 (09:33 +0100)] 
Test syntax error on comma-less tuple-style sequence patterns (#115485)

Adds a test that length-1 tuple-style sequence patterns must end in a comma, since there isn't currently one.

Spotted while reviewing Cython's proposed implementation of the pattern matching syntax (https://github.com/cython/cython/pull/4897#discussion_r1489177169) where there was a bug my the reimplementation that wasn't caught against the CPython tests here.

18 months agoGH-117881: fix athrow().throw()/asend().throw() concurrent access (GH-117882)
Thomas Grainger [Wed, 1 May 2024 06:44:01 +0000 (07:44 +0100)] 
GH-117881: fix athrow().throw()/asend().throw() concurrent access (GH-117882)

18 months agogh-116622: Add Android testbed (GH-117878)
Malcolm Smith [Wed, 1 May 2024 06:36:45 +0000 (07:36 +0100)] 
gh-116622: Add Android testbed (GH-117878)

Add code and config for a minimal Android app, and instructions to build and run it.
Improve Android build instructions in general.
Add a tool subcommand to download the Gradle wrapper (with its binary blob). Android
studio must be downloaded manually (due to the license).

18 months agogh-118201: Accomodate flaky behavior of `os.sysconf` on iOS (GH-118453)
Russell Keith-Magee [Wed, 1 May 2024 02:31:00 +0000 (10:31 +0800)] 
gh-118201: Accomodate flaky behavior of `os.sysconf` on iOS (GH-118453)

18 months agogh-118335: Configure Tier 2 interpreter at build time (#118339)
Guido van Rossum [Wed, 1 May 2024 01:26:34 +0000 (18:26 -0700)] 
gh-118335: Configure Tier 2 interpreter at build time (#118339)

The code for Tier 2 is now only compiled when configured
with `--enable-experimental-jit[=yes|interpreter]`.

We drop support for `PYTHON_UOPS` and -`Xuops`,
but you can disable the interpreter or JIT
at runtime by setting `PYTHON_JIT=0`.
You can also build it without enabling it by default
using `--enable-experimental-jit=yes-off`;
enable with `PYTHON_JIT=1`.

On Windows, the `build.bat` script supports
`--experimental-jit`, `--experimental-jit-off`,
`--experimental-interpreter`.

In the C code, `_Py_JIT` is defined as before
when the JIT is enabled; the new variable
`_Py_TIER2` is defined when the JIT *or* the
interpreter is enabled. It is actually a bitmask:
1: JIT; 2: default-off; 4: interpreter.

18 months agogh-118201 - Disable the flaky POSIX test_confstr test on iOS (GH-118452)
Russell Keith-Magee [Tue, 30 Apr 2024 23:32:37 +0000 (07:32 +0800)] 
gh-118201 - Disable the flaky POSIX test_confstr test on iOS (GH-118452)

18 months agogh-117657: Don't specialize RESUME_CHECK when specialization is disabled (GH-118349)
Ken Jin [Tue, 30 Apr 2024 21:51:59 +0000 (05:51 +0800)] 
gh-117657: Don't specialize RESUME_CHECK when specialization is disabled (GH-118349)

18 months agogh-117139: Add header for tagged pointers (GH-118330)
Ken Jin [Tue, 30 Apr 2024 20:46:13 +0000 (04:46 +0800)] 
gh-117139: Add header for tagged pointers (GH-118330)

---------

Co-authored-by: Sam Gross <655866+colesbury@users.noreply.github.com>
18 months agogh-118422: Fix run_fileexflags() test (#118429)
Victor Stinner [Tue, 30 Apr 2024 20:32:55 +0000 (22:32 +0200)] 
gh-118422: Fix run_fileexflags() test (#118429)

Don't test the undefined behavior of fileno()
on a closed file, but use fstat() as a reliable
test if the file was closed or not.

18 months agogh-118124: Use static_assert() in Py_BUILD_ASSERT() on C11 (#118398)
Victor Stinner [Tue, 30 Apr 2024 20:29:48 +0000 (22:29 +0200)] 
gh-118124: Use static_assert() in Py_BUILD_ASSERT() on C11 (#118398)

Use static_assert() in Py_BUILD_ASSERT() and Py_BUILD_ASSERT_EXPR()
on C11 and newer and C++11 and newer.

Add tests to test_cext and test_cppext.

18 months agogh-118218: Reuse return tuple in itertools.pairwise (GH-118219)
Shantanu [Tue, 30 Apr 2024 20:16:52 +0000 (13:16 -0700)] 
gh-118218: Reuse return tuple in itertools.pairwise (GH-118219)

18 months agogh-118406: Add signature for sqlite3.Connection objects (#118428)
Erlend E. Aasland [Tue, 30 Apr 2024 19:58:22 +0000 (21:58 +0200)] 
gh-118406: Add signature for sqlite3.Connection objects (#118428)

18 months ago[gh-117657] Fix some issues with TSAN in typeobject (#118249)
Dino Viehland [Tue, 30 Apr 2024 19:37:38 +0000 (12:37 -0700)] 
[gh-117657] Fix some issues with TSAN in typeobject (#118249)

Fix some racing reads in typebobject.c

18 months agogh-118332: Fix deadlock involving stop the world (#118412)
Sam Gross [Tue, 30 Apr 2024 19:01:28 +0000 (15:01 -0400)] 
gh-118332: Fix deadlock involving stop the world (#118412)

Avoid detaching thread state when stopping the world. When re-attaching
the thread state, the thread would attempt to resume the top-most
critical section, which might now be held by a thread paused for our
stop-the-world request.

18 months agogh-117657: Fix small issues with instrumentation and TSAN (#118064)
Dino Viehland [Tue, 30 Apr 2024 18:38:05 +0000 (11:38 -0700)] 
gh-117657: Fix small issues with instrumentation and TSAN (#118064)

Small TSAN fixups for instrumentation

18 months agogh-118272: Clear generator frame's locals when the generator is closed (#118277)
Irit Katriel [Tue, 30 Apr 2024 18:32:25 +0000 (19:32 +0100)] 
gh-118272: Clear generator frame's locals when the generator is closed (#118277)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
18 months agogh-109975: Document crypt_r as a possible replacement of crypt (#118439)
Miro Hrončok [Tue, 30 Apr 2024 18:25:25 +0000 (20:25 +0200)] 
gh-109975: Document crypt_r as a possible replacement of crypt (#118439)

18 months agogh-117618: Make package.module searchable for breakpoints and clean up docs (#117619)
Tian Gao [Tue, 30 Apr 2024 18:18:01 +0000 (11:18 -0700)] 
gh-117618: Make package.module searchable for breakpoints and clean up docs (#117619)

18 months agogh-118418: Use a default value for `type_params` in `typing._eval_type` (#118431)
Nikita Sobolev [Tue, 30 Apr 2024 15:44:37 +0000 (18:44 +0300)] 
gh-118418: Use a default value for `type_params` in `typing._eval_type` (#118431)

18 months agogh-116122: Add SBOM generation to PCbuild/build.bat (GH-116138)
Seth Michael Larson [Tue, 30 Apr 2024 15:05:05 +0000 (10:05 -0500)] 
gh-116122: Add SBOM generation to PCbuild/build.bat (GH-116138)

18 months agogh-118379: Use PyTuple_Pack instead of Py_BuildValue if possible (GH-118381)
Nice Zombies [Tue, 30 Apr 2024 14:55:15 +0000 (16:55 +0200)] 
gh-118379: Use PyTuple_Pack instead of Py_BuildValue if possible (GH-118381)

18 months agogh-118402: Fix inspect.signature() for functools.cmp_to_key() result (GH-118427)
Serhiy Storchaka [Tue, 30 Apr 2024 14:49:28 +0000 (17:49 +0300)] 
gh-118402: Fix inspect.signature() for functools.cmp_to_key() result (GH-118427)

18 months agogh-102402: Make test_relativeCreated_has_higher_precision less implementation depende...
Serhiy Storchaka [Tue, 30 Apr 2024 14:35:19 +0000 (17:35 +0300)] 
gh-102402: Make test_relativeCreated_has_higher_precision less implementation dependent (GH-118062)

18 months agogh-117860: Add tests for resolving names when import rebind names (GH-118176)
Serhiy Storchaka [Tue, 30 Apr 2024 14:23:44 +0000 (17:23 +0300)] 
gh-117860: Add tests for resolving names when import rebind names (GH-118176)

Add tests for "import", pkgutil.resolve_name() and unittest.mock.path()
for cases when "import a.b as x" and "from a import b as x" give
different results.

18 months agogh-116622: Redirect stdout and stderr to system log when embedded in an Android app...
Malcolm Smith [Tue, 30 Apr 2024 14:00:31 +0000 (15:00 +0100)] 
gh-116622: Redirect stdout and stderr to system log when embedded in an Android app (#118063)

18 months agogh-118404: Fix inspect.signature() for non-comparable callables (GH-118405)
Serhiy Storchaka [Tue, 30 Apr 2024 12:04:16 +0000 (15:04 +0300)] 
gh-118404: Fix inspect.signature() for non-comparable callables (GH-118405)

18 months agoGH-118095: Add tier 2 support for YIELD_VALUE (GH-118380)
Mark Shannon [Tue, 30 Apr 2024 10:33:13 +0000 (11:33 +0100)] 
GH-118095: Add tier 2 support for YIELD_VALUE (GH-118380)

18 months agogh-85453: Consistent backquotes on None occurences across datetime.rst (#118282)
edson duarte [Tue, 30 Apr 2024 08:34:15 +0000 (05:34 -0300)] 
gh-85453: Consistent backquotes on None occurences across datetime.rst (#118282)

18 months agogh-118392: Add note about random.random for multi thread app (gh-118396)
Donghee Na [Tue, 30 Apr 2024 04:42:13 +0000 (13:42 +0900)] 
gh-118392: Add note about random.random for multi thread app (gh-118396)

18 months agoGH-118306: Update JIT to use LLVM 18 (GH-118307)
Savannah Ostrowski [Mon, 29 Apr 2024 21:09:16 +0000 (14:09 -0700)] 
GH-118306: Update JIT to use LLVM 18 (GH-118307)

18 months agogh-118359: Improve docs for Bdb.user_call (#118368)
Tian Gao [Mon, 29 Apr 2024 20:57:49 +0000 (13:57 -0700)] 
gh-118359: Improve docs for Bdb.user_call (#118368)

The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.

18 months agogh-118347: Fix Windows installer not updating launcher (GH-118386)
Steve Dower [Mon, 29 Apr 2024 20:46:25 +0000 (21:46 +0100)] 
gh-118347: Fix Windows installer not updating launcher (GH-118386)

18 months agogh-117657: TSAN fix race on `gstate->young.count` (#118313)
Alex Turner [Mon, 29 Apr 2024 20:26:26 +0000 (21:26 +0100)] 
gh-117657: TSAN fix race on `gstate->young.count` (#118313)

18 months agogh-118331: Handle errors in _PyObject_SetManagedDict (#118334)
Sam Gross [Mon, 29 Apr 2024 19:49:01 +0000 (15:49 -0400)] 
gh-118331: Handle errors in _PyObject_SetManagedDict (#118334)

When detaching a dict, the `copy_values` call may fail due to
out-of-memory errors. This can be triggered by test_no_memory in
test_repl.

18 months agogh-118401: Docs: Use Sphinx short options (#118403)
Hugo van Kemenade [Mon, 29 Apr 2024 19:41:59 +0000 (22:41 +0300)] 
gh-118401: Docs: Use Sphinx short options (#118403)

18 months agogh-117953: Share More Machinery Code Between Builtin and Dynamic Extensions (gh-118204)
Eric Snow [Mon, 29 Apr 2024 18:53:04 +0000 (12:53 -0600)] 
gh-117953: Share More Machinery Code Between Builtin and Dynamic Extensions (gh-118204)

This change will make some later changes simpler. It also brings more consistent behavior and lower maintenance costs.

18 months agogh-117783: Immortalize objects that use deferred reference counting (#118112)
Sam Gross [Mon, 29 Apr 2024 18:36:02 +0000 (14:36 -0400)] 
gh-117783: Immortalize objects that use deferred reference counting (#118112)

Deferred reference counting is not fully implemented yet. As a temporary
measure, we immortalize objects that would use deferred reference
counting to avoid multi-threaded scaling bottlenecks.

This is only performed in the free-threaded build once the first
non-main thread is started. Additionally, some tests, including refleak
tests, suppress this behavior.

18 months agoDocs: Upgrade to Sphinx 7.3 (#118397)
Hugo van Kemenade [Mon, 29 Apr 2024 17:40:50 +0000 (20:40 +0300)] 
Docs: Upgrade to Sphinx 7.3 (#118397)

18 months agogh-118331: Don't raise an error if tuple allocation fails when clearing weakrefs...
mpage [Mon, 29 Apr 2024 16:56:51 +0000 (09:56 -0700)] 
gh-118331: Don't raise an error if tuple allocation fails when clearing weakrefs (#118338)

It's not safe to raise an exception in `PyObject_ClearWeakRefs()` if one
is not already set, since it may be called by `_Py_Dealloc()`, which
requires that the active exception does not change.

Additionally, make sure we clear the weakrefs even when tuple allocation
fails.

18 months agogh-118285: Fix signatures of operator.{attrgetter,itemgetter,methodcaller} instances...
Serhiy Storchaka [Mon, 29 Apr 2024 16:30:48 +0000 (19:30 +0300)] 
gh-118285: Fix signatures of operator.{attrgetter,itemgetter,methodcaller} instances (GH-118316)

* Allow to specify the signature of custom callable instances of extension
  type by the __text_signature__ attribute.
* Specify signatures of operator.attrgetter, operator.itemgetter, and
  operator.methodcaller instances.

18 months agogh-118351: Adapt support.TEST_MODULES_ENABLED for builds without the config variable...
Kirill Podoprigora [Mon, 29 Apr 2024 15:50:11 +0000 (18:50 +0300)] 
gh-118351: Adapt support.TEST_MODULES_ENABLED for builds without the config variable (GH-118354)

18 months agogh-117953: Split Up _PyImport_LoadDynamicModuleWithSpec() (gh-118203)
Eric Snow [Mon, 29 Apr 2024 15:29:07 +0000 (09:29 -0600)] 
gh-117953: Split Up _PyImport_LoadDynamicModuleWithSpec() (gh-118203)

Basically, I've turned most of _PyImport_LoadDynamicModuleWithSpec() into two new functions (_PyImport_GetModInitFunc() and _PyImport_RunModInitFunc()) and moved the rest of it out into _imp_create_dynamic_impl().  There shouldn't be any changes in behavior.

This change makes some future changes simpler.  This is particularly relevant to potentially calling each module init function in the main interpreter first.  Thus the critical part of the PR is the addition of _PyImport_RunModInitFunc(), which is strictly focused on running the init func and validating the result.  A later PR will take it a step farther by capturing error information rather than raising exceptions.

FWIW, this change also helps readers by clarifying a bit more about what happens when an extension/builtin module is imported.

18 months agoUncomment one grammar test (#118361)
Nikita Sobolev [Mon, 29 Apr 2024 11:16:51 +0000 (14:16 +0300)] 
Uncomment one grammar test (#118361)

18 months agogh-114099: Fix typos in iOS/README.rst (GH-118378)
Xie Yanbo [Mon, 29 Apr 2024 11:15:15 +0000 (19:15 +0800)] 
gh-114099: Fix typos in iOS/README.rst (GH-118378)

18 months agoFix typo in Doc/c-api/exceptions.rst (GH-118371)
Xie Yanbo [Mon, 29 Apr 2024 11:02:54 +0000 (19:02 +0800)] 
Fix typo in Doc/c-api/exceptions.rst (GH-118371)

18 months agoFix typo in Doc/howto/timerfd.rst (GH-118376)
Xie Yanbo [Mon, 29 Apr 2024 11:01:03 +0000 (19:01 +0800)] 
Fix typo in Doc/howto/timerfd.rst (GH-118376)

18 months agoFix typo in Doc/c-api/typeobj.rst (GH-118377)
Xie Yanbo [Mon, 29 Apr 2024 10:59:38 +0000 (18:59 +0800)] 
Fix typo in Doc/c-api/typeobj.rst (GH-118377)

18 months agogh-107674: Lazy load line number to improve performance of tracing (GH-118127)
Tian Gao [Mon, 29 Apr 2024 08:54:52 +0000 (01:54 -0700)] 
gh-107674: Lazy load line number to improve performance of tracing (GH-118127)

18 months agogh-115119: Detect _decimal dependencies using pkg-config (#115406)
Erlend E. Aasland [Mon, 29 Apr 2024 06:58:57 +0000 (08:58 +0200)] 
gh-115119: Detect _decimal dependencies using pkg-config (#115406)

pkg-config is supported for libmpdec 4.0.0 and newer.

18 months agoGH-118095: Allow a variant of RESUME_CHECK in tier 2 (GH-118286)
Mark Shannon [Mon, 29 Apr 2024 06:54:05 +0000 (07:54 +0100)] 
GH-118095: Allow a variant of RESUME_CHECK in tier 2 (GH-118286)

18 months agogh-118374: test_ast: Add ``ctx`` argument to ``ast.Name`` calls (#118375)
Kirill Podoprigora [Mon, 29 Apr 2024 05:38:46 +0000 (08:38 +0300)] 
gh-118374: test_ast: Add ``ctx`` argument to ``ast.Name`` calls (#118375)

18 months agogh-118293: Suppress mouse cursor feedback when launching Windows processes with multi...
Henrik Tunedal [Sun, 28 Apr 2024 21:10:44 +0000 (23:10 +0200)] 
gh-118293: Suppress mouse cursor feedback when launching Windows processes with multiprocessing (GH-118315)

18 months agogh-101100: Fix Sphinx warnings in `whatsnew/3.10.rst` (#118356)
Hugo van Kemenade [Sun, 28 Apr 2024 18:12:25 +0000 (21:12 +0300)] 
gh-101100: Fix Sphinx warnings in `whatsnew/3.10.rst` (#118356)

18 months agogh-101100: Fix Sphinx warnings in `library/faulthandler.rst` (#118353)
Hugo van Kemenade [Sun, 28 Apr 2024 18:06:45 +0000 (21:06 +0300)] 
gh-101100: Fix Sphinx warnings in `library/faulthandler.rst` (#118353)

18 months agogh-101100: Fix Sphinx warnings in `whatsnew/3.9.rst` (#118364)
Hugo van Kemenade [Sun, 28 Apr 2024 17:31:22 +0000 (20:31 +0300)] 
gh-101100: Fix Sphinx warnings in `whatsnew/3.9.rst` (#118364)

18 months agoFix typo in Tools/wasm/README.md(#118358)
Xie Yanbo [Sun, 28 Apr 2024 17:00:48 +0000 (01:00 +0800)] 
Fix typo in Tools/wasm/README.md(#118358)

18 months agogh-109118: Make comprehensions work within annotation scopes, but without inlining...
Jelle Zijlstra [Sun, 28 Apr 2024 13:21:28 +0000 (06:21 -0700)] 
gh-109118: Make comprehensions work within annotation scopes, but without inlining (#118160)

Co-authored-by: Carl Meyer <carl@oddbird.net>
18 months agogh-118323: Document `&&` grammar syntax (#118324)
Nikita Sobolev [Sat, 27 Apr 2024 10:36:06 +0000 (13:36 +0300)] 
gh-118323: Document `&&` grammar syntax (#118324)

18 months agoCorrect typo in iOS README (#118341)
Wulian233 [Sat, 27 Apr 2024 09:25:32 +0000 (17:25 +0800)] 
Correct typo in iOS README (#118341)

18 months agoCorrect spelling error in recent NEWS entry (#118308)
Xie Yanbo [Sat, 27 Apr 2024 02:06:08 +0000 (10:06 +0800)] 
Correct spelling error in recent NEWS entry (#118308)

18 months agogh-110693: Use a Larger Queue for Per-Interpreter Pending Calls (gh-118302)
Eric Snow [Sat, 27 Apr 2024 01:13:44 +0000 (19:13 -0600)] 
gh-110693: Use a Larger Queue for Per-Interpreter Pending Calls (gh-118302)

This is an improvement over the status quo, reducing the likelihood of completely filling the pending calls queue.  However, the problem won't go away completely unless we move to an unbounded linked list or add a mechanism for waiting until the queue isn't full.

18 months agobpo-32839: Add the after_info() method for Tkinter widgets (GH-5664)
Cheryl Sabella [Fri, 26 Apr 2024 21:27:58 +0000 (14:27 -0700)] 
bpo-32839: Add the after_info() method for Tkinter widgets (GH-5664)

18 months agogh-112730: Respect tests that require environment variables with no-colorize fixes...
Pablo Galindo Salgado [Fri, 26 Apr 2024 20:23:30 +0000 (21:23 +0100)] 
gh-112730: Respect tests that require environment variables with no-colorize fixes (#118288)

18 months agogh-116749: Disable GIL by default in free-threaded build (#118295)
Sam Gross [Fri, 26 Apr 2024 18:22:29 +0000 (14:22 -0400)] 
gh-116749: Disable GIL by default in free-threaded build (#118295)

Switch GIL to disabled by default in free-threaded build so that the
free-threaded CIs catch thread-safety issues.

18 months agoGH-118095: Add dynamic exit support and FOR_ITER_GEN support to tier 2 (GH-118279)
Mark Shannon [Fri, 26 Apr 2024 17:08:50 +0000 (18:08 +0100)] 
GH-118095: Add dynamic exit support and FOR_ITER_GEN support to tier 2 (GH-118279)

18 months agogh-117680: Fix msvc warning in instruction_sequence.c (#118326)
neonene [Fri, 26 Apr 2024 16:20:30 +0000 (01:20 +0900)] 
gh-117680: Fix msvc warning in instruction_sequence.c (#118326)

18 months agogh-117385: Remove unhooked events on sys.settrace (GH-117386)
Tian Gao [Fri, 26 Apr 2024 16:01:44 +0000 (09:01 -0700)] 
gh-117385: Remove unhooked events on sys.settrace (GH-117386)

18 months agogh-117657: Fix race data race in `_Py_IsOwnedByCurrentThread()` (#118258)
mpage [Fri, 26 Apr 2024 14:39:08 +0000 (07:39 -0700)] 
gh-117657: Fix race data race in `_Py_IsOwnedByCurrentThread()` (#118258)

18 months agoFix note in Enum.__new__ docs (#118284)
Philipp A [Fri, 26 Apr 2024 14:06:53 +0000 (16:06 +0200)] 
Fix note in Enum.__new__ docs (#118284)

18 months agogh-117928: Bump the minimum Sphinx version to 6.2.1 (#117853)
Kirill Podoprigora [Fri, 26 Apr 2024 10:10:16 +0000 (13:10 +0300)] 
gh-117928: Bump the minimum Sphinx version to 6.2.1 (#117853)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
18 months agogh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237)
Petr Viktorin [Fri, 26 Apr 2024 09:01:30 +0000 (11:01 +0200)] 
gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237)

18 months agogh-110693: Pending Calls Machinery Cleanups (gh-118296)
Eric Snow [Fri, 26 Apr 2024 01:05:51 +0000 (19:05 -0600)] 
gh-110693: Pending Calls Machinery Cleanups (gh-118296)

This does some cleanup in preparation for later changes.

18 months agogh-112075: _Py_dict_lookup needs to lock shared keys (#117528)
Dino Viehland [Thu, 25 Apr 2024 22:34:05 +0000 (15:34 -0700)] 
gh-112075: _Py_dict_lookup needs to lock shared keys (#117528)

Lock shared keys in `Py_dict_lookup` and use thread-safe lookup in `insertdict`

Co-authored-by: Sam Gross <colesbury@gmail.com>
18 months agoRemove tests_gui variables from Tkinter tests (GH-118280)
Serhiy Storchaka [Thu, 25 Apr 2024 16:27:51 +0000 (19:27 +0300)] 
Remove tests_gui variables from Tkinter tests (GH-118280)

They were only used in runtktests.py which was removed in
f59ed3c310a7ceebf2a56a84ea969a7f75d95b64 (bpo-45229).

18 months agogh-117657: Fixes a few small TSAN issues in dictobject (#118200)
Dino Viehland [Thu, 25 Apr 2024 15:53:29 +0000 (08:53 -0700)] 
gh-117657: Fixes a few small TSAN issues in dictobject (#118200)

Fixup TSAN errors for dict

18 months agogh-117657: Add a couple more TSAN suppressions (#118256)
mpage [Thu, 25 Apr 2024 15:48:16 +0000 (08:48 -0700)] 
gh-117657: Add a couple more TSAN suppressions (#118256)

18 months agogh-117657: Fix data race in `_Py_IsImmortal` (#118261)
mpage [Thu, 25 Apr 2024 15:31:57 +0000 (08:31 -0700)] 
gh-117657: Fix data race in `_Py_IsImmortal` (#118261)

The load of `ob_ref_local races with stores. Using a relaxed load is
sufficient; stores to the field are relaxed.

18 months agogh-117566: fix IPv6Address.is_loopback for IPv4-mapped loopbacks (GH-117567)
Faidon Liambotis [Thu, 25 Apr 2024 15:17:40 +0000 (18:17 +0300)] 
gh-117566: fix IPv6Address.is_loopback for IPv4-mapped loopbacks (GH-117567)

While properties like IPv6Address.is_private account for IPv4-mapped
IPv6 addresses, such as for example:

    >>> ipaddress.ip_address("192.168.0.1").is_private
    True
    >>> ipaddress.ip_address("::ffff:192.168.0.1").is_private
    True
...the same doesn't currently apply to the is_loopback property:
    >>> ipaddress.ip_address("127.0.0.1").is_loopback
    True
    >>> ipaddress.ip_address("::ffff:127.0.0.1").is_loopback
    False

At minimum, this inconsistency between different properties is
counter-intuitive. Moreover, ::ffff:127.0.0.0/104 is for all intents and
purposes a loopback address, and should be treated as such.

18 months agogh-112069: Do not require lock if the set has never been exposed. (gh-118069)
Donghee Na [Thu, 25 Apr 2024 15:13:57 +0000 (00:13 +0900)] 
gh-112069: Do not require lock if the set has never been exposed. (gh-118069)

18 months agoFix incorrect usage of ``support.requires_gil_enabled`` (#118170)
Kirill Podoprigora [Thu, 25 Apr 2024 15:11:59 +0000 (18:11 +0300)] 
Fix incorrect usage of ``support.requires_gil_enabled`` (#118170)

18 months agogh-117578: Introduce _PyType_GetModuleByDef2 private function (GH-117661)
neonene [Thu, 25 Apr 2024 11:51:31 +0000 (20:51 +0900)] 
gh-117578: Introduce _PyType_GetModuleByDef2 private function (GH-117661)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
18 months agoGH-118095: Handle `RETURN_GENERATOR` in tier 2 (GH-118180)
Mark Shannon [Thu, 25 Apr 2024 10:32:47 +0000 (11:32 +0100)] 
GH-118095: Handle `RETURN_GENERATOR` in tier 2 (GH-118180)

18 months agogh-102511: Speed up os.path.splitroot() with native helpers (GH-118089)
Nice Zombies [Thu, 25 Apr 2024 09:07:38 +0000 (11:07 +0200)] 
gh-102511: Speed up os.path.splitroot() with native helpers (GH-118089)

18 months agogh-118221: Always use the default row factory in sqlite3.iterdump() (#118223)
Erlend E. Aasland [Thu, 25 Apr 2024 08:11:45 +0000 (10:11 +0200)] 
gh-118221: Always use the default row factory in sqlite3.iterdump() (#118223)

sqlite3.iterdump() depends on the row factory returning resulting rows
as tuples; it will fail with custom row factories like for example a
dict factory.

With this commit, we explicitly reset the row factory of the cursor used
by iterdump(), so we always get predictable results. This does not
affect the row factory of the parent connection.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
18 months agogh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use...
Itamar Oren [Thu, 25 Apr 2024 06:49:15 +0000 (23:49 -0700)] 
gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208)

18 months agogh-117968: Make the test for closed file more safe in the C API tests (GH-118230)
Serhiy Storchaka [Thu, 25 Apr 2024 05:00:42 +0000 (08:00 +0300)] 
gh-117968: Make the test for closed file more safe in the C API tests (GH-118230)

The behavior of fileno() after fclose() is undefined, but it is the only
practical way to check whether the file was closed.
Only test this on the known platforms (Linux, Windows, macOS), where we
already tested that it works.

18 months agogh-117786: Fix venv created from Windows Store install by restoring __PYVENV_LAUNCHER...
Steve Dower [Wed, 24 Apr 2024 22:00:55 +0000 (23:00 +0100)] 
gh-117786: Fix venv created from Windows Store install by restoring __PYVENV_LAUNCHER__ smuggling (GH-117814)

18 months agoGH-118246: Exclude test_pathlib and test_posixpath from emulated JIT CI (GH-118247)
Savannah Ostrowski [Wed, 24 Apr 2024 21:43:50 +0000 (14:43 -0700)] 
GH-118246: Exclude test_pathlib and test_posixpath from emulated JIT CI (GH-118247)

18 months agogh-108191: Add support of positional argument in SimpleNamespace constructor (GH...
Serhiy Storchaka [Wed, 24 Apr 2024 21:39:54 +0000 (00:39 +0300)] 
gh-108191: Add support of positional argument in SimpleNamespace constructor (GH-108195)

SimpleNamespace({'a': 1, 'b': 2}) and SimpleNamespace([('a', 1), ('b', 2)])
are now the same as SimpleNamespace(a=1, b=2).

18 months agogh-117953: Fix Refleaks Introduced by gh-118194 (gh-118250)
Eric Snow [Wed, 24 Apr 2024 21:23:45 +0000 (15:23 -0600)] 
gh-117953: Fix Refleaks Introduced by gh-118194 (gh-118250)

A couple of refleaks slipped through in gh-118194. This takes care of them.

(AKA _Py_ext_module_loader_info_init() does not steal references.)

18 months agogh-112730: Make the test suite resilient to color-activation environment variables...
Pablo Galindo Salgado [Wed, 24 Apr 2024 20:25:22 +0000 (21:25 +0100)] 
gh-112730: Make the test suite resilient to color-activation environment variables (#117672)

18 months agogh-85453: Make numeric literals consistent across datetime.rst (#118245)
edson duarte [Wed, 24 Apr 2024 20:19:54 +0000 (17:19 -0300)] 
gh-85453: Make numeric literals consistent across datetime.rst (#118245)

Remove code formatting from remaining numeric literals.

18 months agogh-85453: Adapt datetime.rst to devguide recommendations for code snippets and variab...
edson duarte [Wed, 24 Apr 2024 19:53:52 +0000 (16:53 -0300)] 
gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and variables (#118068)

Also remove formatting from numeric literals.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
18 months agogh-117953: Add Internal struct _Py_ext_module_loader_info (gh-118194)
Eric Snow [Wed, 24 Apr 2024 17:42:01 +0000 (11:42 -0600)] 
gh-117953: Add Internal struct _Py_ext_module_loader_info (gh-118194)

This helps with a later change that splits up _PyImport_LoadDynamicModuleWithSpec().

18 months agogh-116988: Remove duplicates of `annotated_rhs` in the Grammar (#117004)
David Rubin [Wed, 24 Apr 2024 17:16:06 +0000 (10:16 -0700)] 
gh-116988: Remove duplicates of `annotated_rhs` in the Grammar (#117004)

18 months agogh-117953: Let update_global_state_for_extension() Caller Decide If Singlephase or...
Eric Snow [Wed, 24 Apr 2024 16:28:35 +0000 (10:28 -0600)] 
gh-117953: Let update_global_state_for_extension() Caller Decide If Singlephase or Not (gh-118193)

This change makes other upcoming changes simpler.

18 months agogh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791)
Eric Snow [Wed, 24 Apr 2024 16:18:24 +0000 (10:18 -0600)] 
gh-76785: Rename _xxsubinterpreters to _interpreters (gh-117791)

See https://discuss.python.org/t/pep-734-multiple-interpreters-in-the-stdlib/41147/26.

18 months agogh-117953: Cleanups For fix_up_extension() in import.c (gh-118192)
Eric Snow [Wed, 24 Apr 2024 15:55:48 +0000 (09:55 -0600)] 
gh-117953: Cleanups For fix_up_extension() in import.c (gh-118192)

These are cleanups I've pulled out of gh-118116.  Mostly, this change moves code around to align with some future changes and to improve clarity a little.  There is one very small change in behavior: we now add the module to the per-interpreter caches after updating the global state, rather than before.

18 months agogh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` (#118202)
Alex Waygood [Wed, 24 Apr 2024 14:55:02 +0000 (15:55 +0100)] 
gh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` (#118202)

18 months agoGH-115419: Move setting the instruction pointer to error exit stubs (GH-118088)
Mark Shannon [Wed, 24 Apr 2024 13:41:30 +0000 (14:41 +0100)] 
GH-115419: Move setting the instruction pointer to error exit stubs (GH-118088)