]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
12 months agogh-115999: Fix gdb support for libpython.so after thread-local bytecode change (...
T. Wouters [Tue, 5 Nov 2024 14:49:27 +0000 (15:49 +0100)] 
gh-115999: Fix gdb support for libpython.so after thread-local bytecode change (#126440)

Fix the gdb pretty printer in the face of --enable-shared by delaying the attempt to load the _PyInterpreterFrame definition until after .so files are loaded.

12 months agogh-126425: Refactor `_lsprof_Profiler_enable` (#126426)
sobolevn [Tue, 5 Nov 2024 12:23:24 +0000 (15:23 +0300)] 
gh-126425: Refactor `_lsprof_Profiler_enable` (#126426)

- Explicit memory management for `None` objects (since we still try to treat immortal objects as regular objects)
- Respect possible errors of `sys.monitoring.register_callback` call

12 months agogh-126417: Register multiprocessing proxy types to an appropriate collections.abc...
Stephen Morton [Tue, 5 Nov 2024 10:05:45 +0000 (02:05 -0800)] 
gh-126417: Register multiprocessing proxy types to an appropriate collections.abc class (#126419)

12 months agogh-126366: Fix crash if `__iter__` raises an exception during `yield from` (#126369)
Peter Bierma [Tue, 5 Nov 2024 09:56:36 +0000 (04:56 -0500)] 
gh-126366: Fix crash if `__iter__` raises an exception during `yield from` (#126369)

12 months agoDoc: C API: Delete claim that `PyObject_Init` is GC-aware (#126418)
Richard Hansen [Tue, 5 Nov 2024 09:48:46 +0000 (04:48 -0500)] 
Doc: C API: Delete claim that `PyObject_Init` is GC-aware (#126418)

12 months agogh-119793: Prefer `map(..., strict=True)` over starmap/zip in examples (#126407)
Lukas Geiger [Tue, 5 Nov 2024 07:53:32 +0000 (07:53 +0000)] 
gh-119793: Prefer `map(..., strict=True)` over starmap/zip in examples (#126407)

12 months agogh-120057: Add os.reload_environ() function (#126268)
Victor Stinner [Tue, 5 Nov 2024 07:43:34 +0000 (08:43 +0100)] 
gh-120057: Add os.reload_environ() function (#126268)

Replace the os.environ.refresh() method with a new
os.reload_environ() function.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agogh-126303: Fix pickling and copying of os.sched_param objects (GH-126336)
Serhiy Storchaka [Tue, 5 Nov 2024 06:23:17 +0000 (08:23 +0200)] 
gh-126303: Fix pickling and copying of os.sched_param objects (GH-126336)

12 months agogh-125436: Doc: Add missing ``allow_unnamed_section`` parameter to ``ConfigParser...
lit [Tue, 5 Nov 2024 02:58:15 +0000 (10:58 +0800)] 
gh-125436: Doc: Add missing ``allow_unnamed_section`` parameter to ``ConfigParser`` documentation (#125437)

Add missing ``allow_unnamed_section`` parameter to ``ConfigParser`` doc, as well as to it's parent ``RawConfigParser``.
Split too long line on ``ConfigParser`` signature.
Add some sections about when some of ``RawConfigParser`` parameters were added.

12 months agogh-126415: Fix conversion warning in `Python/bytecodes.c` (#126416)
Kirill Podoprigora [Tue, 5 Nov 2024 02:12:31 +0000 (04:12 +0200)] 
gh-126415: Fix conversion warning in `Python/bytecodes.c` (#126416)

Fix conversion warning in bytecodes

Co-authored-by: mpage <mpage@cs.stanford.edu>
12 months agogh-89640: Hardcode WASM float word ordering as little endian (#126387)
Erlend E. Aasland [Mon, 4 Nov 2024 20:48:09 +0000 (21:48 +0100)] 
gh-89640: Hardcode WASM float word ordering as little endian (#126387)

12 months agoGH-126363: Speed up pattern parsing in `pathlib.Path.glob()` (#126364)
Barney Gale [Mon, 4 Nov 2024 19:29:57 +0000 (19:29 +0000)] 
GH-126363: Speed up pattern parsing in `pathlib.Path.glob()` (#126364)

The implementation of `Path.glob()` does rather a hacky thing: it calls
`self.with_segments()` to convert the given pattern to a `Path` object, and
then peeks at the private `_raw_path` attribute to see if pathlib removed a
trailing slash from the pattern.

In this patch, we make `glob()` use a new `_parse_pattern()` classmethod
that splits the pattern into parts while preserving information about any
trailing slash. This skips the cost of creating a `Path` object, and avoids
some path anchor normalization, which makes `Path.glob()` slightly faster.
But mostly it's about making the code less naughty.

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
12 months agogh-115999: Implement thread-local bytecode and enable specialization for `BINARY_OP...
mpage [Mon, 4 Nov 2024 19:13:32 +0000 (11:13 -0800)] 
gh-115999: Implement thread-local bytecode and enable specialization for `BINARY_OP` (#123926)

Each thread specializes a thread-local copy of the bytecode, created on the first RESUME, in free-threaded builds. All copies of the bytecode for a code object are stored in the co_tlbc array on the code object. Threads reserve a globally unique index identifying its copy of the bytecode in all co_tlbc arrays at thread creation and release the index at thread destruction. The first entry in every co_tlbc array always points to the "main" copy of the bytecode that is stored at the end of the code object. This ensures that no bytecode is copied for programs that do not use threads.

Thread-local bytecode can be disabled at runtime by providing either -X tlbc=0 or PYTHON_TLBC=0. Disabling thread-local bytecode also disables specialization.

Concurrent modifications to the bytecode made by the specializing interpreter and instrumentation use atomics, with specialization taking care not to overwrite an instruction that was instrumented concurrently.

12 months agoDoc: Fix typo in documentation for ``MAKE_FUNCTION`` opcode (#126396)
Mikhail Efimov [Mon, 4 Nov 2024 17:28:05 +0000 (20:28 +0300)] 
Doc: Fix typo in documentation for  ``MAKE_FUNCTION`` opcode (#126396)

12 months agogh-101865: Docs: Keep co_lnotab deprecation for at least 3.14 (#126392)
Hugo van Kemenade [Mon, 4 Nov 2024 16:49:59 +0000 (18:49 +0200)] 
gh-101865: Docs: Keep co_lnotab deprecation for at least 3.14 (#126392)

12 months agogh-126220: Adapt `_lsprof` to Argument Clinic (#126233)
sobolevn [Mon, 4 Nov 2024 16:18:21 +0000 (19:18 +0300)] 
gh-126220: Adapt `_lsprof` to Argument Clinic (#126233)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
12 months agogh-119793: Add optional length-checking to `map()` (GH-120471)
Nice Zombies [Mon, 4 Nov 2024 14:00:19 +0000 (15:00 +0100)] 
gh-119793: Add optional length-checking to `map()` (GH-120471)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
12 months agogh-109413: Add more type hints to `libregrtest` (#126352)
sobolevn [Mon, 4 Nov 2024 10:15:57 +0000 (13:15 +0300)] 
gh-109413: Add more type hints to `libregrtest` (#126352)

12 months agogh-126353: remove implicit creation of loop from `asyncio.get_event_loop` (#126354)
Kumar Aditya [Mon, 4 Nov 2024 08:51:20 +0000 (14:21 +0530)] 
gh-126353: remove implicit creation of loop from `asyncio.get_event_loop` (#126354)

Remove implicit creation of loop from `asyncio.get_event_loop`. This is a step forward of deprecating the policy system of asyncio.

12 months agoDocs: turn getopt examples into doctests (#126377)
Erlend E. Aasland [Mon, 4 Nov 2024 08:27:25 +0000 (09:27 +0100)] 
Docs: turn getopt examples into doctests (#126377)

12 months agogh-126165: Improve docs of function `math.isclose` (#126215)
Zhikang Yan [Mon, 4 Nov 2024 04:08:15 +0000 (12:08 +0800)] 
gh-126165: Improve docs of function `math.isclose` (#126215)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
12 months agoDocs: Delist sqlite3 deprecation from "Pending removal in 3.14" (#126370)
Hugo van Kemenade [Sun, 3 Nov 2024 21:22:49 +0000 (23:22 +0200)] 
Docs: Delist sqlite3 deprecation from "Pending removal in 3.14" (#126370)

12 months agogh-126357: Remove gettext import guards (GH-126358)
Tomas R. [Sun, 3 Nov 2024 16:54:42 +0000 (17:54 +0100)] 
gh-126357: Remove gettext import guards (GH-126358)

12 months agogh-126313: Fix a crash in curses.napms() due to incorrect error handling (GH-126351)
Bénédikt Tran [Sun, 3 Nov 2024 15:08:34 +0000 (16:08 +0100)] 
gh-126313: Fix a crash in curses.napms() due to incorrect error handling (GH-126351)

12 months agogh-104400: Add more tests to pygettext (GH-108173)
Tomas R. [Sun, 3 Nov 2024 14:01:09 +0000 (15:01 +0100)] 
gh-104400: Add more tests to pygettext (GH-108173)

12 months agogh-113977, gh-120754: Remove unbounded reads from zipfile (GH-122101)
Cody Maloney [Sun, 3 Nov 2024 05:28:51 +0000 (22:28 -0700)] 
gh-113977, gh-120754: Remove unbounded reads from zipfile (GH-122101)

GH-113977, GH-120754: Remove unbounded reads from zipfile

Read without a size may read an unbounded amount of data + allocate
unbounded size buffers. Move to capped size reads to prevent potential
issues.

Co-authored-by: Daniel Hillier <daniel.hillier@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
12 months agogh-125832: Reformat comments for inlined comprehensions (gh-126346)
Donghee Na [Sun, 3 Nov 2024 04:15:07 +0000 (13:15 +0900)] 
gh-125832: Reformat comments for  inlined comprehensions (gh-126346)

12 months agogh-120754: Add a strace helper and test set of syscalls for open().read(), Take 2...
Cody Maloney [Sun, 3 Nov 2024 03:37:21 +0000 (20:37 -0700)] 
gh-120754: Add a strace helper and test set of syscalls for open().read(), Take 2 (#123413)

12 months agogh-99880: document rounding mode for new-style formatting (GH-121481)
Sergey B Kirpichev [Sat, 2 Nov 2024 17:11:12 +0000 (20:11 +0300)] 
gh-99880: document rounding mode for new-style formatting (GH-121481)

* gh-99880: document rounding mode for new-style formatting

The CPython uses _Py_dg_dtoa(), which does rounding to nearest with half
to even tie-breaking rule.

If that functions is unavailable, PyOS_double_to_string() fallbacks to
system snprintf().  Since CPython 3.12, build requirements include C11
compiler *and* support for IEEE 754 floating point numbers (Annex F).
This means that FE_TONEAREST macro is available and, per default,
printf-like functions should use same rounding mode as _Py_dg_dtoa().

* Update Doc/library/string.rst

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

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months agogh-125832: Clarify comment for inlined comprehensions as per PEP-709 (#126322)
rimchoi [Sat, 2 Nov 2024 17:04:53 +0000 (02:04 +0900)] 
gh-125832: Clarify comment for inlined comprehensions as per PEP-709 (#126322)

* Fix comprehensions comment to inlined by pep 709

* Update spacing

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* Add reference to PEP 709

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
12 months agogh-126317: Simplify pickle code by using itertools.batched() (GH-126323)
Lee Dong Wook [Sat, 2 Nov 2024 14:07:32 +0000 (23:07 +0900)] 
gh-126317: Simplify pickle code by using itertools.batched() (GH-126323)

12 months agogh-125761: Clarify repeated warning suppression criteria in warnings module (gh-126326)
고병찬 [Sat, 2 Nov 2024 11:37:26 +0000 (20:37 +0900)] 
gh-125761: Clarify repeated warning suppression criteria in warnings module (gh-126326)

12 months agogh-125522: Remove bare except in test_zlib.test_flushes (gh-126321)
simple-is-great [Sat, 2 Nov 2024 08:27:07 +0000 (17:27 +0900)] 
gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321)

12 months agogh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__` (#126305)
Nico-Posada [Sat, 2 Nov 2024 07:46:00 +0000 (03:46 -0400)] 
gh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__` (#126305)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agogh-125875: Fix docs typo FORMAT_SPEC to FORMAT_WITH_SPEC (gh-126319)
rimchoi [Sat, 2 Nov 2024 05:08:27 +0000 (14:08 +0900)] 
gh-125875: Fix docs typo FORMAT_SPEC to FORMAT_WITH_SPEC (gh-126319)

Fix docs typo FORMAT_SPEC to FORMAT_WITH_SPEC

12 months agogh-126255: Ignore warning about JIT being deactivated when perf support is active...
mpage [Fri, 1 Nov 2024 23:10:58 +0000 (16:10 -0700)] 
gh-126255: Ignore warning about JIT being deactivated when perf support is active in `test_embed.InitConfigTests.test_initconfig_api` (#126302)

Temporarily ignore warnings about JIT deactivation when perf support is active.
This will be reverted as soon as a way is found to determine at run time whether the interpreter was built with JIT. Currently, this is not possible on Windows.

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
12 months agogh-120026: soft deprecate Py_HUGE_VAL macro (#120027)
Sergey B Kirpichev [Fri, 1 Nov 2024 22:04:31 +0000 (01:04 +0300)] 
gh-120026: soft deprecate Py_HUGE_VAL macro (#120027)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agogh-126220: Fix crash on calls to `_lsprof.Profiler` methods with 0 args (backportable...
sobolevn [Fri, 1 Nov 2024 21:53:29 +0000 (00:53 +0300)] 
gh-126220: Fix crash on calls to `_lsprof.Profiler` methods with 0 args (backportable) (#126271)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
12 months agogh-120754: _io Ensure stat cache is cleared on fd change (#125166)
Cody Maloney [Fri, 1 Nov 2024 21:50:49 +0000 (14:50 -0700)] 
gh-120754: _io Ensure stat cache is cleared on fd change (#125166)

Performed an audit of `fileio.c` and `_pyio` and made sure anytime the
fd changes the stat result, if set, is also cleared/changed.

There's one case where it's not cleared, if code would clear it in
__init__, keep the memory allocated and just do another fstat with the
existing memory.

12 months agogh-125560: Pin JIT CI to ubuntu-22.04 (#125564)
Savannah Ostrowski [Fri, 1 Nov 2024 21:43:30 +0000 (14:43 -0700)] 
gh-125560: Pin JIT CI to ubuntu-22.04 (#125564)

12 months agogh-125916: Adapt functools.reduce() to Argument Clinic (#125999)
Sergey B Kirpichev [Fri, 1 Nov 2024 20:15:39 +0000 (23:15 +0300)] 
gh-125916: Adapt functools.reduce() to Argument Clinic (#125999)

12 months agoDoc: Add a single table as summary to math documentation (GH-125810)
Joseph Martinot-Lagarde [Fri, 1 Nov 2024 19:35:05 +0000 (20:35 +0100)] 
Doc: Add a single table as summary to math documentation (GH-125810)

* Summary for math module with separate tables

* Forgot remainder description

* Single table

* data instead of func

* Add arguments in the table

* Fix inconsistencies in pow documentation

* Remove full stops from the table

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* Fix math.pow link

* Fix spacing

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
12 months agodocs: add a more precise example in enum doc (GH-121015)
Filip "Ret2Me" Poplewski [Fri, 1 Nov 2024 19:28:50 +0000 (20:28 +0100)] 
docs: add a more precise example in enum doc (GH-121015)

* docs: add a more precise example

Previous example used manual integer value assignment in class based declaration but in functional syntax has been used auto value assignment what could be confusing for the new users. Additionally documentation doesn't show how to declare new enum via functional syntax with usage of the manual value assignment.

* docs: remove whitespace characters

* refactor: change example

---------

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
12 months agoGH-125413: pathlib ABCs: use `scandir()` to speed up `walk()` (#126262)
Barney Gale [Fri, 1 Nov 2024 18:52:00 +0000 (18:52 +0000)] 
GH-125413: pathlib ABCs: use `scandir()` to speed up `walk()` (#126262)

Use the new `PathBase.scandir()` method in `PathBase.walk()`, which greatly
reduces the number of `PathBase.stat()` calls needed when walking.

There are no user-facing changes, because the pathlib ABCs are still
private and `Path.walk()` doesn't use the implementation in its superclass.

12 months agoGH-125413: pathlib ABCs: use `scandir()` to speed up `glob()` (#126261)
Barney Gale [Fri, 1 Nov 2024 17:48:58 +0000 (17:48 +0000)] 
GH-125413: pathlib ABCs: use `scandir()` to speed up `glob()` (#126261)

Use the new `PathBase.scandir()` method in `PathBase.glob()`, which greatly
reduces the number of `PathBase.stat()` calls needed when globbing.

There are no user-facing changes, because the pathlib ABCs are still
private and `Path.glob()` doesn't use the implementation in its superclass.

12 months agogh-97850: remove ``find_loader`` and ``get_loader`` from ``pkgutil`` (#119656)
Bénédikt Tran [Fri, 1 Nov 2024 16:35:22 +0000 (17:35 +0100)] 
gh-97850: remove ``find_loader`` and ``get_loader`` from ``pkgutil`` (#119656)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Brett Cannon <brett@python.org>
12 months agogh-99108: Cleanup references to inexisting `Modules/_blake2`. (GH-126270)
Bénédikt Tran [Fri, 1 Nov 2024 16:18:44 +0000 (17:18 +0100)] 
gh-99108: Cleanup references to inexisting `Modules/_blake2`. (GH-126270)

* Remove references to `Modules/_blake2`.

* Remove `Modules/_blake2` entry from CODEOWNERS

The folder does not exist anymore.

* Remove `Modules/_blake2` entry from `Tools/c-analyzer/TODO`

12 months agogh-126211: Exclude preprocessor directives from statements containing escaping calls...
mpage [Fri, 1 Nov 2024 15:53:03 +0000 (08:53 -0700)] 
gh-126211: Exclude preprocessor directives from statements containing escaping calls (#126213)

The cases generator inserts code to save and restore the stack pointer around
statements that contain escaping calls. To find the beginning of such statements,
we would walk backwards from the escaping call until we encountered a token that
was treated as a statement terminator. This set of terminators should include
preprocessor directives.

12 months agogh-111495: improve test coverage of codecs C API (GH-126030)
Bénédikt Tran [Fri, 1 Nov 2024 13:28:18 +0000 (14:28 +0100)] 
gh-111495: improve test coverage of codecs C API (GH-126030)

For now, skip some crashers (tracked in gh-123378).

12 months agogh-125783: Add more tests to prevent regressions with the combination of ctypes and...
Jun Komoda [Fri, 1 Nov 2024 12:50:02 +0000 (21:50 +0900)] 
gh-125783: Add more tests to prevent regressions with the combination of ctypes and metaclasses. (GH-126126)

12 months agogh-126206: make clinic now forcefully regenerates clinic code (#126244)
Erlend E. Aasland [Fri, 1 Nov 2024 08:17:54 +0000 (09:17 +0100)] 
gh-126206: make clinic now forcefully regenerates clinic code (#126244)

12 months agogh-126259: Fix "unclosed database" warning in sqlite3 doctest (#126260)
sobolevn [Fri, 1 Nov 2024 07:17:05 +0000 (10:17 +0300)] 
gh-126259: Fix "unclosed database" warning in sqlite3 doctest (#126260)

12 months agoGH-125413: Add `pathlib.Path.scandir()` method (#126060)
Barney Gale [Fri, 1 Nov 2024 01:19:01 +0000 (01:19 +0000)] 
GH-125413: Add `pathlib.Path.scandir()` method (#126060)

Add `pathlib.Path.scandir()` as a trivial wrapper of `os.scandir()`. This
will be used to implement several `PathBase` methods more efficiently,
including methods that provide `Path.copy()`.

12 months agogh-126256: Update time.rst to use the same clock as instead of the same clock than...
Alperen Keleş [Thu, 31 Oct 2024 21:44:34 +0000 (17:44 -0400)] 
gh-126256: Update time.rst to use the same clock as instead of the same clock than (#126257)

Update time.rst to use `the same clock as` instead of `the same clock than`

The time documentation uses the same clock than time.monotonic instead of the same clock as time.monotonic, which is grammatically false. This PR fixes changes two instances of `the same clock than` to `the same clock as`.

12 months agogh-126156: Improve performance of creating `Morsel` objects (#126157)
J. Nick Koston [Thu, 31 Oct 2024 19:05:40 +0000 (14:05 -0500)] 
gh-126156: Improve performance of creating `Morsel` objects (#126157)

Replaces the manually constructed loop with a call to `dict.update`

12 months agogh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to an evil...
Bénédikt Tran [Thu, 31 Oct 2024 17:14:47 +0000 (18:14 +0100)] 
gh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to an evil `loop.__getattribute__` (#126120)

12 months agogh-101123: Adapt vararg functions in the math module to Argument Clinic (#126235)
Sergey B Kirpichev [Thu, 31 Oct 2024 14:37:47 +0000 (17:37 +0300)] 
gh-101123: Adapt vararg functions in the math module to Argument Clinic (#126235)

This implicitly fixes the math.hypot signature, which was previously
incomprehensible to inspect.signature().

12 months agogh-126240: handle `NULL` returned by `_Py_asdl_expr_seq_new` (#126241)
Bénédikt Tran [Thu, 31 Oct 2024 14:24:07 +0000 (15:24 +0100)] 
gh-126240: handle `NULL` returned by  `_Py_asdl_expr_seq_new` (#126241)

check return value of `_Py_asdl_expr_seq_new`

12 months agogh-126223: Propagate unicode errors in `_interpreters.create()` (#126224)
Peter Bierma [Thu, 31 Oct 2024 14:14:37 +0000 (10:14 -0400)] 
gh-126223: Propagate unicode errors in `_interpreters.create()` (#126224)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months agogh-90370: Argument Clinic: avoid temporary tuple creation for varargs (#126064)
Sergey B Kirpichev [Thu, 31 Oct 2024 10:37:03 +0000 (13:37 +0300)] 
gh-90370: Argument Clinic: avoid temporary tuple creation for varargs (#126064)

Avoid temporary tuple creation when all arguments either positional-only
or vararg.

Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight
performance regression for set methods, introduced by gh-115112.

12 months agogh-126083: Fix a reference leak in `asyncio.Task` when reinitializing with new non...
Nico-Posada [Thu, 31 Oct 2024 07:47:57 +0000 (03:47 -0400)] 
gh-126083: Fix a reference leak in `asyncio.Task` when reinitializing with new non-`None` context (#126103)

12 months agogh-125818: Fix incorrect signature of argument `skip_file_prefixes` in warnings docs...
RUANG (James Roy) [Thu, 31 Oct 2024 01:15:07 +0000 (09:15 +0800)] 
gh-125818: Fix incorrect signature of argument `skip_file_prefixes` in warnings docs (GH-125823)

Change documentation

12 months agogh-126178: NFC Separate Emscripten and WASI standard lib disables in configure (...
Hood Chatham [Thu, 31 Oct 2024 00:51:11 +0000 (01:51 +0100)] 
gh-126178: NFC Separate Emscripten and WASI standard lib disables in configure (#126179)

Separate the Emscripten and WASI stdlib configuration in configure.

12 months agoAdd myself to CODEOWNERS for WASM/emscripten and Android (#126210)
Russell Keith-Magee [Thu, 31 Oct 2024 00:12:37 +0000 (08:12 +0800)] 
Add myself to CODEOWNERS for WASM/emscripten and Android (#126210)

Add RKM to CODEOWNERS for WASM/emscripten and Android.

12 months agoGH-126205: Fix conversion of UNC paths to file URIs (#126208)
Barney Gale [Wed, 30 Oct 2024 22:56:58 +0000 (22:56 +0000)] 
GH-126205: Fix conversion of UNC paths to file URIs (#126208)

File URIs for Windows UNC paths should begin with two slashes, not four.

12 months agogh-121267: Improve performance of tarfile (#121267) (#121269)
Johan Förberg [Wed, 30 Oct 2024 22:08:30 +0000 (23:08 +0100)] 
gh-121267: Improve performance of tarfile (#121267) (#121269)

Tarfile in the default write mode spends much of its time resolving UIDs
into usernames and GIDs into group names. By caching these mappings, a
significant speedup can be achieved.

In my simple benchmark[1], this extra caching speeds up tarfile by 8x.

[1] https://gist.github.com/jforberg/86af759c796199740c31547ae828aef2

---------

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
12 months agogh-125674: Doc: Fix type of `newfunc` first parameter (GH-125675)
Richard Hansen [Wed, 30 Oct 2024 20:27:37 +0000 (16:27 -0400)] 
gh-125674: Doc: Fix type of `newfunc` first parameter (GH-125675)

* gh-125674: Doc: Fix type of `newfunc` first parameter

* fixup! gh-125674: Doc: Fix type of `newfunc` first parameter

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
12 months agogh-114990: Add missing mixin methods in collections.abc's document (GH-114991)
AN Long [Wed, 30 Oct 2024 20:17:20 +0000 (04:17 +0800)] 
gh-114990: Add missing mixin methods in collections.abc's document (GH-114991)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agogh-125315: Avoid crashing in _wmimodule due to slow WMI calls on some Windows machine...
Steve Dower [Wed, 30 Oct 2024 19:59:51 +0000 (19:59 +0000)] 
gh-125315: Avoid crashing in _wmimodule due to slow WMI calls on some Windows machines (GH-126141)

12 months agoGH-125498: Update JIT builds to use LLVM 19 and preserve_none (GH-125499)
Savannah Ostrowski [Wed, 30 Oct 2024 19:03:31 +0000 (12:03 -0700)] 
GH-125498: Update JIT builds to use LLVM 19 and preserve_none (GH-125499)

12 months agogh-126055: Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtre...
Victor Wheeler [Wed, 30 Oct 2024 18:22:58 +0000 (12:22 -0600)] 
gh-126055:  Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm (GH-126067)

* gh-126055:  Add omitted command (in docs [os.walk]) for code to fulfill `shutil.rmtree` algorithm.

Resolves #126055

* gh-126055:  Fix omitted code highlighting

12 months agogh-60712: Include the "object" type in the lists of documented types (GH-103036)
Furkan Onder [Wed, 30 Oct 2024 18:20:02 +0000 (21:20 +0300)] 
gh-60712: Include the "object" type in the lists of documented types (GH-103036)

* add test for the predefined object's attributes

* Include the "object" type in the lists of documented types

* remove 'or' from augment tuple

* 📜🤖 Added by blurb_it.

* Add cross-reference to news

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Fix format for the function parameter

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Add space

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* add reference for the 'object'

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* add reference for NotImplemented

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Change ref:`string <textseq>`  as class:`str`

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* remove hyphen from `newly-created`

* Update Doc/reference/datamodel.rst

'dictionaries' to 'dict'

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Update predefined attribute types in testPredefinedAttrs

* Change `universal type` as `top type`

* Don't mention about the top type

* Update the description of richcmpfuncs

* Update Doc/library/stdtypes.rst

Co-authored-by: Éric <merwok@netwok.org>
* Revert: Hierarchy Section in Data Model Documentation

* Revert to original explanations of __new__ and __init__ methods in datamodel.rst for improved clarity.

* Update Doc/reference/datamodel.rst

Co-authored-by: Éric <merwok@netwok.org>
* Remove blank line

Co-authored-by: Éric <merwok@netwok.org>
* Use ref:`str <textseq>` instead of :class:`str

Co-authored-by: Éric <merwok@netwok.org>
* Revert changes the description of Other Built-in Types in stdtypes.rst

* Update Doc/reference/datamodel.rst

Co-authored-by: Éric <merwok@netwok.org>
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agoFix incorrect indentation in importlib.metadata.rst (GH-126189)
Rafael Fontenelle [Wed, 30 Oct 2024 17:46:09 +0000 (14:46 -0300)] 
Fix incorrect indentation in importlib.metadata.rst (GH-126189)

12 months agogh-85583: Add f-string index in tutorial/inputoutput.rst (GH-21681)
amaajemyfren [Wed, 30 Oct 2024 17:26:29 +0000 (20:26 +0300)] 
gh-85583: Add f-string index in tutorial/inputoutput.rst  (GH-21681)

* bpo-41411 fstring index in tutorial/inputoutput

To assist in searching for fstrings I have added an index

* Add newline

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months agogh-126068: Fix exceptions in the argparse module (GH-126069)
Serhiy Storchaka [Wed, 30 Oct 2024 16:14:27 +0000 (18:14 +0200)] 
gh-126068: Fix exceptions in the argparse module (GH-126069)

* Only error messages for ArgumentError and ArgumentTypeError are now
  translated.
* ArgumentError is now only used for command line errors, not for logical
  errors in the program.
* TypeError is now raised instead of ValueError for some logical errors.

12 months agogh-125669: Do not run `-ugui` tests by default on `make test` (#125730)
sobolevn [Wed, 30 Oct 2024 14:14:22 +0000 (17:14 +0300)] 
gh-125669: Do not run `-ugui` tests by default on `make test` (#125730)

Adds `make ci` target for use in CI and keeping `make test` for the local development.

12 months agogh-91962: Fix `hstrerror` detection issues on Solaris (GH-91963)
Jakub Kulík [Wed, 30 Oct 2024 12:19:44 +0000 (13:19 +0100)] 
gh-91962: Fix `hstrerror` detection issues on Solaris (GH-91963)

12 months agogh-125206: Correct detection of complex numbers support in libffi (#126104)
Sergey B Kirpichev [Wed, 30 Oct 2024 09:12:39 +0000 (12:12 +0300)] 
gh-125206: Correct detection of complex numbers support in libffi (#126104)

12 months agogh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)
Xuanteng Huang [Wed, 30 Oct 2024 09:01:09 +0000 (17:01 +0800)] 
gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)

12 months agogh-126071: Improve formatting of the argparse documentation (GH-126073)
Serhiy Storchaka [Wed, 30 Oct 2024 08:50:12 +0000 (10:50 +0200)] 
gh-126071: Improve formatting of the argparse documentation (GH-126073)

* Use appropriate roles for ArgumentParser, Action, etc.
* Remove superfluous repeated links.
* Explicitly document signatures and add index entries for some methods
  and classes.
* Make it more clear that some parameters are keyword-only.
* Fix some minor errors.

12 months agogh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437)
Daniel Ruf [Wed, 30 Oct 2024 00:36:18 +0000 (01:36 +0100)] 
gh-118633: Add warning regarding the unsafe usage of eval and exec (GH-118437)

* Add warning regarding the unsafe usage of eval

* Add warning regarding the unsafe usage of exec

* Move warning under parameters table

* Use suggested shorter text

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Use suggested shorter text

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Improve wording as suggested

---------

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
12 months agogh-58032: Docs: Sort argparse alphabetically (GH-125871)
Hugo van Kemenade [Wed, 30 Oct 2024 00:13:11 +0000 (02:13 +0200)] 
gh-58032: Docs: Sort argparse alphabetically (GH-125871)

Sort argparse alphabetically

12 months agogh-124855: Don't allow the JIT and perf support to be active at the same time (#124856)
Pablo Galindo Salgado [Wed, 30 Oct 2024 00:12:45 +0000 (00:12 +0000)] 
gh-124855: Don't allow the JIT and perf support to be active at the same time (#124856)

12 months agodocs: restore an anchor to for/else (#126154)
Ned Batchelder [Wed, 30 Oct 2024 00:11:50 +0000 (20:11 -0400)] 
docs: restore an anchor to for/else (#126154)

12 months agogh-126139: Improve error message location for future statement with unknown feature...
Brian Schubert [Tue, 29 Oct 2024 23:57:59 +0000 (19:57 -0400)] 
gh-126139: Improve error message location for future statement with unknown feature (#126140)

12 months agogh-125588: Teach the python PEG generator the new f-string tokens (#125589)
Pablo Galindo Salgado [Tue, 29 Oct 2024 23:40:12 +0000 (23:40 +0000)] 
gh-125588: Teach the python PEG generator the new f-string tokens (#125589)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
12 months agoDoc: Note that pydoc uses and prefers ``MANPAGER`` (#125362)
Matthieu Ancellin [Tue, 29 Oct 2024 23:12:02 +0000 (00:12 +0100)] 
Doc: Note that pydoc uses and prefers ``MANPAGER`` (#125362)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agobpo-41793: Fix an inaccuracy about reflected methods in datamodel docs (GH-22257)
Wim Jeantine-Glenn [Tue, 29 Oct 2024 23:02:27 +0000 (18:02 -0500)] 
bpo-41793: Fix an inaccuracy about reflected methods in datamodel docs (GH-22257)

* Qualifying that the right operand's type must be a *strict* subclass for the reflected method to take precedence avoids an edge case / counter-example when the types are actually equal.

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
12 months agogh-116938: Fix `dict.update` docstring and remove erraneous full stop from `dict...
Prometheus3375 [Tue, 29 Oct 2024 23:00:04 +0000 (02:00 +0300)] 
gh-116938: Fix `dict.update` docstring and remove erraneous full stop from `dict` documentation (#125421)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agogh-126146: Remove ``__cmp__`` method from tests (#126147)
Kirill Podoprigora [Tue, 29 Oct 2024 22:47:26 +0000 (00:47 +0200)] 
gh-126146: Remove ``__cmp__`` method from tests (#126147)

Remove ``__cmp__`` method from the tests because it was removed in 3.0 version.

12 months agogh-124932: Distinguish build prefix from host prefix in cross builds (#124933)
Hood Chatham [Tue, 29 Oct 2024 21:45:49 +0000 (22:45 +0100)] 
gh-124932: Distinguish build prefix from host prefix in cross builds (#124933)

In Emscripten and other cross builds, the build file system and the host file
system look different. For instance, we may want to install into
`cross-build/$TARGET/lib`, and then mount that as `/lib` in the host file
system. This change adds a distinction between:

* `prefix` -- the path in the build file system where we want to install the files
* `host_prefix` -- the path in the host file system where getpath.c will look for the files

And similarly for `exec_prefix` and `host_exec_prefix`. At present, this is only
used for Emscripten.

12 months agoGH-125866: Improve tests for `pathname2url()` and `url2pathname()` (#125993)
Barney Gale [Tue, 29 Oct 2024 20:44:57 +0000 (20:44 +0000)] 
GH-125866: Improve tests for `pathname2url()` and `url2pathname()` (#125993)

Merge `URL2PathNameTests` and `PathName2URLTests` test cases (which test
only the Windows-specific implementations from `nturl2path`) into the main
`Pathname_Tests` test case for these functions.

Copy/port some test cases for `pathlib.Path.as_uri()` and `from_uri()`.

12 months agogh-126084: Fix venvwlauncher.exe to run pythonw.exe (GH-126088)
Christian Ullrich [Tue, 29 Oct 2024 19:52:52 +0000 (20:52 +0100)] 
gh-126084: Fix venvwlauncher.exe to run pythonw.exe (GH-126088)

12 months agoAdd lightweight comments to conf.py and update docs readme (GH-126100)
Carol Willing [Tue, 29 Oct 2024 17:45:03 +0000 (10:45 -0700)] 
Add lightweight comments to conf.py and update docs readme (GH-126100)

* Update contributing contact info in readme

* Add lightweight comments to improve docs workflow understanding

* Apply code review suggestions from @hugovk

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* Add code review suggestion from @AA-Turner

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Update Doc/conf.py

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Update Doc/conf.py

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Update Doc/conf.py

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: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
12 months agogh-118423: Add `INSTRUCTION_SIZE` macro to code generator (GH-125467)
Tomas R. [Tue, 29 Oct 2024 17:25:05 +0000 (18:25 +0100)] 
gh-118423: Add `INSTRUCTION_SIZE` macro to code generator (GH-125467)

12 months agogh-126105: Fix crash in `ast` module, when `._fields` is deleted (#126115)
sobolevn [Tue, 29 Oct 2024 15:42:48 +0000 (18:42 +0300)] 
gh-126105: Fix crash in `ast` module, when `._fields` is deleted (#126115)

Previously, if the `ast.AST._fields` attribute was deleted, attempts to create a new `as`t node would crash due to the assumption that `_fields` always had a non-NULL value. Now it has been fixed by adding an extra check to ensure that `_fields` does not have a NULL value (this can happen when you manually remove `_fields` attribute).

12 months agogh-122767: document "new style" formatting for complexes (GH-122848)
Sergey B Kirpichev [Tue, 29 Oct 2024 14:36:18 +0000 (17:36 +0300)] 
gh-122767: document "new style" formatting for complexes (GH-122848)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months agoGH-125837: Split `LOAD_CONST` into three. (GH-125972)
Mark Shannon [Tue, 29 Oct 2024 11:15:42 +0000 (11:15 +0000)] 
GH-125837: Split `LOAD_CONST` into three. (GH-125972)

* Add LOAD_CONST_IMMORTAL opcode

* Add LOAD_SMALL_INT opcode

* Remove RETURN_CONST opcode

12 months agotomllib: Add a comment about implicit lru_cache bound (GH-126078)
Taneli Hukkinen [Tue, 29 Oct 2024 10:36:14 +0000 (12:36 +0200)] 
tomllib: Add a comment about implicit lru_cache bound (GH-126078)

12 months agogh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (#126111)
sobolevn [Tue, 29 Oct 2024 09:03:18 +0000 (12:03 +0300)] 
gh-126106: Fix `NULL` possible derefrence in `Modules/_ssl.c` (#126111)

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