]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 months agogh-135101: When choosing the default simulator device, don't use `simctl --set testin...
Joe Rickerby [Wed, 4 Jun 2025 00:31:43 +0000 (01:31 +0100)] 
gh-135101: When choosing the default simulator device, don't use `simctl --set testing` (#135102)

On a fresh Xcode install (including some CI provider configurations), there is
no pre-existing testing set that can be used to identify simulator models. Use
the default device set to detect available models instead. Live testing
simulators are still created in the testing set.

5 months agogh-127081: use `getlogin_r` if available (gh-132751)
Duane Griffin [Tue, 3 Jun 2025 17:28:58 +0000 (05:28 +1200)] 
gh-127081: use `getlogin_r` if available (gh-132751)

The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.

5 months agogh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (#134871)
tpburns [Tue, 3 Jun 2025 16:00:25 +0000 (12:00 -0400)] 
gh-134248 test_getallocatedblocks pre-check to ignore immortalized strings (#134871)

When sanity checking against gettotalrefcount(), we exclude the blocks for
immortalized strings since their references are not tracked/reported. This
now matches refleak.py's book-keeping using the same functions.

5 months agogh-135034: Normalize link targets in tarfile, add `os.path.realpath(strict='allow_mis...
Łukasz Langa [Tue, 3 Jun 2025 10:42:11 +0000 (12:42 +0200)] 
gh-135034: Normalize link targets in tarfile, add `os.path.realpath(strict='allow_missing')` (#135037)

Addresses CVEs 2024-12718, 2025-4138, 2025-4330, and 2025-4517.

Signed-off-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 months agogh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys...
Roei Ben Artzi [Tue, 3 Jun 2025 07:40:25 +0000 (10:40 +0300)] 
gh-131884: Fix incorrect formatting in json.dumps() when using indent and skipkeys=True (GH-132200)

5 months agogh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606)
stratakis [Tue, 3 Jun 2025 07:09:43 +0000 (09:09 +0200)] 
gh-128605: Add branch protections for x86_64 in asm_trampoline.S (#128606)

Apply Intel Control-flow Technology for x86-64 on asm_trampoline.S.

Required for mitigation against return-oriented programming (ROP)
and Call or Jump Oriented Programming (COP/JOP) attacks.

Manual application is required for the assembly files.

See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html

5 months agogh-135028: Increase parser MAXSTACK for nested parenthesis (#135031)
Victor Stinner [Tue, 3 Jun 2025 06:40:45 +0000 (08:40 +0200)] 
gh-135028: Increase parser MAXSTACK for nested parenthesis (#135031)

5 months agogh-134875: Fix mimallc build error for the old compilers (gh-134994)
Donghee Na [Mon, 2 Jun 2025 23:40:40 +0000 (08:40 +0900)] 
gh-134875: Fix mimallc build error for the old compilers (gh-134994)

5 months agogh-134830: Fix reference in `Doc/extending/windows.rst` (GH-134831)
Stan Ulbrych [Mon, 2 Jun 2025 22:08:20 +0000 (23:08 +0100)] 
gh-134830: Fix reference in `Doc/extending/windows.rst` (GH-134831)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
5 months agogh-132813: Improve error messages for incorrect types and values of csv.Dialog attrib...
Serhiy Storchaka [Mon, 2 Jun 2025 20:35:41 +0000 (23:35 +0300)] 
gh-132813: Improve error messages for incorrect types and values of csv.Dialog attributes (GH-133241)

Make them similar to PyArg_Parse error messages, mention None as
a possible value, show a wrong type and the string length.

5 months agogh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963)
Serhiy Storchaka [Mon, 2 Jun 2025 20:31:06 +0000 (23:31 +0300)] 
gh-74232: Add a note about roundtrip of non-float numerics in CSV (GH-134963)

5 months agogh-133454: Mark test_queue tests with many threads as bigmem (gh-134575)
Serhiy Storchaka [Mon, 2 Jun 2025 20:25:32 +0000 (23:25 +0300)] 
gh-133454: Mark test_queue tests with many threads as bigmem (gh-134575)

50 producer and 50 consumer threads need more than 5GB of memory.

5 months agoRemove newline in Doc/c-api/lifecycle.rst for gettext builder (GH-135013)
Rafael Fontenelle [Mon, 2 Jun 2025 18:13:08 +0000 (15:13 -0300)] 
Remove newline in Doc/c-api/lifecycle.rst for gettext builder (GH-135013)

5 months agogh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)
Serhiy Storchaka [Mon, 2 Jun 2025 18:08:26 +0000 (21:08 +0300)] 
gh-66234: Add flag to disable the use of mmap in dbm.gnu (GH-135005)

This may harm performance, but improve crash tolerance.

5 months agogh-134908: Protect `textiowrapper_iternext` with critical section (gh-134910)
Duane Griffin [Mon, 2 Jun 2025 17:22:41 +0000 (05:22 +1200)] 
gh-134908: Protect `textiowrapper_iternext` with critical section (gh-134910)

The `textiowrapper_iternext` function called `_textiowrapper_writeflush`, but did not
use a critical section, making it racy in free-threaded builds.

5 months agogh-130999: Fix globals() poisoning in test_traceback (gh-135030)
Łukasz Langa [Mon, 2 Jun 2025 14:57:08 +0000 (16:57 +0200)] 
gh-130999: Fix globals() poisoning in test_traceback (gh-135030)

5 months agogh-123471: make concurrent iteration over `itertools.cycle` safe under free-threading...
Pieter Eendebak [Mon, 2 Jun 2025 14:43:32 +0000 (16:43 +0200)] 
gh-123471: make concurrent iteration over `itertools.cycle` safe under free-threading (#131212)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
5 months agogh-117852: fix argument checking of `async_generator.athrow` (#134868)
Duane Griffin [Mon, 2 Jun 2025 14:34:26 +0000 (02:34 +1200)] 
gh-117852: fix argument checking of `async_generator.athrow` (#134868)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
5 months agogh-130662: Accept leading zeros in precision/width for Decimal's formatting (#132549)
Sergey B Kirpichev [Mon, 2 Jun 2025 13:30:52 +0000 (16:30 +0300)] 
gh-130662: Accept leading zeros in precision/width for Decimal's formatting (#132549)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-130662: Accept leading zeros in precision/width for Fraction's formatting (#130663)
Sergey B Kirpichev [Mon, 2 Jun 2025 13:28:20 +0000 (16:28 +0300)] 
gh-130662: Accept leading zeros in precision/width for Fraction's formatting (#130663)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-130999: Avoid exiting the new REPL when there are non-string candidates for sugges...
devdanzin [Mon, 2 Jun 2025 11:04:59 +0000 (08:04 -0300)] 
gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001)

5 months agogh-132908: Add math.isnormal/issubnormal() functions (GH132935)
Sergey B Kirpichev [Mon, 2 Jun 2025 10:38:05 +0000 (13:38 +0300)] 
gh-132908: Add math.isnormal/issubnormal() functions (GH132935)

5 months agogh-122153: indicate that Windows does not support `socket.{send,recv}_fds` (#134960)
GalaxySnail [Mon, 2 Jun 2025 10:23:52 +0000 (18:23 +0800)] 
gh-122153: indicate that Windows does not support `socket.{send,recv}_fds` (#134960)

This amends commit e3b6ff19aaa318a813130ba9ad2ab0a332f27feb.

5 months agogh-134449: fix grammar for `precision_with_grouping` in format description (#134608)
Sergey B Kirpichev [Mon, 2 Jun 2025 09:45:48 +0000 (12:45 +0300)] 
gh-134449: fix grammar for `precision_with_grouping` in format description (#134608)

This amends commit f39a07be47cd9219eaf0e538ae32ad8239c88e66.

5 months agogh-134978: deprecate `string` keyword parameter for hash function constructors (...
Bénédikt Tran [Mon, 2 Jun 2025 08:25:50 +0000 (10:25 +0200)] 
gh-134978: deprecate `string` keyword parameter for hash function constructors (#134979)

5 months agogh-130478: fix HACL* build for macOS Silicon (#134188)
Sam Ng [Sun, 1 Jun 2025 15:35:58 +0000 (08:35 -0700)] 
gh-130478: fix HACL* build for macOS Silicon (#134188)

5 months agogh-134004: Added the reorganize() methods to dbm.sqlite, dbm.dumb and shelve (GH...
Andrea-Oliveri [Sun, 1 Jun 2025 12:30:04 +0000 (14:30 +0200)] 
gh-134004: Added the reorganize() methods to dbm.sqlite, dbm.dumb and shelve (GH-134028)

They are similar to the same named method in dbm.gnu.

5 months agogh-132983: Minor fixes and clean up for the _zstd module (GH-134930)
Serhiy Storchaka [Sun, 1 Jun 2025 08:22:15 +0000 (11:22 +0300)] 
gh-132983: Minor fixes and clean up for the _zstd module (GH-134930)

5 months agogh-133503: clarify `compileall -s/-p` docs (#134756)
Rihaan Meher [Sun, 1 Jun 2025 08:18:31 +0000 (04:18 -0400)] 
gh-133503: clarify `compileall -s/-p` docs (#134756)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-134970: Fix exception message in argparse module (GH-134971)
Michał Górny [Sun, 1 Jun 2025 05:56:56 +0000 (07:56 +0200)] 
gh-134970: Fix exception message in argparse module (GH-134971)

Fix the "unknown action" exception in argparse.ArgumentParser.add_argument_group()
to correctly replace the action class.

5 months agogh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c`...
sobolevn [Sat, 31 May 2025 21:33:02 +0000 (00:33 +0300)] 
gh-133891: Add missing error check to `SET_COUNT` macro in `_testinternalcapi.c` (#133892)

5 months agogh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)
Stan Ulbrych [Sat, 31 May 2025 17:48:51 +0000 (18:48 +0100)] 
gh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)

:teapot:

5 months agogh-134954: Hard-cap max file descriptors in subprocess test fd_status (#134955)
Itamar Oren [Sat, 31 May 2025 14:29:03 +0000 (07:29 -0700)] 
gh-134954: Hard-cap max file descriptors in subprocess test fd_status (#134955)

* Hard-cap max file descriptors in subprocess test fd_status

On some systems, `SC_OPEN_MAX` may return a very large value (i.e. 10**30), leading to the subprocess test timing out (or run forever).
Prevent this situation by applying a hard cap on how many file descriptors are checked.

* Fix typo in usage docstring

s/fd_stats/fd_status/

5 months agoImprove format of `InternalDocs/exception_handling.md` (#134969)
sobolevn [Sat, 31 May 2025 11:56:33 +0000 (14:56 +0300)] 
Improve format of `InternalDocs/exception_handling.md` (#134969)

5 months agoskip test for sys._stdlib_dir if that is not present (#134973)
CF Bolz-Tereick [Sat, 31 May 2025 11:46:22 +0000 (13:46 +0200)] 
skip test for sys._stdlib_dir if that is not present (#134973)

5 months agoSkip test as cpython_only that checks whether setattr interns the attribute or not...
CF Bolz-Tereick [Sat, 31 May 2025 11:38:05 +0000 (13:38 +0200)] 
Skip test as cpython_only that checks whether setattr interns the attribute or not (#134972)

Skip test that checks whether setattr interns the attribute or not

The details of when a string is being interned or not is implementation
dependent.

5 months agogh-133968: Create the Unicode writer on demand in json (#133832)
Nice Zombies [Sat, 31 May 2025 11:35:51 +0000 (13:35 +0200)] 
gh-133968: Create the Unicode writer on demand in json (#133832)

5 months agogh-134696: fix `hashlib` tests for FIPS-only BLAKE-2 buildbot (#134968)
Bénédikt Tran [Sat, 31 May 2025 10:48:34 +0000 (12:48 +0200)] 
gh-134696: fix `hashlib` tests for FIPS-only BLAKE-2 buildbot  (#134968)

5 months ago gh-108885: Use subtests for doctest examples run by unittest (GH-134890)
Serhiy Storchaka [Sat, 31 May 2025 10:01:46 +0000 (13:01 +0300)] 
 gh-108885: Use subtests for doctest examples run by unittest (GH-134890)

Run each example as a subtest in unit tests synthesized by
doctest.DocFileSuite() and doctest.DocTestSuite().

Add the doctest.DocTestRunner.report_skip() method.

5 months agogh-134918: Fix and improve doctest's documentation (GH-134919)
Serhiy Storchaka [Sat, 31 May 2025 09:03:08 +0000 (12:03 +0300)] 
gh-134918: Fix and improve doctest's documentation (GH-134919)

5 months agogh-133489: Remove size restrictions on getrandbits() and randbytes() (GH-133658)
Serhiy Storchaka [Sat, 31 May 2025 08:23:01 +0000 (11:23 +0300)] 
gh-133489: Remove size restrictions on getrandbits() and randbytes() (GH-133658)

random.getrandbits() can now generate more that 2**31 bits.
random.randbytes() can now generate more that 256 MiB.

5 months agogh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures...
Bénédikt Tran [Sat, 31 May 2025 07:37:47 +0000 (09:37 +0200)] 
gh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures (#134713)

OpenSSL and HACL*-based hash functions constructors now support both `data` and `string` parameters.
Previously these constructor functions inconsistently supported sometimes `data` and sometimes `string`,
while the documentation expected `data` to be given in all cases.

5 months agogh-134718: Omit optional Load() values in ast.dump() (GH-134934)
Serhiy Storchaka [Sat, 31 May 2025 07:32:53 +0000 (10:32 +0300)] 
gh-134718: Omit optional Load() values in ast.dump() (GH-134934)

5 months agogh-91048: Reorder result tuple of parse_code_object (#134898)
László Kiss Kollár [Sat, 31 May 2025 00:32:36 +0000 (03:32 +0300)] 
gh-91048:  Reorder result tuple of parse_code_object (#134898)

Reorder result tuple of parse_code_object

The standard followed by APIs like pstat.Stats is to take a file, line,
function triplet. The parse_code_object function (and callers exposing
this in Python like RemoteUnwinder.get_stack_trace) return function,
file, line triplets which requires the caller to reorder these when
using it in classes like pstat.Stats.

5 months agogh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924)
Steve Dower [Fri, 30 May 2025 18:37:29 +0000 (19:37 +0100)] 
gh-134923: Use /GENPROFILE and /USEPROFILE for Windows PGO builds (GH-134924)

5 months agorearrange my gitingore addition w/comment to make backporting easier (#134945)
Gregory P. Smith [Fri, 30 May 2025 18:28:14 +0000 (11:28 -0700)] 
rearrange my gitingore addition w/comment to make backporting easier (#134945)

5 months ago.gitignore personal Claude Code configs (#134942)
Gregory P. Smith [Fri, 30 May 2025 17:46:16 +0000 (10:46 -0700)] 
.gitignore personal Claude Code configs (#134942)

.gitignore personal Claude Code configs.

https://docs.anthropic.com/en/docs/claude-code/memory

5 months agogh-134733: Fix documentation for the show_empty option of ast.dump() (GH-134925)
Serhiy Storchaka [Fri, 30 May 2025 15:52:36 +0000 (18:52 +0300)] 
gh-134733: Fix documentation for the show_empty option of ast.dump() (GH-134925)

Optional None values are always omitted.

5 months agogh-132775: Expand the Capability of Interpreter.call() (gh-133484)
Eric Snow [Fri, 30 May 2025 15:15:00 +0000 (09:15 -0600)] 
gh-132775: Expand the Capability of Interpreter.call() (gh-133484)

It now supports most callables, full args, and return values.

5 months agogh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775)
Petr Viktorin [Fri, 30 May 2025 14:27:54 +0000 (16:27 +0200)] 
gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
5 months agogh-134718: Fix ast.dump() for empty non-default values (GH-134926)
Serhiy Storchaka [Fri, 30 May 2025 14:25:07 +0000 (17:25 +0300)] 
gh-134718: Fix ast.dump() for empty non-default values (GH-134926)

5 months agoGH-134879: Fix `INSTRUMENT_FOR_ITER` for list/tuple (#134897)
Mark Shannon [Fri, 30 May 2025 14:11:42 +0000 (15:11 +0100)] 
GH-134879: Fix `INSTRUMENT_FOR_ITER` for list/tuple (#134897)

Fix INSTRUMENT_FOR_ITER for list/tuple

5 months agogh-134586: mark `_mi_assert_fail` as `noreturn`, `cold` and `throw` (#134624)
Bénédikt Tran [Fri, 30 May 2025 12:44:03 +0000 (14:44 +0200)] 
gh-134586: mark `_mi_assert_fail` as `noreturn`, `cold` and `throw` (#134624)

We add the following attributes on `_mi_assert_fail` to help IDE introspection:

* `__attribute__((__noreturn__))`
* `__attribute__((cold))`
* `__THROW` (GCC only)

5 months agogh-134745: Change PyThread_allocate_lock() implementation to PyMutex (#134747)
Victor Stinner [Fri, 30 May 2025 10:15:47 +0000 (12:15 +0200)] 
gh-134745: Change PyThread_allocate_lock() implementation to PyMutex (#134747)

Co-authored-by: Sam Gross <colesbury@gmail.com>
5 months agogh-134885: zstd: Use Py_XSETREF (GH-134886)
Jelle Zijlstra [Fri, 30 May 2025 09:30:05 +0000 (02:30 -0700)] 
gh-134885: zstd: Use Py_XSETREF (GH-134886)

5 months agoDoc: remove unnecessary section header (GH-134917)
Inada Naoki [Fri, 30 May 2025 08:59:23 +0000 (17:59 +0900)] 
Doc: remove unnecessary section header (GH-134917)

5 months agogh-134768: Fix definition of `mt_continue_should_break()` (#134769)
Sam James [Fri, 30 May 2025 04:42:19 +0000 (05:42 +0100)] 
gh-134768: Fix definition of `mt_continue_should_break()` (#134769)

In 121ed71f4e395948d313249b2ad33e1e21581f8a, mt_continue_should_break
was changed to be guarded by `Py_DEBUG`, but it's used in `compress_mt_continue_lock_held`
with just `assert`, so it needs to be available when `NDEBUG` is undefined
too.

`Py_DEBUG` implies `NDEBUG` is undefined, so we can check just that.

Fixes: 121ed71f4e395948d313249b2ad33e1e21581f8a
5 months agogh-134906: Document CompressionParameter.content_size_flag (#134907)
Emma Smith [Fri, 30 May 2025 04:37:43 +0000 (21:37 -0700)] 
gh-134906: Document CompressionParameter.content_size_flag (#134907)

* Document CompressionParameter.content_size_flag

5 months agoast docs: Fix description of ast.Constant (#134741)
Jelle Zijlstra [Fri, 30 May 2025 04:11:20 +0000 (21:11 -0700)] 
ast docs: Fix description of ast.Constant (#134741)

Contrary to the current docs, ast.Constant will never hold containers
such as frozenset or tuple; the Python parser only emits it for simple
literals.

For precision, add the exact list of types that may be contained in an
ast.Constant.

5 months agoGH-106235: Clarify `parse_known_args` documentation by removing "remaining" (#126921)
Savannah Bailey [Fri, 30 May 2025 03:34:34 +0000 (20:34 -0700)] 
GH-106235: Clarify `parse_known_args` documentation by removing "remaining" (#126921)

5 months agogh-134857: Improve error report for doctests run with unittest (GH-134858)
Serhiy Storchaka [Thu, 29 May 2025 21:32:44 +0000 (00:32 +0300)] 
gh-134857: Improve error report for doctests run with unittest (GH-134858)

Remove doctest module frames from tracebacks and redundant newline
character from a failure message.

5 months agogh-132775: Fix _PyFunctIon_VerifyStateless() (#134900)
Eric Snow [Thu, 29 May 2025 20:13:12 +0000 (14:13 -0600)] 
gh-132775: Fix _PyFunctIon_VerifyStateless() (#134900)

The problem we're fixing here is that we were using PyDict_Size() on "defaults",
which it is actually a tuple.  We're also adding some explicit type checks.

This is a follow-up to gh-133221/gh-133528.

5 months agogh-134771: Fix time_clockid_converter() on Cygwin (#134772)
Collin Funk [Thu, 29 May 2025 17:35:53 +0000 (10:35 -0700)] 
gh-134771: Fix time_clockid_converter() on Cygwin (#134772)

Use long for clockid_t instead of int.

5 months agogh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)
Victor Stinner [Thu, 29 May 2025 14:54:30 +0000 (16:54 +0200)] 
gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)

Replace most PyUnicodeWriter_WriteUTF8() calls with
PyUnicodeWriter_WriteASCII().

Unrelated change to please the linter: remove an unused
import in test_ctypes.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-133260: Remove claim that PyUnicode_InternFromString immortalizes (GH-134213)
Petr Viktorin [Thu, 29 May 2025 13:36:59 +0000 (15:36 +0200)] 
gh-133260: Remove claim that PyUnicode_InternFromString immortalizes (GH-134213)

5 months agogh-133866: remove deprecated and undocumented function `ctypes.SetPointerType` (GH...
Bénédikt Tran [Thu, 29 May 2025 13:28:57 +0000 (15:28 +0200)] 
gh-133866: remove deprecated and undocumented function `ctypes.SetPointerType` (GH-133869)

5 months agogh-69011: : clarify & deduplicate `ctypes.create_*_buffer` docs (GH-132858)
Stan Ulbrych [Thu, 29 May 2025 13:16:20 +0000 (14:16 +0100)] 
gh-69011: : clarify & deduplicate `ctypes.create_*_buffer` docs (GH-132858)

This adds a warning about the possibly-missing NUL terminator, but in a way
that doesn't make it sound like a bug/wart.

5 months agogh-134262: Fix off by one errors in download retry functions (GH-134867)
Emma Smith [Wed, 28 May 2025 23:15:39 +0000 (16:15 -0700)] 
gh-134262: Fix off by one errors in download retry functions (GH-134867)

5 months agogh-134262: Add retries to downloads in PCbuild\get_external.py (GH-134820)
Emma Smith [Wed, 28 May 2025 21:18:34 +0000 (14:18 -0700)] 
gh-134262: Add retries to downloads in PCbuild\get_external.py (GH-134820)

5 months agoAdd a tool to benchmark external inspection (#134810)
Pablo Galindo Salgado [Wed, 28 May 2025 20:27:24 +0000 (21:27 +0100)] 
Add a tool to benchmark external inspection (#134810)

5 months agoGH-133912: Fix `PyObject_GenericSetDict` to handle inline values (GH-134725)
Mark Shannon [Wed, 28 May 2025 18:03:41 +0000 (19:03 +0100)] 
GH-133912: Fix `PyObject_GenericSetDict` to handle inline values (GH-134725)

5 months agogh-108885: Imporove tests for doctest (GH-134832)
Serhiy Storchaka [Wed, 28 May 2025 17:14:56 +0000 (20:14 +0300)] 
gh-108885: Imporove tests for doctest (GH-134832)

Test the error and failure report in more detail.

5 months agogh-108512: Add and use new replacements for PySys_GetObject() (GH-111035)
Serhiy Storchaka [Wed, 28 May 2025 17:11:09 +0000 (20:11 +0300)] 
gh-108512: Add and use new replacements for PySys_GetObject() (GH-111035)

Add functions PySys_GetAttr(), PySys_GetAttrString(),
PySys_GetOptionalAttr() and PySys_GetOptionalAttrString().

5 months agoGH-134848: Use a set to store ``AuditEvents.sources`` (#134849)
Adam Turner [Wed, 28 May 2025 16:30:53 +0000 (17:30 +0100)] 
GH-134848: Use a set to store ``AuditEvents.sources`` (#134849)

5 months agogh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (#134841)
Victor Stinner [Wed, 28 May 2025 15:43:52 +0000 (17:43 +0200)] 
gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (#134841)

Skip the test if the Python UTF-8 Mode is enabled and the LC_CTYPE
encoding is not UTF-8.

5 months agogh-133711: Log Windows OEM code page in test.pythoninfo (#134840)
Victor Stinner [Wed, 28 May 2025 15:41:11 +0000 (17:41 +0200)] 
gh-133711: Log Windows OEM code page in test.pythoninfo (#134840)

Add _winapi.GetOEMCP() function.

5 months agogh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (#134836)
Serhiy Storchaka [Wed, 28 May 2025 15:24:24 +0000 (18:24 +0300)] 
gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (#134836)

5 months agogh-133711: Fix test_regrtest for PYTHONUTF8=1 (#134839)
Victor Stinner [Wed, 28 May 2025 15:19:50 +0000 (17:19 +0200)] 
gh-133711: Fix test_regrtest for PYTHONUTF8=1 (#134839)

Use "backslashreplace" error handler to decode stdout and stderr.
Example:

    vstinner@WIN C:\victor\python\main\build\test_python_worker_8360\x91>
    "C:\victor\python\main\PCbuild\amd64\python_d.exe"  -m test
    --fast-ci --slow-ci --testdir
    C:\Users\vstinner\AppData\Local\Temp\tmp0t59e8da
    test_regrtest_noop1 test_regrtest_noop2 test_regrtest_noop3
    test_regrtest_noop4

Notice the "\x91" byte at the end of the first line: it's the
non-ASCII U+00E6 character encoded to the OEM cp437 code page.

5 months agogh-132983: Split ``_zstd_set_c_parameters`` (#133921)
Adam Turner [Wed, 28 May 2025 14:45:08 +0000 (15:45 +0100)] 
gh-132983: Split ``_zstd_set_c_parameters`` (#133921)

5 months agogh-128629: Add _Py_PACK_VERSION for CPython's own definitions (GH-134247)
Petr Viktorin [Wed, 28 May 2025 13:24:40 +0000 (15:24 +0200)] 
gh-128629: Add _Py_PACK_VERSION for CPython's own definitions (GH-134247)

Add _Py_PACK_VERSION for CPython's own definitions

Py_PACK_VERSION was added to limited API in 3.14, so if
Py_LIMITED_API is lower, the macro can't be used.
Add a private version that can be used in CPython headers
for checks like `Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 14)`.

5 months agogh-134160: Block multiple module initialization (#134773)
Petr Viktorin [Wed, 28 May 2025 07:53:04 +0000 (09:53 +0200)] 
gh-134160: Block multiple module initialization (#134773)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
5 months agoUpdate outdated statement from `math` about C standard (#134621)
Hugo van Kemenade [Wed, 28 May 2025 07:30:04 +0000 (10:30 +0300)] 
Update outdated statement from `math` about C standard (#134621)

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
5 months agogh-134817: Document [Timed]RotatingFileHandler shouldRollover method (GH-134818)
Allen Hernandez [Wed, 28 May 2025 06:44:38 +0000 (02:44 -0400)] 
gh-134817: Document [Timed]RotatingFileHandler shouldRollover method (GH-134818)

Co-authored-by: Allen Hernandez <2349718+AllenSH12@users.noreply.github.com>
5 months agoFix typing.TYPE_CHECKING docs to reflect PEP 649. (#134813)
larryhastings [Wed, 28 May 2025 06:08:52 +0000 (02:08 -0400)] 
Fix typing.TYPE_CHECKING docs to reflect PEP 649. (#134813)

typing.TYPE_CHECKING should no longer steer users towards
manual or automatic stringization (and PEP 563); PEP 649
makes all that unnecessary.

5 months agogh-127266: avoid data races when updating type slots (gh-133177)
Neil Schemenauer [Wed, 28 May 2025 01:27:41 +0000 (18:27 -0700)] 
gh-127266: avoid data races when updating type slots (gh-133177)

In the free-threaded build, avoid data races caused by updating type
slots or type flags after the type was initially created.  For those
(typically rare) cases, use the stop-the-world mechanism.  Remove the
use of atomics when reading or writing type flags.

5 months agogh-134580: Modernizing `difflib.HtmlDiff` for HTML Output (#134581)
Wulian233 [Wed, 28 May 2025 00:46:41 +0000 (08:46 +0800)] 
gh-134580: Modernizing `difflib.HtmlDiff` for HTML Output (#134581)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
5 months agogh-134679: Fix assertion failure in QSBR (gh-134811)
Sam Gross [Tue, 27 May 2025 20:21:16 +0000 (16:21 -0400)] 
gh-134679: Fix assertion failure in QSBR (gh-134811)

This is the same underlying bug as gh-130519. The destructor may call
arbitrary code, changing the `tstate->qsbr pointer` and invalidating the
old `struct _qsbr_thread_state`.

5 months agogh-134789: Document del s[i] operation for mutable sequences (#134804)
Rishabh Singh [Tue, 27 May 2025 18:48:04 +0000 (00:18 +0530)] 
gh-134789: Document del s[i] operation for mutable sequences (#134804)

[main] Update stdtypes.rst

- Added explicit mention of `del s[i]` (item deletion by index) to the Mutable Sequence Types section.
- Clarified that this operation removes the item at the specified index from the sequence.
- Addresses issue #134789.

5 months agogh-131798: Optimize `_ITER_CHECK_TUPLE` (GH-134803)
Noam Cohen [Tue, 27 May 2025 18:30:17 +0000 (21:30 +0300)] 
gh-131798: Optimize `_ITER_CHECK_TUPLE` (GH-134803)

5 months agogh-132917: fix data race on `last_mem` in free-threading gc (#134692)
Kumar Aditya [Tue, 27 May 2025 17:12:08 +0000 (22:42 +0530)] 
gh-132917: fix data race on `last_mem` in free-threading gc  (#134692)

5 months agogh-134043: use stackrefs in vectorcalling methods (#134044)
Kumar Aditya [Tue, 27 May 2025 16:58:27 +0000 (22:28 +0530)] 
gh-134043: use stackrefs in vectorcalling methods (#134044)

Adds `_PyObject_GetMethodStackRef` which uses stackrefs and takes advantage of deferred reference counting in free-threading while calling method objects in vectorcall.

5 months agogh-134262: increase retries in `Tools/build/generate_sbom.py` (#134558)
Emma Smith [Tue, 27 May 2025 16:02:17 +0000 (09:02 -0700)] 
gh-134262: increase retries in `Tools/build/generate_sbom.py` (#134558)

5 months agogh-132775: Always Set __builtins__ In _PyFunction_FromXIData() (gh-134758)
Eric Snow [Tue, 27 May 2025 15:42:24 +0000 (09:42 -0600)] 
gh-132775: Always Set __builtins__ In _PyFunction_FromXIData() (gh-134758)

This is a small follow-up to gh-133481.  There's a corner case
in the behavior of PyImport_ImportModuleAttrString(), where
it expects __builtins__ to be set if __globals__ is set.

5 months agogh-133678: Document C API third party tools (#134526)
Victor Stinner [Tue, 27 May 2025 15:38:30 +0000 (17:38 +0200)] 
gh-133678: Document C API third party tools (#134526)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Steve Dower <steve.dower@python.org>
5 months agoGH-132554: "Virtual" iterators (GH-132555)
Mark Shannon [Tue, 27 May 2025 14:59:45 +0000 (15:59 +0100)] 
GH-132554: "Virtual" iterators (GH-132555)

* FOR_ITER now pushes either the iterator and NULL or leaves the iterable and pushes tagged zero

* NEXT_ITER uses the tagged int as the index into the sequence or, if TOS is NULL, iterates as before.

5 months agogh-134744: Fix fcntl error handling (#134748)
Victor Stinner [Tue, 27 May 2025 13:09:46 +0000 (15:09 +0200)] 
gh-134744: Fix fcntl error handling (#134748)

Fix also reference leak on buffer overflow.

5 months agoUpdate README.rst informations from 3.14 to 3.15 (#134649)
Wulian233 [Tue, 27 May 2025 12:45:54 +0000 (20:45 +0800)] 
Update README.rst informations from 3.14 to 3.15 (#134649)

Co-authored-by: Wulian233 <1055917385@qq.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
5 months agogh-133579: consistently report C curses function failures (#134327)
Bénédikt Tran [Tue, 27 May 2025 10:15:16 +0000 (12:15 +0200)] 
gh-133579: consistently report C curses function failures (#134327)

Some curses module-level functions and window methods now raise
a `curses.error` when a call to a C curses function fails:

- Module-level functions: assume_default_colors, baudrate, cbreak,
  echo, longname, initscr, nl, raw, termattrs, termname, and unctrl.
- Window methods: addch, addnstr, addstr, border, box, chgat,
  getbkgd, inch, insstr, and insnstr.

In addition, `curses.window.refresh` and `curses.window.noutrefresh`
now raise a `TypeError` instead of a `curses.error` when called with an
incorrect number of arguments for pads.

See also ee36db550076e5a9185444ffbc53eaf8157ef04c for similar
changes.

5 months agogh-134210: refactor signal handling in `_curses.window.{get_wch,getkey}` (#134646)
Bénédikt Tran [Tue, 27 May 2025 08:57:41 +0000 (10:57 +0200)] 
gh-134210: refactor signal handling in `_curses.window.{get_wch,getkey}` (#134646)

5 months agogh-134210: handle signals in `_curses.window.getch` (#134326)
Bénédikt Tran [Tue, 27 May 2025 08:51:05 +0000 (10:51 +0200)] 
gh-134210: handle signals in `_curses.window.getch` (#134326)