]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
18 months agogh-116738: Make `_codecs` module thread-safe (#117530)
Brett Simmers [Thu, 2 May 2024 22:25:36 +0000 (15:25 -0700)] 
gh-116738: Make `_codecs` module thread-safe (#117530)

The module itself is a thin wrapper around calls to functions in
`Python/codecs.c`, so that's where the meaningful changes happened:

- Move codecs-related state that lives on `PyInterpreterState` to a
  struct declared in `pycore_codecs.h`.

- In free-threaded builds, add a mutex to `codecs_state` to synchronize
  operations on `search_path`. Because `search_path_mutex` is used as a
  normal mutex and not a critical section, we must be extremely careful
  with operations called while holding it.

- The codec registry is explicitly initialized as part of
  `_PyUnicode_InitEncodings` to simplify thread-safety.

18 months agogh-118500: Add pdb support for zipapp (#118501)
Tian Gao [Thu, 2 May 2024 20:53:27 +0000 (13:53 -0700)] 
gh-118500: Add pdb support for zipapp (#118501)

18 months agogh-118519: Fix empty weakref list check (#118520)
Dino Viehland [Thu, 2 May 2024 20:03:29 +0000 (13:03 -0700)] 
gh-118519: Fix empty weakref list check (#118520)

Fix empty list check

18 months agogh-117657: Fix TSAN list set failure (#118260)
Dino Viehland [Thu, 2 May 2024 20:03:05 +0000 (13:03 -0700)] 
gh-117657: Fix TSAN list set failure (#118260)

* Fix TSAN list set failure

* Relaxed atomic is sufficient, add targetted test

* More list

* Remove atomic assign in list

* Fixup white space

18 months agogh-118486: Switch mkdir(mode=0o700) on Windows to use OWNER RIGHTS instead of CURRENT...
Steve Dower [Thu, 2 May 2024 18:43:54 +0000 (19:43 +0100)] 
gh-118486: Switch mkdir(mode=0o700) on Windows to use OWNER RIGHTS instead of CURRENT_USER (GH-118515)

18 months agoRemove stray `__cplusplus` guard in sysmodule.c (#118511)
Sam Gross [Thu, 2 May 2024 17:51:28 +0000 (13:51 -0400)] 
Remove stray `__cplusplus` guard in sysmodule.c (#118511)

18 months agogh-118413: Fix test_release_task_refs on free-threaded build (#118494)
Sam Gross [Thu, 2 May 2024 17:41:15 +0000 (13:41 -0400)] 
gh-118413: Fix test_release_task_refs on free-threaded build (#118494)

The `time.sleep()` call should happen before the GC to give the worker
threads time to clean-up their remaining references to objs.
Additionally, use `support.gc_collect()` instead of `gc.collect()`
just in case the extra GC calls matter.

18 months agogh-90848: Fixed create_autospec ignoring configure_mock style kwargs (#118163)
infohash [Thu, 2 May 2024 17:36:35 +0000 (23:06 +0530)] 
gh-90848: Fixed create_autospec ignoring configure_mock style kwargs (#118163)

18 months agogh-93502: Add new C-API functions to trace object creation and destruction (#115945)
Pablo Galindo Salgado [Thu, 2 May 2024 17:30:00 +0000 (19:30 +0200)] 
gh-93502: Add new C-API functions to trace object creation and destruction (#115945)

18 months agogh-105879: Add support for keyword arguments to eval and exec (#105885)
Raphael Gaschignard [Thu, 2 May 2024 15:55:29 +0000 (01:55 +1000)] 
gh-105879: Add support for keyword arguments to eval and exec (#105885)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
18 months agoGH-118095: Unify the behavior of tier 2 FOR_ITER branch micro-ops (GH-118420)
Mark Shannon [Thu, 2 May 2024 15:17:59 +0000 (16:17 +0100)] 
GH-118095: Unify the behavior of tier 2 FOR_ITER branch micro-ops (GH-118420)

* Target _FOR_ITER_TIER_TWO at POP_TOP following the matching END_FOR

* Modify _GUARD_NOT_EXHAUSTED_RANGE, _GUARD_NOT_EXHAUSTED_LIST and _GUARD_NOT_EXHAUSTED_TUPLE so that they also target the POP_TOP following the matching END_FOR

18 months agogh-82062: Fix support of parameter defaults on methods in extension modules (GH-115270)
Sergey B Kirpichev [Thu, 2 May 2024 14:44:33 +0000 (17:44 +0300)] 
gh-82062: Fix support of parameter defaults on methods in extension modules (GH-115270)

Now inspect.signature() supports references to the module globals in
parameter defaults on methods in extension modules.  Previously it was
only supported in functions.  The workaround was to specify the fully
qualified name, including the module name.

18 months agogh-118486: Support mkdir(mode=0o700) on Windows (GH-118488)
Steve Dower [Thu, 2 May 2024 14:20:43 +0000 (15:20 +0100)] 
gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488)

18 months agogh-117903: Clarify that the staticmethod descriptor is callable (GH-117925)
Serhiy Storchaka [Thu, 2 May 2024 13:56:33 +0000 (16:56 +0300)] 
gh-117903: Clarify that the staticmethod descriptor is callable (GH-117925)

18 months agogh-116180: Check the globals argument in PyRun_* C API (GH-116637)
NGRsoftlab [Thu, 2 May 2024 13:43:03 +0000 (16:43 +0300)] 
gh-116180: Check the globals argument in PyRun_* C API (GH-116637)

It used to crash when passing NULL or non-dict as globals.
Now it sets a SystemError.

18 months agogh-118216: Don't consider dotted `__future__` imports (#118267)
Crowthebird [Thu, 2 May 2024 13:32:20 +0000 (21:32 +0800)] 
gh-118216: Don't consider dotted `__future__` imports (#118267)

18 months agoGH-117442: Check eval-breaker at start (rather than end) of tier 2 loops (GH-118482)
Mark Shannon [Thu, 2 May 2024 12:10:31 +0000 (13:10 +0100)] 
GH-117442: Check eval-breaker at start (rather than end) of tier 2 loops (GH-118482)

18 months agogdb/libpython.py: Update PyLongObjectPtr docstring (GH-118438)
Andrej [Thu, 2 May 2024 08:57:45 +0000 (13:57 +0500)] 
gdb/libpython.py: Update PyLongObjectPtr docstring (GH-118438)

18 months agodocs: typo: tiny grammar change: "pointed by" -> "pointed to by" (#118411)
Andrew Zipperer [Thu, 2 May 2024 05:37:12 +0000 (00:37 -0500)] 
docs: typo: tiny grammar change: "pointed by" -> "pointed to by" (#118411)

* docs: tiny grammar change: "pointed by" -> "pointed to by"

This commit uses "file pointed to by" to replace "file pointed by" in
 - doc for shutil.copytree
 - docstring for shutil.copytree
 - docstring _abc.PathBase.open
 - docstring for pathlib.Path.open
 - doc for os.copy_file_range
 - doc for os.splice

The docs use "file pointed to by" more frequently than
"file pointed by". So, this commit replaces the uses of
"file pointed by" in order to make the uses consistent
through the docs.

```bash
$ grep -ri 'pointed to by' cpython/
```
yields more results than
```bash
$ grep -ri 'pointed by' cpython/
```

Separately:

There are two occurrences of "tree pointed by":
 - cpython/Doc/library/xml.etree.elementtree.rst for
     `xml.etree.ElementInclude.include`
 - cpython/Lib/xml/etree/ElementInclude.py for `include`

For those uses of "tree pointed by", I expect "tree pointed to by"
instead. However, I found enough uses online of (a) "tree pointed by"
rather than (b) "tree pointed to by" to convince me that (a) is in
common use.

So, this commit does not replace those occurrences of "tree pointed by"
to "tree pointed to by". But I will replace them if a reviewer
believes it is correct to replace them.

* docs: typo: "exists and executable" -> "exists and is executable"

---------

Co-authored-by: Andrew-Zipperer <atzipperer@gmail.com>
18 months agogh-118335: Rename --experimental-interpreter on Windows to --experimental-jit-interpr...
Guido van Rossum [Thu, 2 May 2024 00:48:34 +0000 (17:48 -0700)] 
gh-118335: Rename --experimental-interpreter on Windows to --experimental-jit-interpreter (#118497)

Also fix docs for this in whatsnew.

18 months agogh-117953: Work Relative to Specific Extension Kinds in the Import Machinery (gh...
Eric Snow [Wed, 1 May 2024 23:40:28 +0000 (17:40 -0600)] 
gh-117953: Work Relative to Specific Extension Kinds in the Import Machinery (gh-118205)

This change will make some later changes simpler.

18 months agogh-118335: Make REGEN_JIT_COMMAND empty if tier2 interpreter enabled (#118493)
Guido van Rossum [Wed, 1 May 2024 23:36:29 +0000 (16:36 -0700)] 
gh-118335: Make REGEN_JIT_COMMAND empty if tier2 interpreter enabled (#118493)

Also patch up news blurb for gh-118339
(add warning that PYTHON_UOPS is now PYTHON_JIT).

18 months agoGH-118174: specify the type for the path argument of shutil.which
Filipe Laíns [Wed, 1 May 2024 23:13:32 +0000 (00:13 +0100)] 
GH-118174: specify the type for the path argument of shutil.which

18 months agogh-118413: Temporarily skip `test_release_task_refs` in free-threaded builds (#118491)
Sam Gross [Wed, 1 May 2024 21:58:22 +0000 (17:58 -0400)] 
gh-118413: Temporarily skip `test_release_task_refs` in free-threaded builds (#118491)

18 months agogh-117607: Speedup os.path.relpath() (GH-117608)
Nice Zombies [Wed, 1 May 2024 21:44:55 +0000 (23:44 +0200)] 
gh-117607: Speedup os.path.relpath() (GH-117608)

18 months agoGH-113464: Display a warning when building the JIT (GH-118481)
Brandt Bucher [Wed, 1 May 2024 21:35:49 +0000 (14:35 -0700)] 
GH-113464: Display a warning when building the JIT (GH-118481)

18 months agoGH-118095: Make sure that progress is made if there are pending calls being handled...
Mark Shannon [Wed, 1 May 2024 21:18:31 +0000 (22:18 +0100)] 
GH-118095: Make sure that progress is made if there are pending calls being handled. (GH-118484)

18 months agogh-118433: Temporarily skip `test_interrupt_main_subthread` in free-threaded builds...
mpage [Wed, 1 May 2024 20:59:12 +0000 (13:59 -0700)] 
gh-118433: Temporarily skip `test_interrupt_main_subthread` in free-threaded builds (#118485)

Free-threaded builds can intermittently tickle a longstanding bug (24 years!)
in the implementation of `threading.Condition`, leading to flakiness in the
test suite. Fixing the underlying issue will require more discussion, and will
likely apply to most of the concurrency primitives in the `threading` module
that are written in Python. See gh-118433 for more details.

18 months agogh-118272: set stacktop to 0 before freeing contents, to avoid access to invalid...
Irit Katriel [Wed, 1 May 2024 20:51:40 +0000 (21:51 +0100)] 
gh-118272: set stacktop to 0 before freeing contents, to avoid access to invalid objects during GC (#118478)

18 months agobuild(deps-dev): bump types-psutil from 5.9.5.20240316 to 5.9.5.20240423 in /Tools...
dependabot[bot] [Wed, 1 May 2024 19:15:30 +0000 (19:15 +0000)] 
build(deps-dev): bump types-psutil from 5.9.5.20240316 to 5.9.5.20240423 in /Tools (#118464)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
18 months agogh-117225: Move colorize functionality to own internal module (#118283)
Hugo van Kemenade [Wed, 1 May 2024 18:27:06 +0000 (21:27 +0300)] 
gh-117225: Move colorize functionality to own internal module (#118283)

18 months agogh-117225: Document colour use in `doctest` (#118268)
Hugo van Kemenade [Wed, 1 May 2024 18:25:11 +0000 (21:25 +0300)] 
gh-117225: Document colour use in `doctest` (#118268)

18 months agogh-110850: Add PyTime_TimeRaw() function (#118394)
Victor Stinner [Wed, 1 May 2024 18:05:01 +0000 (20:05 +0200)] 
gh-110850: Add PyTime_TimeRaw() function (#118394)

Add "Raw" variant of PyTime functions:

* PyTime_MonotonicRaw()
* PyTime_PerfCounterRaw()
* PyTime_TimeRaw()

Changes:

* Add documentation and tests. Tests release the GIL while calling
  raw clock functions.
* py_get_system_clock() and py_get_monotonic_clock() now check that
  the GIL is hold by the caller if raise_exc is non-zero.
* Reimplement "Unchecked" functions with raw clock functions.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
18 months agoExpand the 'Extending' docs with an example. (#113187)
Jason R. Coombs [Wed, 1 May 2024 17:04:02 +0000 (13:04 -0400)] 
Expand the 'Extending' docs with an example. (#113187)

* Expand the 'Extending' docs to provide a minimal example. Closes python/importlib_metadata#427.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
18 months agogh-116622: Android sysconfig updates (#118352)
Malcolm Smith [Wed, 1 May 2024 16:47:54 +0000 (17:47 +0100)] 
gh-116622: Android sysconfig updates (#118352)

18 months agoBump types-setuptools from 69.2.0.20240317 to 69.5.0.20240423 in /Tools (#118463)
dependabot[bot] [Wed, 1 May 2024 16:07:29 +0000 (17:07 +0100)] 
Bump types-setuptools from 69.2.0.20240317 to 69.5.0.20240423 in /Tools (#118463)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
18 months agoBump mypy from 1.9.0 to 1.10.0 in /Tools (#118461)
dependabot[bot] [Wed, 1 May 2024 16:06:54 +0000 (17:06 +0100)] 
Bump mypy from 1.9.0 to 1.10.0 in /Tools (#118461)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
18 months agogh-99730: urllib.request: Keep HEAD method on redirect (GH-99731)
Harmen Stoppels [Wed, 1 May 2024 16:01:47 +0000 (18:01 +0200)] 
gh-99730: urllib.request: Keep HEAD method on redirect (GH-99731)

18 months agoGH-115802: Use the GHC calling convention in JIT code (GH-118287)
Brandt Bucher [Wed, 1 May 2024 15:05:53 +0000 (08:05 -0700)] 
GH-115802: Use the GHC calling convention in JIT code (GH-118287)

18 months agogh-117958: Expose JIT code via method in UOpExecutor (#117959)
Anthony Shaw [Wed, 1 May 2024 14:11:14 +0000 (00:11 +1000)] 
gh-117958: Expose JIT code via method in UOpExecutor (#117959)

18 months agogh-99180: Remove traceback anchors in return and assign statements that cover all...
Pablo Galindo Salgado [Wed, 1 May 2024 13:42:10 +0000 (14:42 +0100)] 
gh-99180: Remove traceback anchors in return and assign statements that cover all the displayed range (#112670)

18 months agogh-116767: fix crash on 'async with' with many context managers (GH-118348)
Irit Katriel [Wed, 1 May 2024 11:01:16 +0000 (12:01 +0100)] 
gh-116767: fix crash on 'async with' with many context managers (GH-118348)

Account for `add_stopiteration_handler` pushing a block for `async with`.
To allow generator functions that previously almost hit the `CO_MAXBLOCKS`
limit by nesting non-async blocks, the limit is increased by 1.
This increase allows one more block in non-generator functions.

18 months agoGH-118095: Make invalidating and clearing executors memory safe (GH-118459)
Mark Shannon [Wed, 1 May 2024 10:34:50 +0000 (11:34 +0100)] 
GH-118095: Make invalidating and clearing executors memory safe (GH-118459)

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>