]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
20 months agogh-115154: Fix untokenize handling of unicode named literals (#115171)
Pablo Galindo Salgado [Mon, 19 Feb 2024 14:54:10 +0000 (14:54 +0000)] 
gh-115154: Fix untokenize handling of unicode named literals (#115171)

20 months agogh-115652: Fix indentation in the documentation of multiprocessing.get_start_method...
Daniel Haag [Mon, 19 Feb 2024 14:26:23 +0000 (15:26 +0100)] 
gh-115652: Fix indentation in the documentation of multiprocessing.get_start_method (GH-115658)

20 months agogh-114626: Add again _PyCFunctionFastWithKeywords name (GH-115561)
Victor Stinner [Mon, 19 Feb 2024 12:20:46 +0000 (13:20 +0100)] 
gh-114626: Add again _PyCFunctionFastWithKeywords name (GH-115561)

Keep the old private _PyCFunctionFastWithKeywords name (Python 3.7)
as an alias to the new public name PyCFunctionFastWithKeywords
(Python 3.13a4).

_PyCFunctionWithKeywords doesn't exist in Python 3.13a3, whereas
_PyCFunctionFastWithKeywords was removed in Python 3.13a4.

20 months agogh-83648: Add missing `deprecated` arg in argparse.rst (GH-115640)
0xflotus [Mon, 19 Feb 2024 08:29:32 +0000 (09:29 +0100)] 
gh-83648: Add missing `deprecated` arg in argparse.rst (GH-115640)

20 months agogh-102388: Add windows_31j to aliases for cp932 codec (#102389)
Masayuki Moriyama [Mon, 19 Feb 2024 08:01:35 +0000 (17:01 +0900)] 
gh-102388: Add windows_31j to aliases for cp932 codec (#102389)

The charset name "Windows-31J" is registered in the IANA Charset Registry[1]
and is implemented in Python as the cp932 codec.

[1] https://www.iana.org/assignments/charset-reg/windows-31J

Signed-off-by: Masayuki Moriyama <masayuki.moriyama@miraclelinux.com>
20 months agoDocs: Add explanation about little/big endian (#109841)
Simon A. Eugster [Mon, 19 Feb 2024 07:50:09 +0000 (08:50 +0100)] 
Docs: Add explanation about little/big endian (#109841)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
20 months agogh-111358: Fix timeout behaviour in BaseEventLoop.shutdown_default_executor (#115622)
Jamie Phan [Mon, 19 Feb 2024 00:01:00 +0000 (11:01 +1100)] 
gh-111358: Fix timeout behaviour in BaseEventLoop.shutdown_default_executor (#115622)

20 months agogh-114709: Mark commonpath behaviour as changed in 3.13 (#115639)
Shantanu [Sun, 18 Feb 2024 22:08:50 +0000 (14:08 -0800)] 
gh-114709: Mark commonpath behaviour as changed in 3.13 (#115639)

20 months agogh-115122: Add --bisect option to regrtest (#115123)
Victor Stinner [Sun, 18 Feb 2024 20:06:39 +0000 (21:06 +0100)] 
gh-115122: Add --bisect option to regrtest (#115123)

* test.bisect_cmd now exit with code 0 on success, and code 1 on
  failure. Before, it was the opposite.
* test.bisect_cmd now runs the test worker process with
  -X faulthandler.
* regrtest RunTests: Add create_python_cmd() and bisect_cmd()
  methods.

20 months agogh-115572: Move `codeobject.replace()` docs to the data model (#115631)
Daler [Sun, 18 Feb 2024 14:13:46 +0000 (19:13 +0500)] 
gh-115572: Move `codeobject.replace()` docs to the data model (#115631)

20 months agogh-114709: Fix exceptions raised by posixpath.commonpath (#114710)
Sebastian Rittau [Sun, 18 Feb 2024 08:24:58 +0000 (09:24 +0100)] 
gh-114709: Fix exceptions raised by posixpath.commonpath (#114710)

Fix the exceptions raised by posixpath.commonpath

Raise ValueError, not IndexError when passed an empty iterable. Raise
TypeError, not ValueError when passed None.

20 months agogh-108303: Move `Lib/test/sortperf.py` to `Tools/scripts` (#114687)
Nikita Sobolev [Sun, 18 Feb 2024 07:27:14 +0000 (10:27 +0300)] 
gh-108303: Move `Lib/test/sortperf.py` to `Tools/scripts` (#114687)

20 months agogh-115618: Remove improper Py_XDECREFs in property methods (GH-115619)
Serhiy Storchaka [Sat, 17 Feb 2024 21:18:30 +0000 (23:18 +0200)] 
gh-115618: Remove improper Py_XDECREFs in property methods (GH-115619)

20 months agogh-100176: Remove outdated Tools/{io,cc,string}bench (#101853)
Hugo van Kemenade [Sat, 17 Feb 2024 21:17:21 +0000 (23:17 +0200)] 
gh-100176: Remove outdated Tools/{io,cc,string}bench (#101853)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
20 months agogh-115596: Fix ProgramPriorityTests in test_os permanently changing the process prior...
Brian Schubert [Sat, 17 Feb 2024 16:42:57 +0000 (11:42 -0500)] 
gh-115596: Fix ProgramPriorityTests in test_os permanently changing the process priority (GH-115610)

20 months agoFix ProgramPriorityTests on FreeBSD with high nice value (GH-100145)
Dmitry Marakasov [Sat, 17 Feb 2024 14:54:47 +0000 (17:54 +0300)] 
Fix ProgramPriorityTests on FreeBSD with high nice value (GH-100145)

It expects priority to be capped with 19, which is the cap for Linux,
but for FreeBSD the cap is 20 and the test fails under the similar
conditions. Tweak the condition to cover FreeBSD as well.

20 months agogh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption stdout output...
Kirill Podoprigora [Sat, 17 Feb 2024 13:17:55 +0000 (16:17 +0300)] 
gh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption stdout output (GH-115568)

20 months agoDocument use of ANY in test assertions (GH-94060)
Thomas Grainger [Sat, 17 Feb 2024 13:13:34 +0000 (13:13 +0000)] 
Document use of ANY in test assertions (GH-94060)

20 months agogh-107155: Fix help() for lambda function with return annotation (GH-107401)
Kirill Podoprigora [Sat, 17 Feb 2024 12:47:51 +0000 (15:47 +0300)] 
gh-107155: Fix help() for lambda function with return annotation (GH-107401)

20 months agogh-96497: Mangle name before symtable lookup in 'symtable_extend_namedexpr_scope...
wookie184 [Sat, 17 Feb 2024 12:06:31 +0000 (12:06 +0000)] 
gh-96497: Mangle name before symtable lookup in 'symtable_extend_namedexpr_scope' (GH-96561)

20 months agogh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825)
Matthew Hughes [Sat, 17 Feb 2024 11:57:51 +0000 (11:57 +0000)] 
gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825)

Since 2f3941d743481ac48628b8b2c075f2b82762050b this function returns the
response string, rather than nothing.

20 months agogh-95782: Fix io.BufferedReader.tell() etc. being able to return offsets < 0 (GH...
6t8k [Sat, 17 Feb 2024 11:16:06 +0000 (11:16 +0000)] 
gh-95782: Fix io.BufferedReader.tell() etc. being able to return offsets < 0 (GH-99709)

lseek() always returns 0 for character pseudo-devices like
`/dev/urandom` (for other non-regular files, e.g. `/dev/stdin`, it
always returns -1, to which CPython reacts by raising appropriate
exceptions). They are thus technically seekable despite not having seek
semantics.

When calling read() on e.g. an instance of `io.BufferedReader` that
wraps such a file, `BufferedReader` reads ahead, filling its buffer,
creating a discrepancy between the number of bytes read and the internal
`tell()` always returning 0, which previously resulted in e.g.
`BufferedReader.tell()` or `BufferedReader.seek()` being able to return
positions < 0 even though these are supposed to be always >= 0.

Invariably keep the return value non-negative by returning
max(former_return_value, 0) instead, and add some corresponding tests.

20 months agogh-56499: Update the pickle library's note section for the __setstate__ function...
Furkan Onder [Sat, 17 Feb 2024 10:51:43 +0000 (13:51 +0300)] 
gh-56499: Update the pickle library's note section for the __setstate__ function (GH-101062)

20 months agogh-87688: Amend SSLContext.hostname_checks_common_name docs (GH-100517)
Rami [Sat, 17 Feb 2024 10:22:19 +0000 (12:22 +0200)] 
gh-87688: Amend SSLContext.hostname_checks_common_name docs (GH-100517)

20 months agogh-100884: email/_header_value_parser: don't encode list separators (GH-100885)
Thomas Weißschuh [Sat, 17 Feb 2024 10:13:46 +0000 (11:13 +0100)] 
gh-100884: email/_header_value_parser: don't encode list separators (GH-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.

20 months agogh-100985: Consistently wrap IPv6 IP address during CONNECT (GH-100986)
Derek Higgins [Sat, 17 Feb 2024 10:10:12 +0000 (10:10 +0000)] 
gh-100985: Consistently wrap IPv6 IP address during CONNECT (GH-100986)

Update _get_hostport to always remove square brackets
from IPv6 addresses. Then add them if needed
in "CONNECT .." and "Host: ".

20 months agogh-101100: Fix Sphinx warnings in `whatsnew/3.2.rst` (#115580)
Hugo van Kemenade [Sat, 17 Feb 2024 10:03:20 +0000 (12:03 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/3.2.rst` (#115580)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
20 months agogh-101100: Fix Sphinx warnings in `whatsnew/3.1.rst` (#115575)
Hugo van Kemenade [Sat, 17 Feb 2024 09:39:07 +0000 (11:39 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/3.1.rst` (#115575)

20 months agogh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL...
Peter Jiping Xie [Sat, 17 Feb 2024 09:12:12 +0000 (20:12 +1100)] 
gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419)

20 months agogh-101699: Explain using Match.expand with \g<0> (GH-101701)
Stevoisiak [Sat, 17 Feb 2024 08:33:28 +0000 (03:33 -0500)] 
gh-101699: Explain using Match.expand with \g<0> (GH-101701)

Update documentation for re library to explain that a backreference `\g<0>` is
expanded to the entire string when using Match.expand().
Note that numeric backreferences to group 0 (`\0`) are not supported.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
20 months agogh-113812: Allow DatagramTransport.sendto to send empty data (#115199)
Jamie Phan [Sat, 17 Feb 2024 02:38:07 +0000 (13:38 +1100)] 
gh-113812: Allow DatagramTransport.sendto to send empty data (#115199)

Also include the UDP packet header sizes (8 bytes per packet)
in the buffer size reported to the flow control subsystem.

20 months agogh-111968: Split _Py_async_gen_asend_freelist out of _Py_async_gen_fr… (gh-115546)
Donghee Na [Sat, 17 Feb 2024 01:03:10 +0000 (10:03 +0900)] 
gh-111968: Split _Py_async_gen_asend_freelist out of _Py_async_gen_fr… (gh-115546)

20 months agodocs: Add glossary term references to shutil docs (#115559)
Brian Schubert [Fri, 16 Feb 2024 22:04:17 +0000 (17:04 -0500)] 
docs: Add glossary term references to shutil docs (#115559)

Add glossary term references to shutil docs

20 months agogh-85294: Handle missing arguments to @singledispatchmethod gracefully (GH-21471)
Ammar Askar [Fri, 16 Feb 2024 21:17:30 +0000 (16:17 -0500)] 
gh-85294: Handle missing arguments to @singledispatchmethod gracefully (GH-21471)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
20 months agogh-115103: Implement delayed memory reclamation (QSBR) (#115180)
Sam Gross [Fri, 16 Feb 2024 20:25:19 +0000 (15:25 -0500)] 
gh-115103: Implement delayed memory reclamation (QSBR) (#115180)

This adds a safe memory reclamation scheme based on FreeBSD's "GUS" and
quiescent state based reclamation (QSBR). The API provides a mechanism
for callers to detect when it is safe to free memory that may be
concurrently accessed by readers.

20 months agogh-115556: Remove quotes from command-line arguments in test.bat and rt.bat (#115557)
Łukasz Langa [Fri, 16 Feb 2024 20:24:56 +0000 (21:24 +0100)] 
gh-115556: Remove quotes from command-line arguments in test.bat and rt.bat (#115557)

This change essentially replaces usage of `%1` with `%~1`, which removes
quotes, if any. Without this change, the if statements fail due to
the quotes mangling the syntax.

Additionally, this change works around comma being treated as a parameter
delimiter in test.bat by escaping commas at time of parsing. Tested
combinations of rt and regrtest arguments, all seems to work as before
but now you can specify commas in arguments like "-uall,extralargefile".

20 months agogh-112720: make it easier to subclass and modify dis.ArgResolver's jump arg resolutio...
Irit Katriel [Fri, 16 Feb 2024 19:25:19 +0000 (19:25 +0000)] 
gh-112720: make it easier to subclass and modify dis.ArgResolver's jump arg resolution (#115564)

20 months agogh-114271: Make `thread._rlock` thread-safe in free-threaded builds (#115102)
mpage [Fri, 16 Feb 2024 18:29:25 +0000 (10:29 -0800)] 
gh-114271: Make `thread._rlock` thread-safe in free-threaded builds (#115102)

The ID of the owning thread (`rlock_owner`) may be accessed by
multiple threads without holding the underlying lock; relaxed
atomics are used in place of the previous loads/stores.

The number of times that the lock has been acquired (`rlock_count`)
is only ever accessed by the thread that holds the lock; we do not
need to use atomics to access it.

20 months agogh-115480: Type / constant propagation for float binary uops (GH-115550)
Peter Lazorchak [Fri, 16 Feb 2024 18:02:48 +0000 (10:02 -0800)] 
gh-115480: Type / constant propagation for float binary uops (GH-115550)

Co-authored-by: Ken Jin <kenjin@python.org>
20 months agogh-115362: Add documentation to pystats output (#115365)
Michael Droettboom [Fri, 16 Feb 2024 17:06:07 +0000 (12:06 -0500)] 
gh-115362: Add documentation to pystats output (#115365)

20 months agogh-113743: Give _PyTypes_AfterFork a prototype. (gh-115563)
Benjamin Peterson [Fri, 16 Feb 2024 16:49:41 +0000 (08:49 -0800)] 
gh-113743: Give _PyTypes_AfterFork a prototype. (gh-115563)

Fixes a compiler warning.

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.