Commit graph

127174 commits

Author SHA1 Message Date
Miss Islington (bot)
370f91b946
[3.14] gh-134906: Document CompressionParameter.content_size_flag (GH-134907) (#134915)
gh-134906: Document CompressionParameter.content_size_flag (GH-134907)

* Document CompressionParameter.content_size_flag
(cherry picked from commit 5f60d0fccc)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-30 04:43:33 +00:00
Miss Islington (bot)
4927596c49
[3.14] ast docs: Fix description of ast.Constant (GH-134741) (#134911)
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.
(cherry picked from commit 381020d41f)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-30 04:17:18 +00:00
Miss Islington (bot)
9c2e0febb4
[3.14] gh-132775: Fix _PyFunctIon_VerifyStateless() (gh-134901)
gh-132775: Fix _PyFunctIon_VerifyStateless() ()

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.

(cherry picked from commit dafd14146f, AKA gh-134900)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-29 20:55:42 +00:00
Miss Islington (bot)
4670dddbf6
[3.14] GH-133912: Fix PyObject_GenericSetDict to handle inline values (GH-134725) (#134859) 2025-05-29 11:19:58 -07:00
Miss Islington (bot)
2d40dd01fa
[3.14] gh-133260: Remove claim that PyUnicode_InternFromString immortalizes (GH-134213) (GH-134883)
(cherry picked from commit 4109a9c6b3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-05-29 13:43:27 +00:00
Miss Islington (bot)
da4f37596f
[3.14] gh-69011: clarify & deduplicate ctypes.create_*_buffer docs (GH-132858) (GH-134881)
This adds a warning about the possibly-missing NUL terminator, but in a way
that doesn't make it sound like a bug/wart.
(cherry picked from commit b783e1791b)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-05-29 13:23:19 +00:00
Miss Islington (bot)
7dc4496655
[3.14] gh-134262: Add retries to generate_sbom.py (GH-134460)
(cherry picked from commit 0c5a8b0b55)

Includes fix for off-by-one error from GH-134867
(cherry-picked from commit e64395e8eb)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-28 23:52:31 +00:00
Miss Islington (bot)
34b451532b
[3.14] gh-134262: Add retries to downloads in PCbuild\get_external.py (GH-134865)
(cherry picked from commit e9d845b41d)

Includes fix for off-by-one error from GH-134867
(cherry-picked from commit e64395e8eb)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-05-28 23:47:26 +00:00
Miss Islington (bot)
52bae918c3
[3.14] gh-108885: Imporove tests for doctest (GH-134832) (GH-134855)
Test the error and failure report in more detail.
(cherry picked from commit f6324bc7ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-28 17:41:07 +00:00
Miss Islington (bot)
381144f043
[3.14] GH-134848: Use a set to store `AuditEvents.sources` (GH-134849) (#134853)
GH-134848: Use a set to store ``AuditEvents.sources`` (GH-134849)
(cherry picked from commit b265a7ddeb)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 16:37:57 +00:00
Miss Islington (bot)
4841201666
[3.14] gh-132983: Convert dict_content to take Py_buffer in `ZstdDict()` (GH-133924) (#134723)
gh-132983: Convert dict_content to take Py_buffer in ``ZstdDict()`` (GH-133924)
(cherry picked from commit f2ce4bbdfd)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 17:25:35 +01:00
Miss Islington (bot)
117bb29f6b
[3.14] gh-132983: Split `_zstd_set_c_parameters` (GH-133921) (#134838)
gh-132983: Split ``_zstd_set_c_parameters`` (GH-133921)
(cherry picked from commit 11f7a939de)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 17:25:06 +01:00
Miss Islington (bot)
072d03352c
[3.14] gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (GH-134841) (#134851)
gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (GH-134841)

Skip the test if the Python UTF-8 Mode is enabled and the LC_CTYPE
encoding is not UTF-8.
(cherry picked from commit 4635115c3f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-28 16:10:37 +00:00
Miss Islington (bot)
24404494fb
[3.14] gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836) (#134845)
gh-128840: Fix parsing long IPv6 addresses with embedded IPv4 address (GH-134836)
(cherry picked from commit d83576bf48)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-05-28 15:50:40 +00:00
Miss Islington (bot)
afb5221b3d
[3.14] gh-133711: Fix test_regrtest for PYTHONUTF8=1 (GH-134839) (#134842)
gh-133711: Fix test_regrtest for PYTHONUTF8=1 (GH-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.
(cherry picked from commit 91618278e7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-05-28 15:48:03 +00:00
Miss Islington (bot)
7515384974
[3.14] gh-134817: Document [Timed]RotatingFileHandler shouldRollover method (GH-134818) (GH-134823)
(cherry picked from commit 7be5916f6d)
2025-05-28 12:32:59 +00:00
Miss Islington (bot)
998cedb9bc
[3.14] gh-134160: Block multiple module initialization (GH-134773) (#134827)
gh-134160: Block multiple module initialization (GH-134773)
(cherry picked from commit 469a56470b)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-28 07:58:49 +00:00
Miss Islington (bot)
2194729f3a
[3.14] Update outdated statement from math about C standard (GH-134621) (#134825)
Update outdated statement from `math` about C standard (GH-134621)
(cherry picked from commit 21672b694b)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-05-28 07:36:40 +00:00
Miss Islington (bot)
0aa0b9b05f
[3.14] Fix typing.TYPE_CHECKING docs to reflect PEP 649. (GH-134813) (#134822)
Fix typing.TYPE_CHECKING docs to reflect PEP 649. (GH-134813)

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

Co-authored-by: larryhastings <larry@hastings.org>
2025-05-27 23:15:17 -07:00
Miss Islington (bot)
3681e3a831
[3.14] gh-134679: Fix assertion failure in QSBR (gh-134811) (gh-134814)
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`.
(cherry picked from commit a4d37f88b6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-05-27 20:46:02 +00:00
Chris Eibl
6c74700dd8
[3.14] gh-134774: Remove additional Py_DEBUG definition (GH-134791) 2025-05-27 20:08:41 +01:00
Miss Islington (bot)
0ea41f8464
[3.14] gh-134789: Document del s[i] operation for mutable sequences (GH-134804) (#134808)
gh-134789: Document del s[i] operation for mutable sequences (GH-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 GH-134789.
(cherry picked from commit 967f361993)

Co-authored-by: Rishabh Singh <67859818+rishabh11336@users.noreply.github.com>
2025-05-27 18:53:52 +00:00
Miss Islington (bot)
cc81b63a75
[3.14] gh-132917: fix data race on last_mem in free-threading gc (GH-134692) (#134802)
gh-132917: fix data race on `last_mem` in free-threading gc  (GH-134692)
(cherry picked from commit ac539e7e0d)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-27 18:00:19 +00:00
Victor Stinner
8a6a6f39c8
[3.14] gh-134744: Fix fcntl error handling (#134748) (#134795)
gh-134744: Fix fcntl error handling (#134748)

Fix also reference leak on buffer overflow.

(cherry picked from commit 9300a596d3)
2025-05-27 16:13:20 +00:00
Miss Islington (bot)
6493395f4b
[3.14] gh-132775: Always Set __builtins__ In _PyFunction_FromXIData() (gh-134794)
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.

(cherry picked from commit 9b5e80000, AKA gh-134758)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2025-05-27 16:07:44 +00:00
Miss Islington (bot)
a1b6252c88
[3.14] gh-133678: Document C API third party tools (GH-134526) (#134793)
gh-133678: Document C API third party tools (GH-134526)
(cherry picked from commit c3c88064f5)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Steve Dower <steve.dower@python.org>
2025-05-27 15:45:08 +00:00
Mark Shannon
00122c8b2a
[3.14] GH-128161: Remove redundant GET_ITER from list comprehension code (GH-134778) 2025-05-27 12:29:48 +01:00
Miss Islington (bot)
266b541cc6
[3.14] gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (GH-134777) (GH-134781)
gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (GH-134777)
(cherry picked from commit 8704d6b391)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2025-05-27 11:28:30 +02:00
Miss Islington (bot)
58549cfd49
[3.14] gh-134210: handle signals in _curses.window.getch (GH-134326) (#134783)
gh-134210: handle signals in `_curses.window.getch` (GH-134326)
(cherry picked from commit 51762b6cad)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-27 09:16:50 +00:00
Miss Islington (bot)
452d098c0b
[3.14] gh-134752: Improve speed of test_tokenize.StringPrefixTest.test_prefixes. (GH-134766) (#134782)
gh-134752: Improve speed of test_tokenize.StringPrefixTest.test_prefixes. (GH-134766)
(cherry picked from commit 579686d9fb)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-05-27 09:16:23 +00:00
Miss Islington (bot)
0f93b2f862
[3.14] gh-134664: document cleanup_socket parameter in asyncio.start_unix_server (GH-134750) (#134779)
gh-134664: document `cleanup_socket` parameter in `asyncio.start_unix_server` (GH-134750)
(cherry picked from commit 92ea1eb38f)

Co-authored-by: Shamil <ashm.tech@proton.me>
2025-05-27 14:04:43 +05:30
Miss Islington (bot)
b6e624a3fc
[3.14] gh-134160: Use multi-phase init in documentation examples (GH-134296) (#134753)
gh-134160: Use multi-phase init in documentation examples (GH-134296)
(cherry picked from commit 96905bdd27)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-26 21:50:18 +00:00
Eric Snow
e86efabaee
[3.14] gh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134736)
This reverts commit 7476f90af2, AKA gh-134600.

This effectively unreverts commit bbf8048c0f (gh-134515).
2025-05-26 19:41:14 +00:00
Miss Islington (bot)
74f5667bd9
[3.14] 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. (GH-134734) (#134739)
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. (GH-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.
(cherry picked from commit 08c78e02fa)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2025-05-26 15:24:24 -04:00
Miss Islington (bot)
c6cc28299e
[3.14] gh-134557: Suppress immortalization in _PyCode_GetScriptXIData under free-threading (gh134738)
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.

(cherry picked from commit c60f39ada6, AKA gh-134686)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2025-05-26 13:14:58 -06:00
Hugo van Kemenade
bc3d892113 Merge branch '3.14' of https://github.com/python/cpython into 3.14 2025-05-26 21:51:15 +03:00
Miss Islington (bot)
8c699015c5
[3.14] gh-134637: Fix performance regression in calling ctypes function pointer in free threading. (GH-134702) (#134742)
gh-134637: Fix performance regression in calling `ctypes` function pointer in `free threading`. (GH-134702)

Fix performance regression in calling `ctypes` function pointer in `free threading`.
(cherry picked from commit 3c0525126e)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-05-26 18:51:13 +00:00
Hugo van Kemenade
cde768cd63 Post 3.14.0b2 2025-05-26 21:50:01 +03:00
Miss Islington (bot)
b187e9403c
[3.14] Add CODEOWNERS and YAML to end-of-file-fixer and trailing-whitespace (GH-134730) (#134737) 2025-05-26 18:08:37 +00:00
Miss Islington (bot)
9ddc7c548d
[3.14] gh-119180: Updates to PEP 649/749 docs (GH-134640) (#134731)
gh-119180: Updates to PEP 649/749 docs (GH-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.
(cherry picked from commit 7291eaba8b)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2025-05-26 15:40:43 +00:00
Miss Islington (bot)
2a089244f0
[3.14] gh-134693: Fix [-Wmaybe-uninitialized] warning in _remote_debugging_module.c (GH-134694) (#134726)
gh-134693: Fix `[-Wmaybe-uninitialized]` warning in `_remote_debugging_module.c` (GH-134694)
(cherry picked from commit 806107d7a2)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-26 15:32:52 +00:00
Miss Islington (bot)
aded785b8c
[3.14] gh-91048: Add better error messages for remote debugging for CI builds (GH-134682) (#134719) 2025-05-26 15:04:36 +00:00
Miss Islington (bot)
01ccc824ca
[3.14] Add CODEOWNERS for remote debugging (GH-134720) (#134721) 2025-05-26 15:46:51 +01:00
Hugo van Kemenade
12d3f883ae Python 3.14.0b2 2025-05-26 16:26:47 +03:00
Miss Islington (bot)
6c917cb11c
[3.14] gh-91048: Correct Apple platform includes for iOS. (GH-134712) (#134714)
Correct Apple platform includes for iOS.
(cherry picked from commit 965662ee4a)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2025-05-26 13:10:37 +00:00
Miss Islington (bot)
da3d55403a
[3.14] gh-132710: add missing NEWS entry for GH-134697 (GH-134705) (#134707)
gh-132710: add missing NEWS entry for GH-134697 (GH-134705)
(cherry picked from commit 9eb84d83e0)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-26 12:46:29 +02:00
Bénédikt Tran
072f50fc12
[3.14] gh-132710: only use stable _uuid.generate_time_safe() to deduce MAC address (GH-132901) (#134697)
(cherry picked from commit 3bffada467)
2025-05-26 10:45:36 +00:00
Miss Islington (bot)
c8379c7edf
[3.14] gh-134559: Add versionadded for `object.__replace__()` (GH-134672) (#134699)
gh-134559: Add versionadded for ``object.__replace__()`` (GH-134672)
(cherry picked from commit 71290a6fbe)

Co-authored-by: tmlnv <108088921+tmlnv@users.noreply.github.com>
2025-05-26 10:29:51 +00:00
Bénédikt Tran
ed52549c37
[3.14] gh-134208: remove dead AC directives for _curses.window.{chgat,getstr,instr} (GH-134325) (#134701)
(cherry picked from commit 29e8115964)
2025-05-26 10:09:02 +00:00
Miss Islington (bot)
dc441efbd0
[3.14] gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (GH-133415) (#133796)
gh-132493: Remove __annotations__ usage in inspect._signature_is_functionlike (GH-133415)

This check is potentially problematic because it could force evaluation of
annotations unnecessarily. This doesn't trigger for builtin objects (functions,
classes, or modules) with annotations, but it could trigger for third-party objects.

The check was not particularly useful anyway, because it succeeds if ``__annotations__``
is a dict or None, so the only thing this did was guard against objects that have an
``__annotations__`` attribute that is of some other type. That doesn't seem particularly
useful, so I just removed the check.
(cherry picked from commit cb6596c6aa)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-05-26 08:22:14 +00:00