]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

5 months agogh-134752: Improve speed of test_tokenize.StringPrefixTest.test_prefixes. (#134766)
Eric V. Smith [Tue, 27 May 2025 08:49:28 +0000 (04:49 -0400)] 
gh-134752: Improve speed of test_tokenize.StringPrefixTest.test_prefixes. (#134766)

5 months agogh-134635: add `zlib.{adler32,crc32}_combine` to combine checksums (#134650)
Bénédikt Tran [Tue, 27 May 2025 08:48:34 +0000 (10:48 +0200)] 
gh-134635: add `zlib.{adler32,crc32}_combine` to combine checksums (#134650)

5 months agogh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks...
Miro Hrončok [Tue, 27 May 2025 08:25:12 +0000 (10:25 +0200)] 
gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (#134777)

5 months agogh-134664: document `cleanup_socket` parameter in `asyncio.start_unix_server` (#134750)
Shamil [Tue, 27 May 2025 08:23:06 +0000 (11:23 +0300)] 
gh-134664: document `cleanup_socket` parameter in `asyncio.start_unix_server` (#134750)

5 months agogh-134583: Update devcontainer reference to include image with libzstd-devel (gh...
Emma Smith [Tue, 27 May 2025 01:24:38 +0000 (18:24 -0700)] 
gh-134583: Update devcontainer reference to include image with libzstd-devel (gh-134765)

Update devcontainer reference

5 months agogh-134160: Use multi-phase init in documentation examples (#134296)
neonene [Mon, 26 May 2025 21:43:35 +0000 (06:43 +0900)] 
gh-134160: Use multi-phase init in documentation examples (#134296)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
5 months agogh-134637: Fix performance regression in calling `ctypes` function pointer in `free...
Kumar Aditya [Mon, 26 May 2025 18:26:40 +0000 (23:56 +0530)] 
gh-134637: Fix performance regression in calling `ctypes` function pointer in `free threading`. (#134702)

Fix performance regression in calling `ctypes` function pointer in `free threading`.

5 months agogh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134735)
Eric Snow [Mon, 26 May 2025 17:50:10 +0000 (11:50 -0600)] 
gh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134735)

This reverts commit 8a793c4a365d06a7264887698ccd7d6ba6aba9f2, AKA gh-134599.

This effectively re-applies commit 09e72cf (gh-134511)

5 months agogh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add...
Eric V. Smith [Mon, 26 May 2025 17:49:39 +0000 (13:49 -0400)] 
gh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add a test to make sure we catch this error in the future. (#134734)

* Add t-string prefixes to _all_string_prefixes, and add a test to make sure we catch this error in the future.

* Update lexical analysis docs for t-string prefixes.

5 months agogh-134557: Suppress immortalization in _PyCode_GetScriptXIData under free-threading...
neonene [Mon, 26 May 2025 17:46:49 +0000 (02:46 +0900)] 
gh-134557: Suppress immortalization in _PyCode_GetScriptXIData under free-threading (gh-134686)

Disable immortalization around Py_CompileString*().

The same approach as 332356b that fixed the refleaks in compile() and eval().

E: 09e72cf can pass test_capi, test_sys and test__interpchannels with this patch for me.

5 months agoAdd CODEOWNERS and YAML to end-of-file-fixer and trailing-whitespace (#134730)
Hugo van Kemenade [Mon, 26 May 2025 17:42:38 +0000 (20:42 +0300)] 
Add CODEOWNERS and YAML to end-of-file-fixer and trailing-whitespace (#134730)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
5 months agogh-119180: Updates to PEP 649/749 docs (#134640)
Jelle Zijlstra [Mon, 26 May 2025 15:35:04 +0000 (08:35 -0700)] 
gh-119180: Updates to PEP 649/749 docs (#134640)

- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>