Commit graph

127256 commits

Author SHA1 Message Date
Wulian233
176b059fa0
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>
2025-05-27 12:45:54 +00:00
Bénédikt Tran
30dde1eeb3
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 ee36db5500 for similar
changes.
2025-05-27 10:15:16 +00:00
Bénédikt Tran
604f83550b
gh-134210: refactor signal handling in _curses.window.{get_wch,getkey} (#134646) 2025-05-27 10:57:41 +02:00
Bénédikt Tran
51762b6cad
gh-134210: handle signals in _curses.window.getch (#134326) 2025-05-27 10:51:05 +02:00
Eric V. Smith
579686d9fb
gh-134752: Improve speed of test_tokenize.StringPrefixTest.test_prefixes. (#134766) 2025-05-27 04:49:28 -04:00
Bénédikt Tran
737b4ba020
gh-134635: add zlib.{adler32,crc32}_combine to combine checksums (#134650) 2025-05-27 10:48:34 +02:00
Miro Hrončok
8704d6b391
gh-62824: Adjust test_alias_modules_exist test to use imports instead of file checks (#134777) 2025-05-27 10:25:12 +02:00
Shamil
92ea1eb38f
gh-134664: document cleanup_socket parameter in asyncio.start_unix_server (#134750) 2025-05-27 08:23:06 +00:00
Emma Smith
9bf03c6c30
gh-134583: Update devcontainer reference to include image with libzstd-devel (gh-134765)
Update devcontainer reference
2025-05-27 10:24:38 +09:00
neonene
96905bdd27
gh-134160: Use multi-phase init in documentation examples (#134296)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-26 21:43:35 +00:00
Kumar Aditya
3c0525126e
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`.
2025-05-26 18:26:40 +00:00
Eric Snow
56743afe87
gh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134735)
This reverts commit 8a793c4a36, AKA gh-134599.

This effectively re-applies commit 09e72cf (gh-134511)
2025-05-26 11:50:10 -06:00
Eric V. Smith
08c78e02fa
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.
2025-05-26 13:49:39 -04:00
neonene
c60f39ada6
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.
2025-05-26 11:46:49 -06:00
Hugo van Kemenade
b8a885ce63
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>
2025-05-26 18:42:38 +01:00
Jelle Zijlstra
7291eaba8b
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>
2025-05-26 08:35:04 -07:00
sobolevn
806107d7a2
gh-134693: Fix [-Wmaybe-uninitialized] warning in _remote_debugging_module.c (#134694) 2025-05-26 16:06:33 +01:00
Adam Turner
f2ce4bbdfd
gh-132983: Convert dict_content to take Py_buffer in `ZstdDict()` (#133924) 2025-05-26 14:48:41 +00:00
Pablo Galindo Salgado
7774869b1b
Add trailing line to CODEOWNERS (#134722) 2025-05-26 15:47:09 +01:00
Pablo Galindo Salgado
ce0561fa59
Add CODEOWNERS for remote debugging (#134720) 2025-05-26 14:36:30 +00:00
Pablo Galindo Salgado
0909d6d8e8
gh-91048: Add better error messages for remote debugging for CI builds (#134682) 2025-05-26 15:31:47 +01:00
Russell Keith-Magee
965662ee4a
gh-91048: Correct Apple platform includes for iOS. (#134712)
Correct Apple platform includes for iOS.
2025-05-26 12:44:41 +00:00
Bénédikt Tran
9eb84d83e0
gh-132710: add missing NEWS entry for GH-132901 (#134705) 2025-05-26 10:38:16 +00:00
Bénédikt Tran
cb8045e86c
gh-134531: cleanup _hashopenssl.c to support EVP_MAC (#134626)
Rename components related to `_hashlib.{HASH,HASHXOF}` objects.

- The `EVPobject` structure is renamed `HASHobject`.
- Non-clinic `HASH` methods are now prefixed by `_hashlib_HASH_*`.
  A similar change is made for non-clinic `HASHXOF` methods.
- Functions extracting information from `EVP_MD` objects and functions
  constructing `EVP_MD` objects now include `openssl_evp_md` in their name.

This change allows us to avoid future ambiguities between the `EVP_MD`
and the `EVP_MAC` APIs (currently, we only use `EVP_MD` for hash functions
and rely on the legacy interface for HMAC instead of using `EVP_MAC`).
2025-05-26 10:12:32 +00:00
tmlnv
71290a6fbe
gh-134559: Add versionadded for `object.__replace__()` (#134672) 2025-05-26 10:39:04 +01:00
Bénédikt Tran
3bffada467
gh-132710: only use stable _uuid.generate_time_safe() to deduce MAC address (#132901) 2025-05-26 10:56:31 +02:00
Bénédikt Tran
29e8115964
gh-134208: remove dead AC directives for _curses.window.{chgat,getstr,instr} (#134325) 2025-05-26 10:52:19 +02:00
Pieter Eendebak
fb09db1b93
gh-129594: Remove redundant check on varargs in _PyArg_CheckPositional (#129595) 2025-05-26 10:51:12 +02:00
Sergey B Kirpichev
cf8941c603
gh-132876: workaround broken ldexp() on Windows 10 (#133135)
* gh-132876: workaround broken ldexp() on Windows 10

ldexp() fails to round subnormal results before Windows 11,
so hide their bug.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
2025-05-25 21:44:33 -05:00
Loïc Simon
0e3bc962c6
gh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181)
Co-authored-by: Loïc Simon <loic.simon@napta.io>
2025-05-26 01:05:08 +02:00
R. David Murray
a32ea45699
gh-134152: Fix UnboundLocalError in email._header_value_parser _get_ptext_to_endchars (#134233)
Fix an UnboundLocalError that can occur when parsing certain delimited constructs in headers (domain literals, quoted strings, comments). After the fix the _get_ptext_to_endchars returns an empty string if there is no content after the opening delimiter. The calling code is responsible for handling the lack of the trailing delimiter, which it already does; this edge case was the header ending immediately after the opening delimiter.
2025-05-25 18:09:32 -04:00
Pablo Galindo Salgado
7b1a700231
Heavily comment Python/perf_jit_trampoline.c to improve maintainability (#134527)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2025-05-25 21:37:15 +01:00
Pablo Galindo Salgado
42b25ad4d3
gh-91048: Refactor and optimize remote debugging module (#134652)
Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.

Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.

Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-25 20:19:29 +00:00
Hugo van Kemenade
328a778db8
gh-134357: Remove unused imports in tests (#134340) 2025-05-25 20:09:02 +00:00
Julien Palard
24a47155d2
Fix sphinx-lint warnings (default-role used). (GH-134647) 2025-05-25 21:22:52 +02:00
Chris Eibl
1000283694
GH-130328: Fix WindowsConsoleGetEventTests after gh-133728 (gh-134660) 2025-05-25 20:17:13 +02:00
Jelle Zijlstra
57fef27cfc
gh-133960: Improve typing.evaluate_forward_ref (#133961)
As explained in #133960, this removes most of the behavior differences with ForwardRef.evaluate.
The remaining difference is about recursive evaluation of forwardrefs; this is practically useful
in cases where an annotation refers to a type alias that itself is string-valued.

This also improves several edge cases that were previously not handled optimally. For example,
the function now takes advantage of the partial evaluation behavior of ForwardRef.evaluate() to
evaluate more ForwardRefs in the FORWARDREF format.

This also fixes #133959 as a side effect, because the buggy behavior in #133959 derives from
evaluate_forward_ref().
2025-05-25 17:26:39 +00:00
Jelle Zijlstra
b51b08a0a5
annotationlib docs: note that ForwardRef.evaluate eventually defaults to empty globals (#134661) 2025-05-25 17:23:28 +00:00
Loïc Simon
52509cc94b
gh-134582: Fix t-strings untokenize() roundtrip removing space between braces (#134603) 2025-05-25 17:23:38 +01:00
Jelle Zijlstra
3e562b3942
gh-133684: Fix get_annotations() where PEP 563 is involved (#133795) 2025-05-25 08:40:58 -07:00
Jelle Zijlstra
4443110c34
gh-133778: Fix setting __annotations__ under PEP 563 (#133794) 2025-05-25 08:38:18 -07:00
Chris Eibl
91b48868a8
GH-130328: Speedup pasting in legacy console on Windows (gh-133728) 2025-05-25 15:17:43 +02:00
ggqlq
2fd09b0110
gh-134168: fix http.server CLI support for IPv6 and --directory when serving over HTTPS (#134169) 2025-05-24 12:19:20 +00:00
Bénédikt Tran
5d9c8fe3f6
gh-131178: add E2E mockless tests for http.server command-line interface (#134279) 2025-05-24 13:48:50 +02:00
Jasper Wong
7b1010a57d
gh-134595: Update HOWTO to reflect change in CIBW option (#134598) 2025-05-24 10:15:00 +03:00
Eddy Mulyono
80284b5c5e
gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462)
Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform
Have multiprocessing.freeze_support() enable on spawn, not just win32.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-24 03:50:19 +00:00
Anthony Sottile
74a9c60f3e
gh-134546: ensure remote pdb script is readable (#134552) 2025-05-23 23:07:39 -04:00
Seth Michael Larson
47f1161d3a
gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841)
GH-128840: Limit the number of parts in IPv6 address parsing
Limit length of IP address string to 39

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-05-24 02:57:13 +00:00
Emma Smith
973b8f69d3
gh-132983: Make _zstd C code PEP 7 compliant (GH-134605)
Make _zstd C code PEP 7 compliant
2025-05-23 19:03:21 -07:00
Emma Smith
f478331f98
gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (#134601)
Slightly tweak error messages for options dict
2025-05-23 14:51:41 -07:00