]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
6 months agoGH-133410: Use commit hashes for change detection (gh-133416)
Adam Turner [Mon, 5 May 2025 08:49:12 +0000 (09:49 +0100)] 
GH-133410: Use commit hashes for change detection (gh-133416)

6 months agogh-113081: Highlight source code in pdb (#133355)
Tian Gao [Mon, 5 May 2025 07:49:52 +0000 (00:49 -0700)] 
gh-113081: Highlight source code in pdb (#133355)

6 months agogh-128307: Support eager_start=<bool> in create_eager_task_factory and various creat...
Thomas Grainger [Mon, 5 May 2025 04:58:07 +0000 (05:58 +0100)] 
gh-128307:  Support eager_start=<bool> in create_eager_task_factory and various create_task functions (#128306)

Some create_task() functions were changed from `name=None, context=None` to `**kwargs`.

Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
6 months ago[GH-133419] fix test_external_inspection race assert (#133422)
Gregory P. Smith [Mon, 5 May 2025 04:41:22 +0000 (21:41 -0700)] 
[GH-133419] fix test_external_inspection race assert (#133422)

[tests] fix test_external_inspection race assert

either line could be where the inspection finds the foo()
function as after ready is sent, the process may not have made progress
onto the next line yet.  "solve" by putting the statements on the same
line.

6 months ago[tests] test_subprocess maybe avoid a timeout race condition? (#133420)
Gregory P. Smith [Mon, 5 May 2025 04:02:16 +0000 (21:02 -0700)] 
[tests] test_subprocess maybe avoid a timeout race condition? (#133420)

The few buildbot failures on https://github.com/python/cpython/pull/133103
are possibly just due to racing a child process launch and exit?

6 months agogh-133371: Don't optimize `LOAD_FAST` instructions whose local is killed by `DELETE_F...
mpage [Mon, 5 May 2025 04:00:11 +0000 (21:00 -0700)] 
gh-133371: Don't optimize `LOAD_FAST` instructions whose local is killed by `DELETE_FAST` (#133383)

In certain cases it's possible for locals loaded by `LOAD_FAST` instructions
to be on the stack when the local is killed by `DEL_FAST`. These `LOAD_FAST`
instructions should not be optimized into `LOAD_FAST_BORROW` as the strong
reference in the frame is killed while there is still a reference on the stack.

6 months agogh-133089: Use original timeout value for `TimeoutExpired` when the func `subprocess...
Nadeshiko Manju [Mon, 5 May 2025 01:15:31 +0000 (09:15 +0800)] 
gh-133089: Use original timeout value for `TimeoutExpired` when the func `subprocess.run` is called with a timeout (GH-133103)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
6 months agogh-133376: build: allow parser.c to be created if missing (#133378)
dura0ok [Mon, 5 May 2025 00:34:31 +0000 (07:34 +0700)] 
gh-133376: build: allow parser.c to be created if missing (#133378)

6 months agoGH-91048: Minor fixes for ``_remotedebugging`` & rename to ``_remote_debugging``...
Adam Turner [Mon, 5 May 2025 00:30:14 +0000 (01:30 +0100)] 
GH-91048: Minor fixes for ``_remotedebugging`` & rename to ``_remote_debugging`` (#133398)

6 months agogh-131421: Fix ASDL tests (#133408)
Jelle Zijlstra [Sun, 4 May 2025 23:46:21 +0000 (16:46 -0700)] 
gh-131421: Fix ASDL tests (#133408)

PR #131419 broke this, but we failed to run tests on the PR due to a bug
in our script.

6 months agogh-131421: fix ASDL grammar for `Dict` to have an `expr?*` keys field (#131419)
Samuel [Sun, 4 May 2025 23:03:38 +0000 (00:03 +0100)] 
gh-131421: fix ASDL grammar for `Dict` to have an `expr?*` keys field (#131419)

In the `ast` documentation for Python:

* https://docs.python.org/3/library/ast.html#ast.Dict
it is made clear that:

> When doing dictionary unpacking using dictionary literals the expression to be expanded goes in the values list, with a `None` at the corresponding position in `keys`.

Hence, `keys` is really a `expr?*` and *not* a `expr*`.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
6 months agogh-125618: Make FORWARDREF format succeed more often (#132818)
Jelle Zijlstra [Sun, 4 May 2025 22:21:56 +0000 (15:21 -0700)] 
gh-125618: Make FORWARDREF format succeed more often (#132818)

Fixes #125618.

6 months agogh-91048: Add filename and line number to external inspection routines (GH-133385)
Pablo Galindo Salgado [Sun, 4 May 2025 21:33:37 +0000 (23:33 +0200)] 
gh-91048: Add filename and line number to external inspection routines (GH-133385)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
6 months agogh-131178: Add tests for `ast` command-line interface (#133329)
Semyon Moroz [Sun, 4 May 2025 21:11:13 +0000 (01:11 +0400)] 
gh-131178: Add tests for `ast` command-line interface (#133329)

Co-authored-by: sobolevn <mail@sobolevn.me>
6 months agoRegenerate pcbuild.sln in Visual Studio 2022 (#133394)
Adam Turner [Sun, 4 May 2025 20:10:19 +0000 (21:10 +0100)] 
Regenerate pcbuild.sln in Visual Studio 2022 (#133394)

* Regenerate pcbuild.sln in Visual Studio 2022
* Move _remotedebugging to the end

6 months agogh-133042: disable HACL* HMAC on Emscripten (#133064)
Bénédikt Tran [Sun, 4 May 2025 19:55:49 +0000 (21:55 +0200)] 
gh-133042: disable HACL* HMAC on Emscripten (#133064)

6 months agogh-133351: Fix remote PDB's multi-line block tab completion (#133387)
Matt Wozniski [Sun, 4 May 2025 19:20:28 +0000 (15:20 -0400)] 
gh-133351: Fix remote PDB's multi-line block tab completion (#133387)

6 months agogh-109700: Improve stress tests for interpreter creation (GH-109946)
Serhiy Storchaka [Sun, 4 May 2025 18:53:24 +0000 (21:53 +0300)] 
gh-109700: Improve stress tests for interpreter creation (GH-109946)

* Ensure that destructors are called in the test that created interpreters, not after finishing it.
* Try to create/run interpreters in threads simultaneously.
* Mark tests that requires over 6GB of memory with bigmemtest.

6 months agogh-81793: Skip tests for os.link() to symlink on Android (GH-133388)
Serhiy Storchaka [Sun, 4 May 2025 18:48:06 +0000 (21:48 +0300)] 
gh-81793: Skip tests for os.link() to symlink on Android (GH-133388)

6 months agogh-126835: Rename `ast_opt.c` to `ast_preprocess.c` and related stuff after moving...
Yan Yanchii [Sun, 4 May 2025 18:07:35 +0000 (20:07 +0200)] 
gh-126835: Rename `ast_opt.c` to `ast_preprocess.c` and related stuff after moving const folding to the peephole optimizier (#131830)

6 months agogh-91048: Relax test_async_global_awaited_by to fix flakyness (#133368)
Pablo Galindo Salgado [Sun, 4 May 2025 16:52:20 +0000 (18:52 +0200)] 
gh-91048: Relax test_async_global_awaited_by to fix flakyness (#133368)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
6 months agogh-132457: make staticmethod and classmethod generic (#132460)
Ivan Kirpichnikov [Sun, 4 May 2025 16:26:38 +0000 (19:26 +0300)] 
gh-132457: make staticmethod and classmethod generic (#132460)

Co-authored-by: sobolevn <mail@sobolevn.me>
6 months agogh-132805: annotationlib: Fix handling of non-constant values in FORWARDREF (#132812)
Jelle Zijlstra [Sun, 4 May 2025 15:49:13 +0000 (08:49 -0700)] 
gh-132805: annotationlib: Fix handling of non-constant values in FORWARDREF (#132812)

Co-authored-by: David C Ellis <ducksual@gmail.com>
6 months agogh-132426: Add get_annotate_from_class_namespace replacing get_annotate_function...
Jelle Zijlstra [Sun, 4 May 2025 14:26:42 +0000 (07:26 -0700)] 
gh-132426: Add get_annotate_from_class_namespace replacing get_annotate_function (#132490)

As noted on the issue, making get_annotate_function() support both types and
mappings is problematic because one object may be both. So let's add a new one
that works with any mapping.

This leaves get_annotate_function() not very useful, so remove it.

6 months agogh-81793: Always call linkat() from os.link(), if available (GH-132517)
Serhiy Storchaka [Sun, 4 May 2025 14:24:10 +0000 (17:24 +0300)] 
gh-81793: Always call linkat() from os.link(), if available (GH-132517)

This fixes os.link() on platforms (like Linux and OpenIndiana) where the
system link() function does not follow symlinks.

* On Linux, it now follows symlinks by default and if
  follow_symlinks=True is specified.
* On Windows, it now raises error if follow_symlinks=True is passed.
* On macOS, it now raises error if follow_symlinks=False is passed and
  the system linkat() function is not available at runtime.
* On other platforms, it now raises error if follow_symlinks is passed
  with a value that does not match the system link() function behavior
  if if the behavior is not known.

Co-authored-by: Joachim Henke <37883863+jo-he@users.noreply.github.com>
Co-authored-by: Thomas Kluyver <takowl@gmail.com>
6 months agogh-122559: Synchronize C and Python implementation of the io module about pickling...
Serhiy Storchaka [Sun, 4 May 2025 14:06:49 +0000 (17:06 +0300)] 
gh-122559: Synchronize C and Python implementation of the io module about pickling (GH-122628)

In the C implementation, remove __reduce__ and __reduce_ex__ methods
that always raise TypeError and restore __getstate__ methods that always
raise TypeErrori.

This restores fine details of the pre-3.12 behavior and unifies
both implementations.

6 months agogh-69605: Add PyREPL import autocomplete feature to 'What's New' (#133358)
Tomas R. [Sun, 4 May 2025 11:22:42 +0000 (13:22 +0200)] 
gh-69605: Add PyREPL import autocomplete feature to 'What's New' (#133358)

6 months agobpo-44172: Keep reference to original window in curses subwindow objects (GH-26226)
Michael Forney [Sun, 4 May 2025 10:29:44 +0000 (03:29 -0700)] 
bpo-44172: Keep reference to original window in curses subwindow objects (GH-26226)

The X/Open curses specification[0] and ncurses documentation[1]
both state that subwindows must be deleted before the main window.

Deleting the windows in the wrong order causes a double-free with
NetBSD's curses implementation.

To fix this, keep track of the original window object in the subwindow
object, and keep a reference to the original for the lifetime of
the subwindow.

[0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/delwin.html
[1] https://invisible-island.net/ncurses/man/curs_window.3x.html

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
6 months agoGH-133231: Changes to executor management to support proposed `sys._jit` module ...
Mark Shannon [Sun, 4 May 2025 09:05:35 +0000 (10:05 +0100)] 
GH-133231: Changes to executor management to support proposed `sys._jit` module (GH-133287)

* Track the current executor, not the previous one, on the thread-state.

* Batch executors for deallocation to avoid having to constantly incref executors; this is an ad-hoc form of deferred reference counting.

6 months agogh-133363: Fix Cmd completion for lines beginning with `! ` (#133364)
Matt Wozniski [Sun, 4 May 2025 02:50:37 +0000 (22:50 -0400)] 
gh-133363: Fix Cmd completion for lines beginning with `! ` (#133364)

6 months agogh-132983: Introduce `_zstd` bindings module (GH-133027)
Emma Smith [Sun, 4 May 2025 01:29:55 +0000 (18:29 -0700)] 
gh-132983: Introduce `_zstd` bindings module (GH-133027)

* Add _zstd module for https://peps.python.org/pep-0784/

This commit introduces the `_zstd` module, with bindings to libzstd from
the pyzstd project. It also includes the unix build system configuration.
Windows build system support will be integrated independently as it
depends on integration with cpython-source-deps.

* Add _zstd to modules

* Fix path for compression.zstd module

* Ignore _zstd module like _io

* Expand module state macros to improve code quality

Also removes module state references from the classes in the _zstd
module and instead uses PyType_GetModuleState()

* Remove backticks suggested in review

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* Use critical sections to lock object state

This should avoid races and deadlocks.

* Remove compress/decompress and mark module as not reliant on the GIL

The `compress`/`decompress` functions will be moved to Python code for simplicity.
C implementations can always be re-added in the future.

Also, mark _zstd as not requiring the GIL.

* Lift critical section to avoid clang warning

* Respond to comments by picnixz

* Call out pyzstd explicitly in license description

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Use a much more robust implementation...

... for `get_zstd_state_from_type`

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Use PyList_GetItemRef for thread safety purposes

* Use a macro for the minimum supported version

* remove const from primivite types

* Use PyMem_New in another spot

* Simplify error handling in _get_frame_size

* Another simplification of error handling in get_frame_info

* Rename _module_state to mod_state

* Rewrite comment explaining the context of the code

* Add link to pyzstd

* Add TODO about refactoring dict training code

* Use PyModule_AddObjectRef over PyModule_AddObject

PyModule_AddObject is soft-deprecated, so we should use PyModule_AddObjectRef

* Check result of OutputBufferGrow

* Simplify return logic in `add_constant_to_type`

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Ignore return value of _zstd_clear()

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* Remove redundant comments

* Remove __reduce__ from ZstdDict

We should instead document that to pickle a dictionary a user should use
the `.dict_content` attribute.

* Use PyUnicode_FromFormat instead of a buffer

* Don't use C constants/types in error messages

* Make error messages easier to understand for Python users

* Lower minimum required version 1.4.0

* Use casts and make slot function signatures correct

* Be consistent with CPython on const usage

* Make else clauses in line with PEP 7

* Fix over-indented blocks in argument clinic

* Add critical section around ZSTD_DCtx_setParameter

* Add a TODO about refactoring critical sections

* Use Py_UNREACHABLE

* Move bytes operations out of Py_BEGIN_ALLOW_THREADS

* Add TODO about ensuring a lock is held

* Remove asserts that may not be correct

* Add TODO to make ZstdDict and others GC objects

* Make objects GC tracked

* Remove unused include

* Fix some memory issues

* Fix refleaks on module and in ZstdDict

* Update configure to check for ZDICT_finalizeDictionary

* Properly check version in configure

* exit(1) if check fails

* Use AC_RUN_IFELSE

* Use a define() to re-use version check

* Actually properly set _zstd module status based on version

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
6 months ago GH-91048: Add utils for printing the call stack for asyncio tasks (#133284)
Pablo Galindo Salgado [Sun, 4 May 2025 00:51:57 +0000 (02:51 +0200)] 
 GH-91048: Add utils for printing the call stack for asyncio tasks (#133284)

6 months agogh-133139: Add curses.assume_default_colors() (GH-133145)
Serhiy Storchaka [Sat, 3 May 2025 20:33:22 +0000 (23:33 +0300)] 
gh-133139: Add curses.assume_default_colors() (GH-133145)

This is a refinement of the curses.use_default_colors() function which
allows to change the color pair 0.

6 months agogh-123539: Add new error message changes to "Whats New" (#133344)
sobolevn [Sat, 3 May 2025 17:18:40 +0000 (20:18 +0300)] 
gh-123539: Add new error message changes to "Whats New" (#133344)

6 months agogh-133210: Fix `test_rlcompleter` in `--without-doc-strings` mode (#133332)
sobolevn [Sat, 3 May 2025 15:38:27 +0000 (18:38 +0300)] 
gh-133210: Fix `test_rlcompleter` in `--without-doc-strings` mode (#133332)

6 months agogh-123299: Add PyREPL syntax highlighting to release highlights (#133321)
Hugo van Kemenade [Sat, 3 May 2025 15:25:13 +0000 (18:25 +0300)] 
gh-123299: Add PyREPL syntax highlighting to release highlights (#133321)

6 months agogh-133304: workaround for RISC-V in PyFloat_Pack4/Unpack4() (#133328)
Sergey B Kirpichev [Sat, 3 May 2025 15:07:52 +0000 (18:07 +0300)] 
gh-133304: workaround for RISC-V in PyFloat_Pack4/Unpack4() (#133328)

6 months agogh-133306: Use \z instead of \Z in regular expressions in the stdlib (GH-133337)
Serhiy Storchaka [Sat, 3 May 2025 14:58:49 +0000 (17:58 +0300)] 
gh-133306: Use \z instead of \Z in regular expressions in the stdlib (GH-133337)

6 months agogh-133306: Use \z instead of \Z in fnmatch.translate() and glob.translate() (GH-133338)
Serhiy Storchaka [Sat, 3 May 2025 14:58:21 +0000 (17:58 +0300)] 
gh-133306: Use \z instead of \Z in fnmatch.translate() and glob.translate() (GH-133338)

6 months agogh-133117: Enable stricter mypy checks for `tomllib` (#133206)
sobolevn [Sat, 3 May 2025 13:57:09 +0000 (16:57 +0300)] 
gh-133117: Enable stricter mypy checks for `tomllib` (#133206)

6 months agogh-130160: use `.. program::` directive for documenting `platform` CLI (#133335)
Semyon Moroz [Sat, 3 May 2025 12:05:04 +0000 (16:05 +0400)] 
gh-130160: use `.. program::` directive for documenting `platform` CLI (#133335)

6 months agogh-131524: Update platform CLI to use argparse (#131542)
Harry [Sat, 3 May 2025 08:58:59 +0000 (09:58 +0100)] 
gh-131524: Update platform CLI to use argparse (#131542)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
6 months agogh-133306: Support \z as a synonym for \Z in regular expressions (GH-133314)
Serhiy Storchaka [Sat, 3 May 2025 07:54:33 +0000 (10:54 +0300)] 
gh-133306: Support \z as a synonym for \Z in regular expressions (GH-133314)

\Z was an error inherited from PCRE 0.95. It was fixed in PCRE 2.0.
In other engines, \Z means not “anchor at string end”, but
“anchor before optional newline at string end”.

\z means “anchor at string end” in most RE engines.

6 months agogh-114713: Revert gh-114731 (#133330)
Kirill Podoprigora [Sat, 3 May 2025 07:47:08 +0000 (08:47 +0100)] 
gh-114713: Revert gh-114731 (#133330)

Revert "gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (#114731)"

This reverts commit 884df116d79b05d9342e05e50484d61c684ecb8b.

6 months agogh-133194: Fix regression with PEP 758 parsing on older `feature_version` (#133289)
sobolevn [Sat, 3 May 2025 07:33:14 +0000 (10:33 +0300)] 
gh-133194: Fix regression with PEP 758 parsing on older `feature_version` (#133289)

gh-133192: Fix regression with PEP 758 parsing on older `feature_version`

6 months agogh-133037: Add test for shadowing __annotate__ (#133084)
Jelle Zijlstra [Sat, 3 May 2025 02:42:49 +0000 (19:42 -0700)] 
gh-133037: Add test for shadowing __annotate__ (#133084)

6 months agogh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885)
Malcolm Smith [Sat, 3 May 2025 01:20:10 +0000 (02:20 +0100)] 
gh-91156: Document how TextIOWrapper interacts with UTF-8 mode (GH-132885)

Document how TextIOWrapper interacts with UTF-8 mode

6 months agogh-91048: Chain some exceptions in _testexternalinspection.c (#132970)
Sergey Miryanov [Fri, 2 May 2025 23:35:30 +0000 (16:35 -0700)] 
gh-91048: Chain some exceptions in _testexternalinspection.c (#132970)

6 months agoLint: Use Ruff to format ``Tools/build/check_warnings.py`` (#133317)
Adam Turner [Fri, 2 May 2025 20:26:32 +0000 (21:26 +0100)] 
Lint: Use Ruff to format ``Tools/build/check_warnings.py`` (#133317)

6 months agogh-131507: Add support for syntax highlighting in PyREPL (GH-133247)
Łukasz Langa [Fri, 2 May 2025 18:22:31 +0000 (20:22 +0200)] 
gh-131507: Add support for syntax highlighting in PyREPL (GH-133247)

Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
6 months agoGH-113464: Get LLVM from cpython-bin-deps on Windows (GH-133278)
Brandt Bucher [Fri, 2 May 2025 18:17:15 +0000 (11:17 -0700)] 
GH-113464: Get LLVM from cpython-bin-deps on Windows (GH-133278)

6 months agogh-100926: Move ctype's pointers cache from _pointer_type_cache to StgInfo (GH-131282)
Sergey Miryanov [Fri, 2 May 2025 17:06:37 +0000 (10:06 -0700)] 
gh-100926: Move ctype's pointers cache from _pointer_type_cache to StgInfo (GH-131282)

Deprecate _pointer_type_cache and calling POINTER on a string.

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
6 months agogh-112936: Fix IDLE: no Shell menu item in single-process mode (GH-126598)
Zhikang Yan [Fri, 2 May 2025 17:03:32 +0000 (01:03 +0800)] 
gh-112936: Fix IDLE: no Shell menu item in single-process mode (GH-126598)

6 months agogh-132995: Upgrade bundled pip to 25.1.1 (gh-132997)
Paul Moore [Fri, 2 May 2025 16:43:13 +0000 (17:43 +0100)] 
gh-132995: Upgrade bundled pip to 25.1.1 (gh-132997)

* gh-132995: Upgrade bundled pip to 25.1.1

6 months agogh-132744: Check recursion limit in CALL_PY_GENERAL (GH-132746)
Ken Jin [Fri, 2 May 2025 16:36:29 +0000 (00:36 +0800)] 
gh-132744: Check recursion limit in CALL_PY_GENERAL (GH-132746)

6 months agogh-128972: Add `_Py_ALIGN_AS` and revert `PyASCIIObject` memory layout. (GH-133085)
Petr Viktorin [Fri, 2 May 2025 16:30:40 +0000 (18:30 +0200)] 
gh-128972: Add `_Py_ALIGN_AS` and revert `PyASCIIObject` memory layout. (GH-133085)

Add `_Py_ALIGN_AS` as per C API WG vote: https://github.com/capi-workgroup/decisions/issues/61
This patch only adds it to free-threaded builds; the `#ifdef Py_GIL_DISABLED`
can be removed in the future.

Use this to revert `PyASCIIObject` memory layout for non-free-threaded builds.
The long-term plan is to deprecate the entire struct; until that happens
it's better to keep it unchanged, as courtesy to people that rely on it despite
it not being stable ABI.

6 months agogh-121249: fix complex formatting codes in the struct docs (note 10) (GH-133249)
Sergey B Kirpichev [Fri, 2 May 2025 16:27:07 +0000 (19:27 +0300)] 
gh-121249: fix complex formatting codes in the struct docs (note 10) (GH-133249)

This amends 85f89cb.

6 months agoGH-133171: Prevent combinations of --disable-gil and --enable-experimental-jit.....
Brandt Bucher [Fri, 2 May 2025 16:26:03 +0000 (09:26 -0700)] 
GH-133171: Prevent combinations of --disable-gil and --enable-experimental-jit... for now (GH-133179)

6 months agogh-121249: unconditionally support `complex` types in `struct` (GH-132864)
Sergey B Kirpichev [Fri, 2 May 2025 16:24:52 +0000 (19:24 +0300)] 
gh-121249: unconditionally support `complex` types in `struct` (GH-132864)

Co-authored-by: Lisandro Dalcin <dalcinl@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
6 months agogh-133300: argparse: make `suggest_on_error` a keyword-only parameter (#133302)
Hugo van Kemenade [Fri, 2 May 2025 15:11:44 +0000 (18:11 +0300)] 
gh-133300: argparse: make `suggest_on_error` a keyword-only parameter (#133302)

6 months agogh-133164: Add `PyUnstable_Object_IsUniqueReferencedTemporary` C API (gh-133170)
Sam Gross [Fri, 2 May 2025 13:24:57 +0000 (09:24 -0400)] 
gh-133164: Add `PyUnstable_Object_IsUniqueReferencedTemporary` C API (gh-133170)

After gh-130704, the interpreter replaces some uses of `LOAD_FAST` with
`LOAD_FAST_BORROW` which avoid incref/decrefs by "borrowing" references
on the interpreter stack when the bytecode compiler can determine that
it's safe.

This change broke some checks in C API extensions that relied on
`Py_REFCNT()` of `1` to determine if it's safe to modify an object
in-place. Objects may have a reference count of one, but still be
referenced further up the interpreter stack due to borrowing of
references.

This provides a replacement function for those checks.
`PyUnstable_Object_IsUniqueReferencedTemporary` is more conservative:
it checks that the object has a reference count of one and that it exists as a
unique strong reference in the interpreter's stack of temporary
variables in the top most frame.

See also:

* https://github.com/numpy/numpy/issues/28681

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: mpage <mpage@cs.stanford.edu>
Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
6 months agogh-130645: Add color to `argparse` help (GH-132323)
Hugo van Kemenade [Fri, 2 May 2025 13:06:10 +0000 (16:06 +0300)] 
gh-130645: Add color to `argparse` help (GH-132323)

6 months agogh-133210: Fix `test_descr` in `--without-doc-strings` mode (#133294)
sobolevn [Fri, 2 May 2025 13:04:27 +0000 (16:04 +0300)] 
gh-133210: Fix `test_descr` in `--without-doc-strings` mode (#133294)

6 months agogh-132385: Fix instance error suggestions trigger potential exceptions in `traceback...
sobolevn [Fri, 2 May 2025 12:52:59 +0000 (15:52 +0300)] 
gh-132385: Fix instance error suggestions trigger potential exceptions in `traceback` (#132387)

6 months agogh-133279: Assert with HAS_TARGET in the codegen_addop_j function (#133280)
Nybblista [Fri, 2 May 2025 12:52:48 +0000 (15:52 +0300)] 
gh-133279: Assert with HAS_TARGET in the codegen_addop_j function (#133280)

6 months agogh-133290: Use PyObject_SetAttr to set _type_ (GH-133292)
Petr Viktorin [Fri, 2 May 2025 12:47:07 +0000 (14:47 +0200)] 
gh-133290: Use PyObject_SetAttr to set _type_ (GH-133292)

6 months agoDocs: delete title links in `turtle.rst` and `typing.rst` (#133283)
Yongzi Li [Fri, 2 May 2025 12:15:26 +0000 (20:15 +0800)] 
Docs: delete title links in `turtle.rst` and `typing.rst` (#133283)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
6 months agogh-130482: Add ability to specify name for tkinter.OptionMenu and tkinter.ttk.OptionM...
Zhikang Yan [Fri, 2 May 2025 11:38:50 +0000 (19:38 +0800)] 
gh-130482: Add ability to specify name for tkinter.OptionMenu and tkinter.ttk.OptionMenu (GH-130502)

6 months agogh-133197: Improve error message for incompatible string / bytes prefixes (#133242)
sobolevn [Fri, 2 May 2025 11:28:17 +0000 (14:28 +0300)] 
gh-133197: Improve error message for incompatible string / bytes prefixes (#133242)

6 months agogh-133210: Fix `test_pydoc` in `--without-doc-strings` mode (#133271)
sobolevn [Fri, 2 May 2025 10:12:24 +0000 (13:12 +0300)] 
gh-133210: Fix `test_pydoc` in `--without-doc-strings` mode (#133271)

6 months agogh-123539: Improve SyntaxError msg for `import as` with not a name (#123629)
sobolevn [Fri, 2 May 2025 08:34:13 +0000 (11:34 +0300)] 
gh-123539: Improve SyntaxError msg for `import as` with not a name (#123629)

6 months agogh-123299: Add missing pending removals (#133082)
Hugo van Kemenade [Fri, 2 May 2025 08:18:24 +0000 (11:18 +0300)] 
gh-123299: Add missing pending removals (#133082)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
6 months agogh-119605: Respect `follow_wrapped` for `__init__` and `__new__` when getting class...
Xuehai Pan [Thu, 1 May 2025 22:41:44 +0000 (06:41 +0800)] 
gh-119605: Respect `follow_wrapped` for `__init__` and `__new__` when getting class signature with `inspect.signature` (#132055)

6 months agogh-133259: Show path to python.sh script on successful build (#133268)
Michael Droettboom [Thu, 1 May 2025 18:49:39 +0000 (14:49 -0400)] 
gh-133259: Show path to python.sh script on successful build (#133268)

* gh-133259: Show path to python.sh script on successful build

* wasmtime -> (generic) wasm runtime

6 months agogh-133258: Fix crash in test_index (GH-133262)
Irit Katriel [Thu, 1 May 2025 17:15:53 +0000 (18:15 +0100)] 
gh-133258: Fix crash in test_index (GH-133262)

6 months agogh-133261: Use __builtin_frame_address() on GCC 9 and older (#133269)
Victor Stinner [Thu, 1 May 2025 17:13:03 +0000 (19:13 +0200)] 
gh-133261: Use __builtin_frame_address() on GCC 9 and older (#133269)

GCC 9 and older don't have __has_builtin(), but have
__builtin_frame_address() function.

6 months agogh-130197: Test pygettext --output option (GH-133041)
Stan Ulbrych [Thu, 1 May 2025 16:30:24 +0000 (17:30 +0100)] 
gh-130197: Test pygettext --output option (GH-133041)

6 months agogh-133210: Fix `test_inspect` in `--without-doc-strings` mode (#133250)
sobolevn [Thu, 1 May 2025 16:08:35 +0000 (19:08 +0300)] 
gh-133210: Fix `test_inspect` in `--without-doc-strings` mode (#133250)

6 months agogh-133256: Add _Py_NONSTRING macro (#133257)
Victor Stinner [Thu, 1 May 2025 15:55:49 +0000 (17:55 +0200)] 
gh-133256: Add _Py_NONSTRING macro (#133257)

Fix GCC 15 compiler warnings such as:

    Modules/fcntlmodule.c:27:36: warning: initializer-string for
    array of 'char' truncates NUL terminator but destination lacks
    'nonstring' attribute (9 chars into 8 available)
    [-Wunterminated-string-initialization]
    static const char guard[GUARDSZ] = "\x00\xfa\x69\xc4\x67\xa3\x6c\x58";

6 months agogh-130317: Fix test_pack_unpack_roundtrip() and add docs (#133204)
Sergey B Kirpichev [Thu, 1 May 2025 14:20:36 +0000 (17:20 +0300)] 
gh-130317: Fix test_pack_unpack_roundtrip() and add docs (#133204)

* Skip sNaN's testing in 32-bit mode.
* Drop float_set_snan() helper.
* Use memcpy() workaround for sNaN's in PyFloat_Unpack4().
* Document, that sNaN's may not be preserved by PyFloat_Pack/Unpack API.

6 months agogh-132930: Include IDLE path in registry for PyManager packages (GH-133246)
Steve Dower [Thu, 1 May 2025 13:41:17 +0000 (14:41 +0100)] 
gh-132930: Include IDLE path in registry for PyManager packages (GH-133246)

6 months agogh-130197: Improve test coverage of msgfmt.py (GH-133048)
Tomas R. [Thu, 1 May 2025 13:32:11 +0000 (15:32 +0200)] 
gh-130197: Improve test coverage of msgfmt.py (GH-133048)

6 months agogh-133166: Fix missing error emission of PyType_GetModuleByDef (GH-133240)
neonene [Thu, 1 May 2025 12:32:57 +0000 (21:32 +0900)] 
gh-133166: Fix missing error emission of PyType_GetModuleByDef (GH-133240)

6 months agogh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199)
Victor Stinner [Thu, 1 May 2025 11:42:42 +0000 (13:42 +0200)] 
gh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199)

Replace _PyObject_GC_UNTRACK() with PyObject_GC_UnTrack() to not fail
if the method was already untracked.

6 months agogh-130655: Add a test for big-endian MO files in gettext (GH-132469)
Tomas R. [Thu, 1 May 2025 11:13:08 +0000 (13:13 +0200)] 
gh-130655: Add a test for big-endian MO files in gettext (GH-132469)

6 months agoRemove duplicate includes: Python/{bytecodes,ceval,optimizer_analysis}.c (#132622)
Adam Turner [Thu, 1 May 2025 11:07:53 +0000 (12:07 +0100)] 
Remove duplicate includes: Python/{bytecodes,ceval,optimizer_analysis}.c (#132622)

6 months agogh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626)
Irit Katriel [Thu, 1 May 2025 10:28:52 +0000 (11:28 +0100)] 
gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626)

6 months agoPyStats: Make sure that the `failure_kinds` array is big enough. (#133245)
Mark Shannon [Thu, 1 May 2025 10:02:51 +0000 (11:02 +0100)] 
PyStats: Make sure that the `failure_kinds` array is big enough. (#133245)

6 months agoLint: Create a project-wide ``.ruff.toml`` settings file (#133124)
Adam Turner [Thu, 1 May 2025 08:28:44 +0000 (09:28 +0100)] 
Lint: Create a project-wide ``.ruff.toml`` settings file (#133124)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
6 months agogh-133196: Guard PEP 750 grammar with `CHECK_VERSION` (#133225)
sobolevn [Thu, 1 May 2025 07:17:07 +0000 (10:17 +0300)] 
gh-133196: Guard PEP 750 grammar with `CHECK_VERSION` (#133225)

6 months agogh-131531: Make Android build retry after network failures (#133193)
Malcolm Smith [Thu, 1 May 2025 04:17:41 +0000 (05:17 +0100)] 
gh-131531: Make Android build retry after network failures (#133193)

Adds a retry strategy when downloading compilation resources for Android, plus some other cleanups.

6 months agogh-130167: Improve ``difflib.IS_LINE_JUNK`` performance by using string methods ...
Semyon Moroz [Thu, 1 May 2025 04:11:36 +0000 (08:11 +0400)] 
gh-130167: Improve ``difflib.IS_LINE_JUNK`` performance by using string methods (#130170)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Tim Peters <tim.peters@gmail.com>
6 months agoAdd missing whitespace in `is_running_main` comment (#133174)
Nybblista [Thu, 1 May 2025 03:36:59 +0000 (06:36 +0300)] 
Add missing whitespace in `is_running_main` comment (#133174)

6 months agoBump the HACL* revision. (#133226)
Russell Keith-Magee [Thu, 1 May 2025 02:57:49 +0000 (10:57 +0800)] 
Bump the HACL* revision. (#133226)

Bump the HACL* revision to include iOS platform identification.

6 months agogh-133183: Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets. (#133184)
Russell Keith-Magee [Thu, 1 May 2025 02:35:33 +0000 (10:35 +0800)] 
gh-133183: Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets. (#133184)

Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets.

6 months agoRevert "gh-132775: Add _PyCode_GetVarCounts() (gh-133128)" (gh-133232)
Eric Snow [Thu, 1 May 2025 02:35:20 +0000 (20:35 -0600)] 
Revert "gh-132775: Add _PyCode_GetVarCounts() (gh-133128)" (gh-133232)

The change broke the s390 builds, so I'm reverting it while I investigate.

This reverts commit 94b4fcd806e7b692955173d309ea3b70a193ad96.

6 months agodict: Remove redundant incref of immortal object Py_EMPTY_KEYS (GH-133200)
Mae Hood [Wed, 30 Apr 2025 23:39:26 +0000 (00:39 +0100)] 
dict: Remove redundant incref of immortal object Py_EMPTY_KEYS (GH-133200)

6 months agogh-132775: Add _PyPickle_GetXIData() (gh-133107)
Eric Snow [Wed, 30 Apr 2025 23:34:05 +0000 (17:34 -0600)] 
gh-132775: Add _PyPickle_GetXIData() (gh-133107)

There's some extra complexity due to making sure we we get things right when handling functions and classes defined in the __main__ module.  This is also reflected in the tests, including the addition of extra functions in test.support.import_helper.

6 months agoGH-125515: Remove two unused error branches. (#133181)
Russell Keith-Magee [Wed, 30 Apr 2025 22:21:57 +0000 (06:21 +0800)] 
GH-125515: Remove two unused error branches. (#133181)

Remove two unused error branches in the generated bytecode handling.

6 months agogh-133153: Use rlcompleter for pdb's interact command (#133176)
Tian Gao [Wed, 30 Apr 2025 22:19:13 +0000 (15:19 -0700)] 
gh-133153: Use rlcompleter for pdb's interact command (#133176)