]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
20 months agogh-112529: Make the GC scheduling thread-safe (#114880)
Sam Gross [Fri, 16 Feb 2024 16:22:27 +0000 (11:22 -0500)] 
gh-112529: Make the GC scheduling thread-safe (#114880)

The GC keeps track of the number of allocations (less deallocations)
since the last GC. This buffers the count in thread-local state and uses
atomic operations to modify the per-interpreter count. The thread-local
buffering avoids contention on shared state.

A consequence is that the GC scheduling is not as precise, so
"test_sneaky_frame_object" is skipped because it requires that the GC be
run exactly after allocating a frame object.

20 months agogh-115480: Minor fixups in int constant propagation (GH-115507)
Ken Jin [Fri, 16 Feb 2024 14:59:43 +0000 (22:59 +0800)] 
gh-115480: Minor fixups in int constant propagation (GH-115507)

20 months agogh-102013: Move PyUnstable_GC_VisitObjects() to Include/cpython/objimpl.h (#115560)
Victor Stinner [Fri, 16 Feb 2024 14:49:13 +0000 (15:49 +0100)] 
gh-102013: Move PyUnstable_GC_VisitObjects() to Include/cpython/objimpl.h (#115560)

Include/objimpl.h must only contain the limited C API, whereas
PyUnstable_GC_VisitObjects() is excluded from the limited C API.

20 months agoAdd `Python/tier2_redundancy_eliminator_cases.c.h` to `.gitattributes` as generated...
Nikita Sobolev [Fri, 16 Feb 2024 13:10:21 +0000 (16:10 +0300)] 
Add `Python/tier2_redundancy_eliminator_cases.c.h` to `.gitattributes` as generated (#115551)

20 months agogh-69990: Make Profile.print_stats support sorting by multiple values (GH-104590)
Furkan Onder [Fri, 16 Feb 2024 12:03:46 +0000 (15:03 +0300)] 
gh-69990: Make Profile.print_stats support sorting by multiple values (GH-104590)

Co-authored-by: Chiu-Hsiang Hsu
20 months agogh-113317: Argument Clinic: move C/Py identifier helpers into libclinic (#115520)
Erlend E. Aasland [Fri, 16 Feb 2024 06:42:15 +0000 (07:42 +0100)] 
gh-113317: Argument Clinic: move C/Py identifier helpers into libclinic (#115520)

20 months agogh-115503: Fix `run_presite` error handling (#115504)
Nikita Sobolev [Fri, 16 Feb 2024 05:33:17 +0000 (08:33 +0300)] 
gh-115503: Fix `run_presite` error handling (#115504)

20 months agogh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist (gh-115505)
Donghee Na [Fri, 16 Feb 2024 01:01:36 +0000 (10:01 +0900)] 
gh-111968: Split _Py_dictkeys_freelist out of _Py_dict_freelist (gh-115505)

20 months agogh-113743: Use per-interpreter locks for types (#115541)
Dino Viehland [Fri, 16 Feb 2024 00:28:31 +0000 (16:28 -0800)] 
gh-113743: Use per-interpreter locks for types (#115541)

Move type-lock to per-interpreter lock to avoid heavy contention in interpreters test

20 months agogh-114572: Fix locking in cert_store_stats and get_ca_certs (#114573)
David Benjamin [Fri, 16 Feb 2024 00:24:51 +0000 (19:24 -0500)] 
gh-114572: Fix locking in cert_store_stats and get_ca_certs (#114573)

* gh-114572: Fix locking in cert_store_stats and get_ca_certs

cert_store_stats and get_ca_certs query the SSLContext's X509_STORE with
X509_STORE_get0_objects, but reading the result requires a lock. See
https://github.com/openssl/openssl/pull/23224 for details.

Instead, use X509_STORE_get1_objects, newly added in that PR.
X509_STORE_get1_objects does not exist in current OpenSSLs, but we can
polyfill it with X509_STORE_lock and X509_STORE_unlock.

* Work around const-correctness problem

* Add missing X509_STORE_get1_objects failure check

* Add blurb

20 months agogh-113317: Argument Clinic: move linear_format into libclinic (#115518)
Erlend E. Aasland [Thu, 15 Feb 2024 22:52:20 +0000 (23:52 +0100)] 
gh-113317: Argument Clinic: move linear_format into libclinic (#115518)

20 months agogh-115498: Fix `SET_COUNT` error handling in `_xxinterpchannelsmodule` (#115499)
Nikita Sobolev [Thu, 15 Feb 2024 21:31:23 +0000 (00:31 +0300)] 
gh-115498: Fix `SET_COUNT` error handling in `_xxinterpchannelsmodule` (#115499)

20 months agoMerge branch 'main' of https://github.com/python/cpython
Thomas Wouters [Thu, 15 Feb 2024 20:53:06 +0000 (21:53 +0100)] 
Merge branch 'main' of https://github.com/python/cpython

20 months agoPost 3.13.0a4
Thomas Wouters [Thu, 15 Feb 2024 20:52:49 +0000 (21:52 +0100)] 
Post 3.13.0a4

20 months agogh-113743: Make the MRO cache thread-safe in free-threaded builds (#113930)
Dino Viehland [Thu, 15 Feb 2024 18:54:57 +0000 (10:54 -0800)] 
gh-113743: Make the MRO cache thread-safe in free-threaded builds (#113930)

Makes _PyType_Lookup thread safe, including:
    Thread safety of the underlying cache.
    Make mutation of mro and type members thread safe
    Also _PyType_GetMRO and _PyType_GetBases are currently returning borrowed references which aren't safe.

20 months agogh-113317: Argument Clinic: inline required_type_for_self_for_parser() in self conver...
Erlend E. Aasland [Thu, 15 Feb 2024 16:03:58 +0000 (17:03 +0100)] 
gh-113317: Argument Clinic: inline required_type_for_self_for_parser() in self converter (#115522)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
20 months agogh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689)
Hugo van Kemenade [Thu, 15 Feb 2024 15:32:33 +0000 (17:32 +0200)] 
gh-100734: What's New in 3.x: Add missing detail from 3.x branch (#114689)

20 months agogh-112433: Add optional _align_ attribute to ctypes.Structure (GH-113790)
monkeyman192 [Thu, 15 Feb 2024 14:40:20 +0000 (01:40 +1100)] 
gh-112433: Add optional _align_ attribute to ctypes.Structure (GH-113790)

20 months agogh-115420: Fix translation of exception hander targets by _testinternalcapi.optimize_...
Irit Katriel [Thu, 15 Feb 2024 14:32:52 +0000 (14:32 +0000)] 
gh-115420: Fix translation of exception hander targets by _testinternalcapi.optimize_cfg. (#115425)

20 months agogh-115376: fix segfault in _testinternalcapi.compiler_codegen on bad input (#115379)
Irit Katriel [Thu, 15 Feb 2024 14:32:21 +0000 (14:32 +0000)] 
gh-115376: fix segfault in _testinternalcapi.compiler_codegen on bad input (#115379)

20 months agogh-115124: Use _PyObject_ASSERT() in gc.c (#115125)
Victor Stinner [Thu, 15 Feb 2024 14:29:42 +0000 (15:29 +0100)] 
gh-115124: Use _PyObject_ASSERT() in gc.c (#115125)

Replace assert() with _PyObject_ASSERT() in gc.c to dump the object
when an assertion fails.

20 months agogh-115347: avoid emitting redundant NOP for the docstring with -OO (#115494)
Irit Katriel [Thu, 15 Feb 2024 14:20:19 +0000 (14:20 +0000)] 
gh-115347: avoid emitting redundant NOP for the docstring with -OO (#115494)

20 months agoPython 3.13.0a4 v3.13.0a4
Thomas Wouters [Thu, 15 Feb 2024 13:30:16 +0000 (14:30 +0100)] 
Python 3.13.0a4

20 months agogh-115432: Add critical section variant that handles a NULL object (#115433)
Sam Gross [Thu, 15 Feb 2024 13:37:54 +0000 (08:37 -0500)] 
gh-115432: Add critical section variant that handles a NULL object (#115433)

This adds `Py_XBEGIN_CRITICAL_SECTION` and
`Py_XEND_CRITICAL_SECTION`, which accept a possibly NULL object as an
argument. If the argument is NULL, then nothing is locked or unlocked.
Otherwise, they behave like `Py_BEGIN/END_CRITICAL_SECTION`.

20 months agogh-115490: Work around test.support.interpreters.channels not handling unloading...
T. Wouters [Thu, 15 Feb 2024 13:24:13 +0000 (14:24 +0100)] 
gh-115490: Work around test.support.interpreters.channels not handling unloading (#115515)

Work around test.support.interpreters.channels not handling unloading, which
regrtest does when running tests sequentially, by explicitly skipping the
unloading of test.support.interpreters and its submodules.

This can be rolled back once test.support.interpreters.channels supports
unloading, if we are keeping sequential runs in the same process around.

20 months agogh-113317: Argument Clinic: remove global clinic instance (#115517)
Erlend E. Aasland [Thu, 15 Feb 2024 13:21:31 +0000 (14:21 +0100)] 
gh-113317: Argument Clinic: remove global clinic instance (#115517)

20 months agogh-113317: Argument Clinic: don't use global state in warn() and fail() (#115510)
Erlend E. Aasland [Thu, 15 Feb 2024 12:22:21 +0000 (13:22 +0100)] 
gh-113317: Argument Clinic: don't use global state in warn() and fail() (#115510)

20 months agogh-113317: Argument Clinic: don't use fail() in CLI (#115513)
Erlend E. Aasland [Thu, 15 Feb 2024 12:10:32 +0000 (13:10 +0100)] 
gh-113317: Argument Clinic: don't use fail() in CLI (#115513)

20 months agobpo-38364: unwrap partialmethods just like we unwrap partials (#16600)
Martijn Pieters [Thu, 15 Feb 2024 11:08:45 +0000 (11:08 +0000)] 
bpo-38364: unwrap partialmethods just like we unwrap partials (#16600)

* bpo-38364: unwrap partialmethods just like we unwrap partials

The inspect.isgeneratorfunction, inspect.iscoroutinefunction and inspect.isasyncgenfunction already unwrap functools.partial objects, this patch adds support for partialmethod objects as well.

Also: Rename _partialmethod to __partialmethod__.
Since we're checking this attribute on arbitrary function-like objects,
we should use the namespace reserved for core Python.

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
20 months agogh-114626: add PyCFunctionFast and PyCFunctionFastWithKeywords (GH-114627)
David Hewitt [Thu, 15 Feb 2024 10:05:20 +0000 (10:05 +0000)] 
gh-114626: add PyCFunctionFast and PyCFunctionFastWithKeywords (GH-114627)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
20 months agogh-114258: Refactor Argument Clinic function name parser (#114930)
Erlend E. Aasland [Thu, 15 Feb 2024 08:45:21 +0000 (09:45 +0100)] 
gh-114258: Refactor Argument Clinic function name parser (#114930)

Refactor state_modulename_name() of the parsing state machine, by
adding helpers for the sections that deal with ...:

1. parsing the function name
2. normalizing "function kind"
3. dealing with cloned functions
4. resolving return converters
5. adding the function to the DSL parser

20 months agogh-112050: Make collections.deque thread-safe in free-threaded builds (#113830)
mpage [Thu, 15 Feb 2024 08:22:47 +0000 (00:22 -0800)] 
gh-112050: Make collections.deque thread-safe in free-threaded builds (#113830)

Use critical sections to make deque methods that operate on mutable
state thread-safe when the GIL is disabled. This is mostly accomplished
by using the @critical_section Argument Clinic directive, though there
are a few places where this was not possible and critical sections had
to be manually acquired/released.

20 months agodocs: use consistent .append() in dis.rst (#115434)
Ned Batchelder [Thu, 15 Feb 2024 07:14:03 +0000 (02:14 -0500)] 
docs: use consistent .append() in dis.rst (#115434)

The STACK variable is described as like a Python list, so pushing to it should be done with .append() consistently throughout.

20 months agogh-115480: Type and constant propagation for int BINARY_OPs (GH-115478)
Ken Jin [Thu, 15 Feb 2024 06:02:18 +0000 (14:02 +0800)] 
gh-115480: Type and constant propagation for int BINARY_OPs (GH-115478)

20 months agoTrigger JIT CI with optimizer files (#115483)
Ken Jin [Thu, 15 Feb 2024 06:01:24 +0000 (14:01 +0800)] 
Trigger JIT CI with optimizer files (#115483)

* Trigger JIT CI with optimizer files

20 months agoGH-113516: don't set `LDSHARED` when building for WASI (GH-115495)
Brett Cannon [Thu, 15 Feb 2024 00:51:23 +0000 (16:51 -0800)] 
GH-113516: don't set `LDSHARED` when building for WASI (GH-115495)

20 months agogh-115482: Assume the Main Interpreter is Always Running "main" (gh-115484)
Eric Snow [Wed, 14 Feb 2024 23:07:22 +0000 (16:07 -0700)] 
gh-115482: Assume the Main Interpreter is Always Running "main" (gh-115484)

This is a temporary fix to unblock embedders that do not call Py_Main().

_PyInterpreterState_IsRunningMain() will always return true for the main interpreter, even in corner cases where it technically should not. The (future) full solution will do the right thing in those corner cases.

20 months agogh-114570: Add PythonFinalizationError exception (#115352)
Victor Stinner [Wed, 14 Feb 2024 22:35:06 +0000 (23:35 +0100)] 
gh-114570: Add PythonFinalizationError exception (#115352)

Add PythonFinalizationError exception. This exception derived from
RuntimeError is raised when an operation is blocked during the Python
finalization.

The following functions now raise PythonFinalizationError, instead of
RuntimeError:

* _thread.start_new_thread()
* subprocess.Popen
* os.fork()
* os.fork1()
* os.forkpty()

Morever, _winapi.Overlapped finalizer now logs an unraisable
PythonFinalizationError, instead of an unraisable RuntimeError.

20 months agogh-112529: Use _PyThread_Id() in mimalloc in free-threaded build (#115488)
Sam Gross [Wed, 14 Feb 2024 21:41:29 +0000 (16:41 -0500)] 
gh-112529: Use _PyThread_Id() in mimalloc in free-threaded build (#115488)

The free-threaded GC uses mimallocs segment thread IDs to restore
the overwritten `ob_tid` thread ids in PyObjects. For that reason, it's
important that PyObjects and mimalloc use the same identifiers.

20 months agogh-115041: Add wrappers that are atomic only in free-threaded builds (#115046)
mpage [Wed, 14 Feb 2024 20:15:05 +0000 (12:15 -0800)] 
gh-115041: Add wrappers that are atomic only in free-threaded builds (#115046)

These are intended to be used in places where atomics are required in
free-threaded builds but not in the default build. We don't want to
introduce the potential performance overhead of an atomic operation in the
default build.

20 months agoAdd myself to various CODEOWNERS (GH-115481)
Ken Jin [Wed, 14 Feb 2024 19:48:11 +0000 (03:48 +0800)] 
Add myself to various CODEOWNERS (GH-115481)

20 months agogh-112302: Move pip SBOM discovery to release-tools (#115360)
Seth Michael Larson [Wed, 14 Feb 2024 19:47:15 +0000 (13:47 -0600)] 
gh-112302: Move pip SBOM discovery to release-tools (#115360)

20 months agoDocs: spell out sentence about ndbm/gdbm file formats (#115470)
Erlend E. Aasland [Wed, 14 Feb 2024 18:03:20 +0000 (19:03 +0100)] 
Docs: spell out sentence about ndbm/gdbm file formats (#115470)

20 months agogh-115441: Fix missing braces warning (#115460)
Sam Gross [Wed, 14 Feb 2024 17:27:39 +0000 (12:27 -0500)] 
gh-115441: Fix missing braces warning (#115460)

Removes `_py_object_state_INIT`. We want to initialize the `object_state` field to zero.

20 months agogh-112087: Make __sizeof__ and listiter_{len, next} to be threadsafe (gh-114843)
Donghee Na [Wed, 14 Feb 2024 17:00:50 +0000 (02:00 +0900)] 
gh-112087: Make __sizeof__ and listiter_{len, next} to be threadsafe (gh-114843)

20 months agogh-115399: Upgrade bundled libexpat to 2.6.0 (#115431)
Seth Michael Larson [Wed, 14 Feb 2024 16:29:06 +0000 (10:29 -0600)] 
gh-115399: Upgrade bundled libexpat to 2.6.0 (#115431)

20 months agogh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH...
kcatss [Wed, 14 Feb 2024 16:08:26 +0000 (01:08 +0900)] 
gh-115243: Fix crash in deque.index() when the deque is concurrently modified (GH-115247)

20 months agoDocs: reword sentences about dbm submodule traits (#114609)
Erlend E. Aasland [Wed, 14 Feb 2024 15:36:13 +0000 (16:36 +0100)] 
Docs: reword sentences about dbm submodule traits (#114609)

Don't repeatedly say that keys and values are coerced into bytes.

20 months agogh-115392: Fix doctest reporting incorrect line numbers for decorated functions ...
Brian Schubert [Wed, 14 Feb 2024 15:01:27 +0000 (10:01 -0500)] 
gh-115392: Fix doctest reporting incorrect line numbers for decorated functions (#115440)

20 months agogh-115403: Remove extra colon after "Examples" in datetime documentation (#115452)
Stanislav Lyu [Wed, 14 Feb 2024 13:52:42 +0000 (16:52 +0300)] 
gh-115403: Remove extra colon after "Examples" in datetime documentation (#115452)

20 months agogh-100414: Make dbm.sqlite3 the preferred dbm backend (#115447)
Erlend E. Aasland [Wed, 14 Feb 2024 13:47:19 +0000 (14:47 +0100)] 
gh-100414: Make dbm.sqlite3 the preferred dbm backend (#115447)

20 months agogh-115450: Fix direct invocation of `test_desctut` (#115451)
Nikita Sobolev [Wed, 14 Feb 2024 13:31:28 +0000 (16:31 +0300)] 
gh-115450: Fix direct invocation of `test_desctut` (#115451)

20 months agogh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable (#115449)
Erlend E. Aasland [Wed, 14 Feb 2024 13:16:09 +0000 (14:16 +0100)] 
gh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable (#115449)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
20 months agogh-100414: Add SQLite backend to dbm (#114481)
Erlend E. Aasland [Wed, 14 Feb 2024 11:14:56 +0000 (12:14 +0100)] 
gh-100414: Add SQLite backend to dbm (#114481)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
20 months agogh-114058: Fix flaky globals to constant test (#115423)
Ken Jin [Wed, 14 Feb 2024 11:12:52 +0000 (19:12 +0800)] 
gh-114058: Fix flaky globals to constant test (#115423)

Co-authored-by: Victor Stinner <vstinner@python.org>
20 months agoftplib docs: `timeout` doesn't have to be a whole number (#115443)
Alex Waygood [Wed, 14 Feb 2024 10:41:17 +0000 (10:41 +0000)] 
ftplib docs: `timeout` doesn't have to be a whole number (#115443)

20 months agoDocs: Use substitutions instead of manual version updates (#115416)
Hugo van Kemenade [Wed, 14 Feb 2024 06:55:00 +0000 (08:55 +0200)] 
Docs: Use substitutions instead of manual version updates (#115416)

20 months agogh-111968: Rename freelist related struct names to Eric's suggestion (gh-115329)
Donghee Na [Wed, 14 Feb 2024 00:32:51 +0000 (09:32 +0900)] 
gh-111968: Rename freelist related struct names to Eric's suggestion (gh-115329)

20 months agogh-115421: Update the list of installed test subdirectories. (#115422)
T. Wouters [Tue, 13 Feb 2024 23:58:49 +0000 (00:58 +0100)] 
gh-115421: Update the list of installed test subdirectories. (#115422)

Update the list of installed test subdirectories with all newly added
subdirectories of Lib/test, so that the tests in those directories are
properly installed.

20 months agogh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424)
Eric Snow [Tue, 13 Feb 2024 21:56:49 +0000 (14:56 -0700)] 
gh-76785: Improved Subinterpreters Compatibility with 3.12 (gh-115424)

For the most part, these changes make is substantially easier to backport subinterpreter-related code to 3.12, especially the related modules (e.g. _xxsubinterpreters). The main motivation is to support releasing a PyPI package with the 3.13 capabilities compiled for 3.12.

A lot of the changes here involve either hiding details behind macros/functions or splitting up some files.

20 months agogh-115391: Fix compiler warning in `Objects/longobject.c` (GH-115368)
Kirill Podoprigora [Tue, 13 Feb 2024 20:49:13 +0000 (23:49 +0300)] 
gh-115391: Fix compiler warning in `Objects/longobject.c` (GH-115368)

20 months agogh-115383: Use runner version to compute config.cache key (#115409)
Sam Gross [Tue, 13 Feb 2024 19:35:06 +0000 (14:35 -0500)] 
gh-115383: Use runner version to compute config.cache key (#115409)

20 months agogh-115417: Remove accidentally left debugging print (#115418)
Kirill Podoprigora [Tue, 13 Feb 2024 17:45:37 +0000 (20:45 +0300)] 
gh-115417: Remove accidentally left debugging print (#115418)

gh-115417: Remove debugging print

20 months agoRemove more stray backticks from NEWS files (#115374)
Ezio Melotti [Tue, 13 Feb 2024 17:07:16 +0000 (18:07 +0100)] 
Remove more stray backticks from NEWS files (#115374)

* Remove stray backtick from NEWS file

* Remove more stray backticks from 3.12.0a1.rst

* Remove another stray backtick in 3.13.0a1.rst

20 months agoGH-113710: Improve `_SET_IP` and `_CHECK_VALIDITY` (GH-115248)
Mark Shannon [Tue, 13 Feb 2024 16:28:19 +0000 (16:28 +0000)] 
GH-113710: Improve `_SET_IP` and `_CHECK_VALIDITY` (GH-115248)

20 months agogh-115405: add versionadded tag for co_qualname in code objects documentation (#115411)
Christophe Papazian [Tue, 13 Feb 2024 16:10:00 +0000 (17:10 +0100)] 
gh-115405: add versionadded tag for co_qualname in code objects documentation (#115411)

20 months agogh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455)
qqwqqw689 [Tue, 13 Feb 2024 14:23:10 +0000 (22:23 +0800)] 
gh-113437: Update documentation about PyUnicode_AsWideChar() function (GH-113455)

20 months agoGH-113710: Backedge counter improvements. (GH-115166)
Mark Shannon [Tue, 13 Feb 2024 14:16:37 +0000 (14:16 +0000)] 
GH-113710: Backedge counter improvements. (GH-115166)

20 months agogh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)
Ken Jin [Tue, 13 Feb 2024 13:24:48 +0000 (21:24 +0800)] 
gh-114058: Foundations of the Tier2 redundancy eliminator (GH-115085)

---------

Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com>
Co-authored-by: Jules <57632293+JuliaPoo@users.noreply.github.com>
Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
20 months agogh-108303: Move all `pydoc` related test files to new `test.test_pydoc` package ...
Nikita Sobolev [Tue, 13 Feb 2024 10:40:40 +0000 (13:40 +0300)] 
gh-108303: Move all `pydoc` related test files to new `test.test_pydoc` package (#114506)

20 months agogh-115252: Fix test_enum with -OO mode again (GH-115334)
Serhiy Storchaka [Tue, 13 Feb 2024 10:21:20 +0000 (12:21 +0200)] 
gh-115252: Fix test_enum with -OO mode again (GH-115334)

20 months agogh-115032: Update DictConfigurator.configure_formatter() comment about `fmt` retry...
Mariusz Felisiak [Tue, 13 Feb 2024 08:47:40 +0000 (09:47 +0100)] 
gh-115032: Update DictConfigurator.configure_formatter() comment about `fmt` retry. (GH-115303)

20 months agoUpdate "Using Python on a Mac" (#115024)
Hugo van Kemenade [Tue, 13 Feb 2024 06:31:49 +0000 (08:31 +0200)] 
Update "Using Python on a Mac" (#115024)

20 months agogh-89240: Enable multiprocessing on Windows to use large process pools (GH-107873)
Steve Dower [Tue, 13 Feb 2024 00:28:35 +0000 (00:28 +0000)] 
gh-89240: Enable multiprocessing on Windows to use large process pools (GH-107873)

We add _winapi.BatchedWaitForMultipleObjects to wait for larger numbers of handles.
This is an internal module, hence undocumented, and should be used with caution.
Check the docstring for info before using BatchedWaitForMultipleObjects.

20 months agogh-114099: Refactor configure and Makefile to accomodate non-macOS frameworks (#115120)
Russell Keith-Magee [Mon, 12 Feb 2024 23:10:24 +0000 (07:10 +0800)] 
gh-114099: Refactor configure and Makefile to accomodate non-macOS frameworks (#115120)

Part of the PEP 730 work to add iOS support.

This change lays the groundwork for introducing iOS/tvOS/watchOS
frameworks; it includes the structural refactoring needed so that iOS
branches can be added into in a subsequent PR.

Summary of changes:
* Updates config.sub to the 2024-01-01 release. This is the "as
  released" version of config.sub.
* Adds a RESSRCDIR variable to allow sharing of macOS and iOS Makefile
  steps.
* Adds an INSTALLTARGETS variable so platforms can customise which
  targets are actually installed. This will be used to exclude certain
  targets (e.g., binaries, manfiles) from iOS framework installs.
* Adds a PYTHONFRAMEWORKINSTALLNAMEPREFIX variable; this is used as
  the install name for the library. This is needed to allow for iOS
  frameworks to specify an @rpath-based install name.
* Evaluates MACHDEP earlier in the configure process so that
  ac_sys_system is available.
* Modifies _PYTHON_HOST_PLATFORM evaluation for cross-platform builds
  so that the CPU architecture is differentiated from the host
  identifier. This will be used to generate a _PYTHON_HOST_PLATFORM
  definition that includes ABI information, not just CPU architecture.
* Differentiates between SOABI_PLATFORM and PLATFORM_TRIPLET.
  SOABI_PLATFORM is used in binary module names, and includes the ABI,
  but not the OS or CPU architecture (e.g.,
  math.cpython-313-iphonesimulator.dylib). PLATFORM_TRIPLET is used
  as the sys._multiarch value, and on iOS will contains the ABI and
  architecture (e.g., iphoneos-arm64). This differentiation hasn't
  historically been needed because while macOS is a multiarch platform,
  it uses a bare darwin as PLATFORM_TRIPLE.
* Removes the use of the deprecated -Wl,-single_module flag when
  compiling macOS frameworks.
* Some whitespace normalisation where there was a mix of spaces and tabs
  in a single block.

20 months agogh-111140: Minor doc fixes for PyLong_AsNativeBytes (GH-115375)
Steve Dower [Mon, 12 Feb 2024 22:28:36 +0000 (22:28 +0000)] 
gh-111140: Minor doc fixes for PyLong_AsNativeBytes (GH-115375)

20 months agogh-115317: Rewrite changelog filter to use vanilla JavaScript (#115324)
Hugo van Kemenade [Mon, 12 Feb 2024 22:17:33 +0000 (00:17 +0200)] 
gh-115317: Rewrite changelog filter to use vanilla JavaScript (#115324)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
20 months agogh-115258: Temporarily skip some `queue` tests on all platforms (#115361)
Kirill Podoprigora [Mon, 12 Feb 2024 20:52:25 +0000 (23:52 +0300)] 
gh-115258: Temporarily skip some `queue` tests on all platforms (#115361)

20 months agogh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions...
Steve Dower [Mon, 12 Feb 2024 20:13:13 +0000 (20:13 +0000)] 
gh-111140: Adds PyLong_AsNativeBytes and PyLong_FromNative[Unsigned]Bytes functions (GH-114886)

20 months agoRemove stray backtick in NEWS entry (#115356)
Ezio Melotti [Mon, 12 Feb 2024 19:23:45 +0000 (20:23 +0100)] 
Remove stray backtick in NEWS entry (#115356)

20 months agogh-115285: Fix `test_dataclasses` with `-OO` mode (#115286)
Nikita Sobolev [Mon, 12 Feb 2024 18:31:07 +0000 (21:31 +0300)] 
gh-115285: Fix `test_dataclasses` with `-OO` mode (#115286)

20 months agogh-114271: Make `PyInterpreterState.threads.count` thread-safe in free-threaded build...
mpage [Mon, 12 Feb 2024 17:44:00 +0000 (09:44 -0800)] 
gh-114271: Make `PyInterpreterState.threads.count` thread-safe in free-threaded builds (gh-115093)

Use atomics to mutate PyInterpreterState.threads.count.

20 months agogh-110850: Add PyTime_t C API (GH-115215)
Petr Viktorin [Mon, 12 Feb 2024 17:13:10 +0000 (18:13 +0100)] 
gh-110850: Add PyTime_t C API (GH-115215)

* gh-110850: Add PyTime_t C API

Add PyTime_t API:

* PyTime_t type.
* PyTime_MIN and PyTime_MAX constants.
* PyTime_AsSecondsDouble(), PyTime_Monotonic(),
  PyTime_PerfCounter() and PyTime_GetSystemClock() functions.

Co-authored-by: Victor Stinner <vstinner@python.org>
20 months agogh-115049: Fix py.exe failing when user has no LocalAppData. (GH-115185)
Steve Dower [Mon, 12 Feb 2024 17:05:38 +0000 (17:05 +0000)] 
gh-115049: Fix py.exe failing when user has no LocalAppData. (GH-115185)

Also ensure we always display a debug message or error for RC_INTERNAL_ERROR

20 months agogh-87804: Fix the refleak in error handling of `_pystatvfs_fromstructstatfs` (#115335)
Nikita Sobolev [Mon, 12 Feb 2024 16:27:27 +0000 (19:27 +0300)] 
gh-87804: Fix the refleak in error handling of `_pystatvfs_fromstructstatfs` (#115335)

It was the macro expansion! Sorry!

20 months agogh-115233: Fix an example in the Logging Cookbook (GH-115325)
Serhiy Storchaka [Mon, 12 Feb 2024 16:24:45 +0000 (18:24 +0200)] 
gh-115233: Fix an example in the Logging Cookbook (GH-115325)

Also add more tests for LoggerAdapter.

Also support stacklevel in LoggerAdapter._log().

20 months agoGH-113710: Fix updating of dict version tag and add watched dict stats (GH-115221)
Mark Shannon [Mon, 12 Feb 2024 16:07:38 +0000 (16:07 +0000)] 
GH-113710: Fix updating of dict version tag and add watched dict stats (GH-115221)

20 months agogh-115058: Add ``reset_rare_event_counters`` function in `_testinternalcapi` (GH...
Kirill Podoprigora [Mon, 12 Feb 2024 16:05:30 +0000 (19:05 +0300)] 
gh-115058: Add ``reset_rare_event_counters`` function in `_testinternalcapi` (GH-115128)

20 months agoRemove outdated comment about py3.6 in `test_typing` (#115318)
Nikita Sobolev [Mon, 12 Feb 2024 14:23:54 +0000 (17:23 +0300)] 
Remove outdated comment about py3.6 in `test_typing` (#115318)

20 months agoAdd missing sections to blurbs (#114553)
Hugo van Kemenade [Mon, 12 Feb 2024 14:16:16 +0000 (16:16 +0200)] 
Add missing sections to blurbs (#114553)

20 months agogh-89039: Call subclass constructors in datetime.*.replace (GH-114780)
Eugene Toder [Mon, 12 Feb 2024 12:44:56 +0000 (07:44 -0500)] 
gh-89039: Call subclass constructors in datetime.*.replace (GH-114780)

When replace() method is called on a subclass of datetime, date or time,
properly call derived constructor. Previously, only the base class's
constructor was called.

Also, make sure to pass non-zero fold values when creating subclasses in
various methods. Previously, fold was silently ignored.

20 months agogh-101100: Fix Sphinx warnings in `whatsnew/2.7.rst` and related (#115319)
Hugo van Kemenade [Mon, 12 Feb 2024 12:40:41 +0000 (14:40 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/2.7.rst` and related (#115319)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
20 months agogh-114785: Remove content from `Porting from Python2` how-to (#114805)
Nikita Sobolev [Mon, 12 Feb 2024 11:59:58 +0000 (14:59 +0300)] 
gh-114785: Remove content from `Porting from Python2` how-to (#114805)

Keep the page though, because people might still rely on it (the traffic shows that they do).
Instead of our own manual we now give links to the 3rd-party ones.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
20 months agogh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879)
John Belmonte [Mon, 12 Feb 2024 11:17:51 +0000 (20:17 +0900)] 
gh-114563: C decimal falls back to pydecimal for unsupported format strings (GH-114879)

Immediate merits:
* eliminate complex workarounds for 'z' format support
  (NOTE: mpdecimal recently added 'z' support, so this becomes
  efficient in the long term.)
* fix 'z' format memory leak
* fix 'z' format applied to 'F'
* fix missing '#' format support

Suggested and prototyped by Stefan Krah.

Fixes gh-114563, gh-91060

Co-authored-by: Stefan Krah <skrah@bytereef.org>
20 months agoGH-114695: Add `sys._clear_internal_caches` (GH-115152)
Brandt Bucher [Mon, 12 Feb 2024 09:04:36 +0000 (01:04 -0800)] 
GH-114695: Add `sys._clear_internal_caches` (GH-115152)

20 months agogh-87804: Fix error handling and style in `_pystatvfs_fromstructstatfs` (#115236)
Nikita Sobolev [Mon, 12 Feb 2024 07:27:12 +0000 (10:27 +0300)] 
gh-87804: Fix error handling and style in `_pystatvfs_fromstructstatfs` (#115236)

20 months agogh-101100: Clean up Doc/c-api/exceptions.rst and Doc/c-api/sys.rst (GH-114825)
Skip Montanaro [Sun, 11 Feb 2024 18:51:07 +0000 (12:51 -0600)] 
gh-101100: Clean up Doc/c-api/exceptions.rst and Doc/c-api/sys.rst (GH-114825)

20 months agogh-115282: Fix direct invocation of `test_traceback.py` (#115283)
Nikita Sobolev [Sun, 11 Feb 2024 16:07:08 +0000 (19:07 +0300)] 
gh-115282: Fix direct invocation of `test_traceback.py` (#115283)

20 months agogh-97959: Fix rendering of routines in pydoc (GH-113941)
Serhiy Storchaka [Sun, 11 Feb 2024 13:19:44 +0000 (15:19 +0200)] 
gh-97959: Fix rendering of routines in pydoc (GH-113941)

* Class methods no longer have "method of builtins.type instance" note.
* Corresponding notes are now added for class and unbound methods.
* Method and function aliases now have references to the module or the
  class where the origin was defined if it differs from the current.
* Bound methods are now listed in the static methods section.
* Methods of builtin classes are now supported as well as methods of
  Python classes.

20 months agogh-49766: Make date-datetime comparison more symmetric and flexible (GH-114760)
Serhiy Storchaka [Sun, 11 Feb 2024 11:06:43 +0000 (13:06 +0200)] 
gh-49766: Make date-datetime comparison more symmetric and flexible (GH-114760)

Now the special comparison methods like `__eq__` and `__lt__` return
NotImplemented if one of comparands is date and other is datetime
instead of ignoring the time part and the time zone or forcefully
return "not equal" or raise TypeError.

It makes comparison of date and datetime subclasses more symmetric
and allows to change the default behavior by overriding
the special comparison methods in subclasses.

It is now the same as if date and datetime was independent classes.