]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
12 months agogh-126579: Adapt sys.audit() to Argument Clinic (GH-126580)
Serhiy Storchaka [Fri, 8 Nov 2024 13:11:44 +0000 (15:11 +0200)] 
gh-126579: Adapt sys.audit() to Argument Clinic (GH-126580)

12 months agoGH-107803: use circular double linked list for tasks in `_asyncio` (#126577)
Kumar Aditya [Fri, 8 Nov 2024 12:51:11 +0000 (18:21 +0530)] 
GH-107803: use circular double linked list for tasks in `_asyncio` (#126577)

12 months agogh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564)
Serhiy Storchaka [Fri, 8 Nov 2024 12:23:50 +0000 (14:23 +0200)] 
gh-122943: Add the varpos parameter in _PyArg_UnpackKeywords (GH-126564)

Remove _PyArg_UnpackKeywordsWithVararg.
Add comments for integer arguments of _PyArg_UnpackKeywords.

12 months agogh-122943: Move code generation for var-positional parameter to converters (GH-126575)
Serhiy Storchaka [Fri, 8 Nov 2024 12:12:15 +0000 (14:12 +0200)] 
gh-122943: Move code generation for var-positional parameter to converters (GH-126575)

12 months agogh-89640: Restore configure error message on failure to detect float word order ...
Hood Chatham [Fri, 8 Nov 2024 11:57:17 +0000 (12:57 +0100)] 
gh-89640: Restore configure error message on failure to detect float word order (#126569)

Before #126387, if we didn't detect float word order we'd raise the following
configure error:

    Unknown float word ordering. You need to manually preset
    ax_cv_c_float_words_bigendian=no (or yes) according to your system.

This puts it back (except for ARM or WASM, which as hardcoded).

12 months agogh-126171: fix possible null dereference in _imp_find_frozen_impl (#126566)
Valery Fedorenko [Fri, 8 Nov 2024 10:19:15 +0000 (13:19 +0300)] 
gh-126171: fix possible null dereference in _imp_find_frozen_impl (#126566)

12 months agogh-122943: Remove the object converter for var-positional parameter (GH-126560)
Serhiy Storchaka [Fri, 8 Nov 2024 05:41:54 +0000 (07:41 +0200)] 
gh-122943: Remove the object converter for var-positional parameter (GH-126560)

12 months agogh-120017: use 'do-while(0)' in some `{codegen,compile}.c` multi-line macros (#120018)
Bénédikt Tran [Thu, 7 Nov 2024 23:03:11 +0000 (00:03 +0100)] 
gh-120017: use 'do-while(0)' in some `{codegen,compile}.c` multi-line macros (#120018)

12 months agoGH-123877: default to `wasm32-wasip1` instead of `wasm32-wasi` to be more specific...
Brett Cannon [Thu, 7 Nov 2024 21:40:56 +0000 (13:40 -0800)] 
GH-123877: default to `wasm32-wasip1` instead of `wasm32-wasi` to be more specific (GH-126552)

Eventually wasm32-wasi will represent WASI 1.0, and so it's currently deprecated so it can be used for that eventual purpose. wasm32-wasip1 is also more specific to what version of WASI is currently supported.

---------

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
12 months agogh-122943: Rework support of var-positional parameter in Argument Clinic (GH-122945)
Serhiy Storchaka [Thu, 7 Nov 2024 21:40:03 +0000 (23:40 +0200)] 
gh-122943: Rework support of var-positional parameter in Argument Clinic (GH-122945)

Move creation of a tuple for var-positional parameter out of
_PyArg_UnpackKeywordsWithVararg().
Merge _PyArg_UnpackKeywordsWithVararg() with _PyArg_UnpackKeywords().
Add a new parameter in _PyArg_UnpackKeywords().

The "parameters" and "converters" attributes of ParseArgsCodeGen no
longer contain the var-positional parameter. It is now available as the
"varpos" attribute. Optimize code generation for var-positional
parameter and reuse the same generating code for functions with and without
keyword parameters.

Add special converters for var-positional parameter. "tuple" represents it as
a Python tuple and "array" represents it as a continuous array of PyObject*.
"object" is a temporary alias of "tuple".

12 months agoGH-126464 Fix JIT CI on aarch64-apple-darwin (GH-126494)
alm [Thu, 7 Nov 2024 18:55:31 +0000 (20:55 +0200)] 
GH-126464 Fix JIT CI on aarch64-apple-darwin (GH-126494)

12 months agogh-126298: Don't deduplicate slice constants based on equality (#126398)
Michael Droettboom [Thu, 7 Nov 2024 16:39:23 +0000 (11:39 -0500)] 
gh-126298: Don't deduplicate slice constants based on equality (#126398)

* gh-126298: Don't deduplicated slice constants based on equality

* NULL check for PySlice_New

* Fix refcounting

* Fix refcounting some more

* Fix refcounting

* Make tests more complete

* Fix tests

12 months agogh-76785: Minor Cleanup of "Cross-interpreter" Code (gh-126457)
Eric Snow [Thu, 7 Nov 2024 16:32:42 +0000 (09:32 -0700)] 
gh-76785: Minor Cleanup of "Cross-interpreter" Code (gh-126457)

The primary objective here is to allow some later changes to be cleaner. Mostly this involves renaming things and moving a few things around.

* CrossInterpreterData -> XIData
* crossinterpdatafunc -> xidatafunc
* split out pycore_crossinterp_data_registry.h
* add _PyXIData_lookup_t

12 months agoChore: Fix typo in `pyarena.c` (#126527)
Aditya Borikar [Thu, 7 Nov 2024 15:37:41 +0000 (07:37 -0800)] 
Chore: Fix typo in `pyarena.c` (#126527)

12 months agogh-126529: Update devguide links to relative filenames in InternalDocs (#126530)
Valerii [Thu, 7 Nov 2024 15:35:29 +0000 (20:35 +0500)] 
gh-126529: Update devguide links to relative filenames in InternalDocs (#126530)

Update devguide links to relative filenames in InternalDocs/parser.md
and InternalDocs/compiler.md.

12 months agoDoc: C API: Demote sections to subsections for consistency (#126535)
Richard Hansen [Thu, 7 Nov 2024 15:29:31 +0000 (10:29 -0500)] 
Doc: C API: Demote sections to subsections for consistency (#126535)

The entire file should be a single section; the headings below the
first heading should be subsections.

12 months agoGH-126222: Fix `_PyUop_num_popped` (GH-126507)
Mark Shannon [Thu, 7 Nov 2024 10:48:27 +0000 (10:48 +0000)] 
GH-126222: Fix `_PyUop_num_popped` (GH-126507)

12 months agogh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler...
Petr Viktorin [Thu, 7 Nov 2024 10:07:02 +0000 (11:07 +0100)] 
gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503)

If `read()` in the ConnectionHandler thread raises `OSError` (except `ConnectionError`),
the ConnectionHandler shuts down the entire ThreadedEchoServer,
preventing further connections.
It also does that for `EPROTOTYPE` in `wrap_conn`.

As far as I can see, this is done to avoid the server thread getting stuck,
forgotten, in its accept loop. However, since 2011 (5b95eb90a7167285b6544b50865227c584943c9a)
the server is used as a context manager, and its `__exit__` does `stop()` and `join()`.
(I'm not sure if we *always* used `with` since that commit, but currently we do.)

Make sure that the context manager *is* used, and remove the `server.stop()`
calls from ConnectionHandler.

12 months agogh-126499: test_ssl: Don't assume err.reason is a string (GH-126501)
Petr Viktorin [Thu, 7 Nov 2024 10:06:27 +0000 (11:06 +0100)] 
gh-126499: test_ssl: Don't assume err.reason is a string (GH-126501)

The skipping machinery called `getattr(err, "reason", "")` on an arbitrary
exception. As intermittent Buildbot failures show, sometimes it's set
to None.

Convert it to string for this specific check.

12 months agogh-48020: [docs] Remove the logging howto suggested future FileHandler multiprocessin...
Gregory P. Smith [Thu, 7 Nov 2024 09:57:01 +0000 (01:57 -0800)] 
gh-48020: [docs] Remove the logging howto suggested future FileHandler multiprocessing support (GH-126531)

Docs: Remove the logging howto potential promise of multiprocessing support in the future.

Stick to the facts and suggestions, don't provide hope where we're not going to
implement complexity that we'd rather the user implement themselves when
needed.

12 months agogh-96398: Improve accuracy of compiler checks in configure.ac (#117815)
Erlend E. Aasland [Thu, 7 Nov 2024 09:49:58 +0000 (10:49 +0100)] 
gh-96398: Improve accuracy of compiler checks in configure.ac (#117815)

The following variables are now used in compiler checks:
- $ac_cv_gcc_compat is set to 'yes' for GCC compatible compilers
  (the C preprocessor defines the __GNUC__ macro)
- for compiler basename checks, use $CC_BASENAME
  (may contain platform triplets)
- for the rest, use $ac_cv_cc_name
  (does not contain platform triplets)

12 months agogh-125679: multiprocessing Lock and RLock - fix invalid representation string on...
Duprat [Thu, 7 Nov 2024 08:10:57 +0000 (09:10 +0100)] 
gh-125679: multiprocessing Lock and RLock - fix invalid representation string on MacOSX. (#125680)

12 months agoCleanup multiprocessing comment and unusual import error message (#126532)
Gregory P. Smith [Thu, 7 Nov 2024 08:06:14 +0000 (00:06 -0800)] 
Cleanup multiprocessing comment and unusual import error message (#126532)

Define constants as constants rather than calling `list(range(2))`.
Explain which values must remain in sync via comments.

12 months agogh-125926: Fix urllib.parse.urljoin() for base URI with undefined authority (GH-125989)
Serhiy Storchaka [Thu, 7 Nov 2024 07:09:59 +0000 (09:09 +0200)] 
gh-125926: Fix urllib.parse.urljoin() for base URI with undefined authority (GH-125989)

Although this goes beyond the application of RFC 3986, urljoin()
should support relative base URIs for backward compatibility.

12 months agogh-125631: Enable setting persistent_id and persistent_load of pickler and unpickler...
Serhiy Storchaka [Thu, 7 Nov 2024 06:53:02 +0000 (08:53 +0200)] 
gh-125631: Enable setting persistent_id and persistent_load of pickler and unpickler (GH-125752)

pickle.Pickler.persistent_id and pickle.Unpickler.persistent_load can
again be overridden as instance attributes.

12 months agoGH-126458: disable SIMD for HACL under WASI (#126512)
Brett Cannon [Wed, 6 Nov 2024 22:33:46 +0000 (14:33 -0800)] 
GH-126458: disable SIMD for HACL under WASI (#126512)

Requires an extra `-msimd128` flag and the `*mmintrin.h` header files are exclusive to x86-family CPUs.

12 months agogh-126451: Register contextvars.Context to collections.abc.Mapping (#126452)
Stephen Morton [Wed, 6 Nov 2024 22:12:45 +0000 (14:12 -0800)] 
gh-126451: Register contextvars.Context to collections.abc.Mapping (#126452)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months agogh-126509: Update link to CPython's grammar docs in InternalDocs/parser.md (#126510)
Valerii [Wed, 6 Nov 2024 22:11:48 +0000 (03:11 +0500)] 
gh-126509: Update link to CPython's grammar docs in InternalDocs/parser.md (#126510)

12 months agogh-126513: Use helpers for `_Py_Specialize_ConstainsOp` (#126517)
Kirill Podoprigora [Wed, 6 Nov 2024 21:52:15 +0000 (23:52 +0200)] 
gh-126513: Use helpers for `_Py_Specialize_ConstainsOp` (#126517)

* Use helpers for _Py_Specialize_ConstainsOp

* Remove unnecessary variable

12 months agogh-126489: Do not call persistent_id() for a persistent id in Python pickle (GH-126490)
Serhiy Storchaka [Wed, 6 Nov 2024 20:25:14 +0000 (22:25 +0200)] 
gh-126489: Do not call persistent_id() for a persistent id in Python pickle (GH-126490)

12 months agogh-115999: Move specializer test from test_dis to test_opcache (gh-126498)
Donghee Na [Wed, 6 Nov 2024 20:23:47 +0000 (05:23 +0900)] 
gh-115999: Move specializer test from test_dis to test_opcache (gh-126498)

12 months agogh-115999: Introduce helpers for (un)specializing instructions (#126414)
mpage [Wed, 6 Nov 2024 20:04:04 +0000 (12:04 -0800)] 
gh-115999: Introduce helpers for (un)specializing instructions (#126414)

Introduce helpers for (un)specializing instructions

Consolidate the code to specialize/unspecialize instructions into
two helper functions and use them in `_Py_Specialize_BinaryOp`.
The resulting code is more concise and keeps all of the logic at
the point where we decide to specialize/unspecialize an instruction.

12 months agogh-126461: Fix _Unpickler_ReadFromFile() error handling (#126485)
Victor Stinner [Wed, 6 Nov 2024 13:24:46 +0000 (14:24 +0100)] 
gh-126461: Fix _Unpickler_ReadFromFile() error handling (#126485)

Handle _Unpickler_SetStringInput() failure.

12 months agogh-122838: Document missing opcodes (#123073)
Kamil Turek [Wed, 6 Nov 2024 12:16:13 +0000 (13:16 +0100)] 
gh-122838: Document missing opcodes (#123073)

12 months agogh-126455: Disallow _ssl.SSLSocket instantiation (#126481)
Victor Stinner [Wed, 6 Nov 2024 10:59:39 +0000 (11:59 +0100)] 
gh-126455: Disallow _ssl.SSLSocket instantiation (#126481)

Prevent creation of incomplete/invalid _ssl.SSLSocket objects when
created directly.

12 months agogh-126433: Change channel_info.count to int64_t (#126447)
Victor Stinner [Wed, 6 Nov 2024 10:20:17 +0000 (11:20 +0100)] 
gh-126433: Change channel_info.count to int64_t (#126447)

Fix compiler warnings on 32-bit Windows: change channel_info.count
type from Py_ssize_t to int64_t in _interpchannelsmodule.c.

12 months agogh-120754: Add to `io` optimization to what's new (#126466)
Cody Maloney [Wed, 6 Nov 2024 06:54:40 +0000 (22:54 -0800)] 
gh-120754: Add to `io` optimization to what's new (#126466)

12 months agogh-115999: Add free-threaded specialization for CONTAINS_OP (gh-126450)
Donghee Na [Wed, 6 Nov 2024 03:35:10 +0000 (12:35 +0900)] 
gh-115999: Add free-threaded specialization for CONTAINS_OP (gh-126450)

- The specialization logic determines the appropriate specialization using only the operand's type, which is safe to read non-atomically (changing it requires stopping the world). We are guaranteed that the type will not change in between when it is checked and when we specialize the bytecode because the types involved are immutable (you cannot assign to `__class__` for exact instances of `dict`, `set`, or `frozenset`). The bytecode is mutated atomically using helpers.
- The specialized instructions rely on the operand type not changing in between the `DEOPT_IF` checks and the calls to the appropriate type-specific helpers (e.g. `_PySet_Contains`). This is a correctness requirement in the default builds and there are no changes to the opcodes in the free-threaded builds that would invalidate this.

12 months agoGH-126464: Temporarily disable `aarch64-apple-darwin` JIT CI jobs (gh-126465)
Brandt Bucher [Wed, 6 Nov 2024 03:09:04 +0000 (19:09 -0800)] 
GH-126464: Temporarily disable `aarch64-apple-darwin` JIT CI jobs (gh-126465)

* Temporarily disable aarch64-apple-darwin JIT CI jobs

* Also up here

12 months agogh-70764: inspect.getclosurevars now identifies global variables with LOAD_GLOBAL...
blhsing [Tue, 5 Nov 2024 23:53:54 +0000 (07:53 +0800)] 
gh-70764: inspect.getclosurevars now identifies global variables with LOAD_GLOBAL (#120143)

12 months agogh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566)
Damien [Tue, 5 Nov 2024 23:29:21 +0000 (07:29 +0800)] 
gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566)

12 months agoGH-125911: Rename big trampoline to "shim" (GH-126339)
Savannah Ostrowski [Tue, 5 Nov 2024 23:26:46 +0000 (15:26 -0800)] 
GH-125911: Rename big trampoline to "shim" (GH-126339)

12 months agogh-122544: Change OS image in Azure pipeline to Ubuntu 24.04 (#125344)
Damien [Tue, 5 Nov 2024 23:10:12 +0000 (07:10 +0800)] 
gh-122544: Change OS image in Azure pipeline to Ubuntu 24.04 (#125344)

12 months agopathlib ABCs: defer path joining (#126409)
Barney Gale [Tue, 5 Nov 2024 21:19:36 +0000 (21:19 +0000)] 
pathlib ABCs: defer path joining (#126409)

Defer joining of path segments in the private `PurePathBase` ABC. The new
behaviour matches how the public `PurePath` class handles path segments.

This removes a hard-to-grok difference between the ABCs and the main
classes. It also slightly reduces the size of `PurePath` objects by
eliminating a `_raw_path` slot.

12 months agogh-126074: Removes unnecessary DLLs from embeddable package (GH-126143)
Steve Dower [Tue, 5 Nov 2024 20:43:52 +0000 (20:43 +0000)] 
gh-126074: Removes unnecessary DLLs from embeddable package (GH-126143)

12 months agoGH-124985: Document that `pathlib.Path.copy()` uses copy-on-write. (#125861)
Barney Gale [Tue, 5 Nov 2024 18:43:43 +0000 (18:43 +0000)] 
GH-124985: Document that `pathlib.Path.copy()` uses copy-on-write. (#125861)

12 months agogh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg...
Valery Fedorenko [Tue, 5 Nov 2024 17:34:33 +0000 (20:34 +0300)] 
gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (#126239)

* Replace Py_DECREF by Py_XDECREF

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months agogh-126433: Fix compiler warnings on 32-bit Windows (#126444)
Victor Stinner [Tue, 5 Nov 2024 15:05:13 +0000 (16:05 +0100)] 
gh-126433: Fix compiler warnings on 32-bit Windows (#126444)

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)