]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
4 months agogh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (#135681)
Victor Stinner [Thu, 19 Jun 2025 09:40:40 +0000 (11:40 +0200)] 
gh-126112: Fix test_os.TimerfdTests: use 10 ms resolution (#135681)

Use 10 ms for CLOCK_RES instead of 100 ms to tolerate slow buildbots.

4 months agogh-111758: Run UBSan in GitHub Actions (GH-135578)
Petr Viktorin [Thu, 19 Jun 2025 09:36:56 +0000 (11:36 +0200)] 
gh-111758: Run UBSan in GitHub Actions (GH-135578)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 months agoDocument that PyType_GetModuleByDef returns a borrowed reference (GH-135666)
Petr Viktorin [Thu, 19 Jun 2025 07:00:41 +0000 (09:00 +0200)] 
Document that PyType_GetModuleByDef returns a borrowed reference (GH-135666)

4 months agogh-133485: Use interpreters.Interpreter in InterpreterPoolExecutor (gh-133957)
Eric Snow [Wed, 18 Jun 2025 23:57:14 +0000 (17:57 -0600)] 
gh-133485: Use interpreters.Interpreter in InterpreterPoolExecutor (gh-133957)

Most importantly, this resolves the issues with functions and types defined in __main__.
It also expands the number of supported objects and simplifies the implementation.

4 months agogh-135450: Remove assertion in `_PyCode_CheckNoExternalState` (gh-135466)
Peter Bierma [Wed, 18 Jun 2025 23:31:23 +0000 (19:31 -0400)] 
gh-135450: Remove assertion in `_PyCode_CheckNoExternalState` (gh-135466)

The assertion reflected a misunderstanding of situations where "hidden" variables might exist,
namely generator expressions and comprehensions.

4 months agogh-134538: Add link to shutil.rmtree example in function docs (GH-135540)
alexey semenyuk [Wed, 18 Jun 2025 21:10:20 +0000 (02:10 +0500)] 
gh-134538: Add link to shutil.rmtree example in function docs (GH-135540)

4 months agogh-135641: Fix flaky `test_capi.test_lock_two_threads` test case (gh-135642)
Sam Gross [Wed, 18 Jun 2025 18:24:05 +0000 (14:24 -0400)] 
gh-135641: Fix flaky `test_capi.test_lock_two_threads` test case (gh-135642)

The mutex may have the `_Py_HAS_PARKED` bit set.

4 months agoDocs: Fix markups for emphasis (GH-135598)
Yuki Kobayashi [Wed, 18 Jun 2025 17:32:43 +0000 (02:32 +0900)] 
Docs: Fix markups for emphasis (GH-135598)

The word emphasis character `_` is not supported as sphinx markup, so changed to `*`.

4 months agogh-135639: fix `test_cycle` test (#135662)
Kumar Aditya [Wed, 18 Jun 2025 16:41:35 +0000 (22:11 +0530)] 
gh-135639: fix `test_cycle` test (#135662)

4 months agogh-135376: Fix and improve test_random (GH-135377)
Serhiy Storchaka [Wed, 18 Jun 2025 15:26:01 +0000 (18:26 +0300)] 
gh-135376: Fix and improve test_random (GH-135377)

* Remove duplicated code. Tests for Random and SystemRandom now share
  the code.
* Move implementation agnostic tests that was only run for SystemRandom,
  so they are now run for Random too.
* Add tests for __index__() support.
* Add tests for randint().

4 months agogh-135676: lexical analysis: Improve section on Numeric literals (GH-134850)
Petr Viktorin [Wed, 18 Jun 2025 14:34:18 +0000 (16:34 +0200)] 
gh-135676: lexical analysis: Improve section on Numeric literals (GH-134850)

4 months agogh-135646: Raise consistent `NameError` exceptions in `ForwardRef.evaluate()` (#135663)
Victorien [Wed, 18 Jun 2025 13:00:55 +0000 (15:00 +0200)] 
gh-135646: Raise consistent `NameError` exceptions in `ForwardRef.evaluate()` (#135663)

4 months agogh-135335: flush stdout/stderr in forkserver after preloading modules (#135338)
Duane Griffin [Wed, 18 Jun 2025 12:17:02 +0000 (00:17 +1200)] 
gh-135335: flush stdout/stderr in forkserver after preloading modules (#135338)

If a preloaded module writes to stdout or stderr, and the stream is buffered,
child processes will inherit the buffered data after forking. Attempt to
prevent this by flushing the streams after preload.

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
4 months agogh-133390: Document `SQLITE_KEYWORDS` (GH-135659)
Stan Ulbrych [Wed, 18 Jun 2025 10:56:49 +0000 (11:56 +0100)] 
gh-133390: Document `SQLITE_KEYWORDS` (GH-135659)

4 months agogh-134632: Add iOS/Android test skip for C API check for headers. (#135656)
Russell Keith-Magee [Wed, 18 Jun 2025 06:21:14 +0000 (14:21 +0800)] 
gh-134632: Add iOS/Android test skip for C API check for headers. (#135656)

iOS and Android don't ship headers in the testbed, so we can't test for their existence.

4 months agogh-127146: Enable large files on Emscripten (#135635)
Hood Chatham [Wed, 18 Jun 2025 04:34:30 +0000 (21:34 -0700)] 
gh-127146: Enable large files on Emscripten (#135635)

Large files have been fully supported by Emscripten for a long time.

4 months agogh-119180: Only fetch globals and locals if necessary in `annotationlib.get_annotatio...
Victorien [Wed, 18 Jun 2025 03:29:13 +0000 (05:29 +0200)] 
gh-119180: Only fetch globals and locals if necessary in `annotationlib.get_annotations()` (#135644)

4 months agogh-127146: Emscripten: Fix pathlib glob_dotdot test (#135624)
Hood Chatham [Wed, 18 Jun 2025 03:20:43 +0000 (20:20 -0700)] 
gh-127146: Emscripten: Fix pathlib glob_dotdot test (#135624)

The Emscripten path resolver uses the same mechanism for resolving `..`
at a file system root as for resolving symlinks. This is because
roots don't store their mountpoints. If the parent of a node is itself,
it is a root but it might be a mountpoint in some other file system.

If a path has enough `..`'s at the root, it will return ELOOP.
Enough turns out to be 49.

4 months agogh-127146: Emscripten: Fix test failure due to missing os.link (#135626)
Hood Chatham [Wed, 18 Jun 2025 03:19:23 +0000 (20:19 -0700)] 
gh-127146: Emscripten: Fix test failure due to missing os.link (#135626)

Check for existence of os.link, rather than assuming it exists.

4 months agogh-127146: Emscripten: Skip test_url2pathname_resolve_host (#135634)
Hood Chatham [Wed, 18 Jun 2025 02:59:01 +0000 (19:59 -0700)] 
gh-127146: Emscripten: Skip test_url2pathname_resolve_host (#135634)

Emscripten currently `gethostbyname_r()` returns an incorrect
IP address for `localhost`. Will be resolved by upstream PR:
https://github.com/emscripten-core/emscripten/pull/24593

4 months agogh-127146: Allow ignored keys to be missing in test_sysconfig (#135622)
Hood Chatham [Wed, 18 Jun 2025 02:51:46 +0000 (19:51 -0700)] 
gh-127146: Allow ignored keys to be missing in test_sysconfig (#135622)

Fixes the test on Emscripten where userbase can be missing.

4 months agogh-135627: Remove documentation for LOAD_CONST_IMMORTAL opcode (GH-135632)
Vladyslav Lazoryk [Wed, 18 Jun 2025 02:39:41 +0000 (05:39 +0300)] 
gh-135627: Remove documentation for LOAD_CONST_IMMORTAL opcode (GH-135632)

Remove documentation for LOAD_CONST_IMMORTAL opcode

4 months agogh-133931: Introduce _PyObject_XSetRefDelayed to replace Py_XSETREF (gh-134377)
Donghee Na [Tue, 17 Jun 2025 23:36:02 +0000 (08:36 +0900)] 
gh-133931: Introduce _PyObject_XSetRefDelayed to replace Py_XSETREF (gh-134377)

4 months agoInitial internal asyncio docs (#135469)
Kumar Aditya [Tue, 17 Jun 2025 19:21:41 +0000 (00:51 +0530)] 
Initial internal asyncio docs (#135469)

Currently focused on `_asynciomodule.c` but could also receive updates about internals of the Python package.

4 months agogh-132775: Fix Interpreter.call() __main__ Visibility (gh-135595)
Eric Snow [Tue, 17 Jun 2025 19:16:59 +0000 (13:16 -0600)] 
gh-132775: Fix Interpreter.call() __main__ Visibility (gh-135595)

As noted in the new tests, there are a few situations we must carefully accommodate
for functions that get pickled during interp.call().  We do so by running the script
from the main interpreter's __main__ module in a hidden module in the other
interpreter.  That hidden module is used as the function __globals__.

4 months agogh-134584: Decref elimination for float ops in the JIT (GH-134588)
Ken Jin [Tue, 17 Jun 2025 15:25:53 +0000 (23:25 +0800)] 
gh-134584: Decref elimination for float ops in the JIT (GH-134588)

This PR adds a PyJitRef API to the JIT's optimizer that mimics the _PyStackRef API. This allows it to track references and their stack lifetimes properly. Thus opening up the doorway to refcount elimination in the JIT.

4 months agoGH-135379: Support limited scalar replacement for replicated uops in the JIT code...
Mark Shannon [Tue, 17 Jun 2025 12:43:09 +0000 (13:43 +0100)] 
GH-135379: Support limited scalar replacement for replicated uops in the JIT code generator. (GH-135563)

* Use it to support efficient specializations of COPY and SWAP in the JIT.

4 months agogh-132815: Add support for JUMP_BACKWARD in specialization stats (#135606)
PuQing [Tue, 17 Jun 2025 12:11:09 +0000 (20:11 +0800)] 
gh-132815: Add support for JUMP_BACKWARD in specialization stats (#135606)

4 months agogh-134262: Catch both URLError and ConnectionError in retries (#135365)
Emma Smith [Tue, 17 Jun 2025 11:51:23 +0000 (07:51 -0400)] 
gh-134262: Catch both URLError and ConnectionError in retries (#135365)

4 months agogh-134632: Fix `build-details.json` to use `INCLUDEPY` path (#134633)
Michał Górny [Tue, 17 Jun 2025 08:05:04 +0000 (10:05 +0200)] 
gh-134632: Fix `build-details.json` to use `INCLUDEPY` path (#134633)

* gh-134632: Fix `build-details.json` to use `INCLUDEPY` path

Fix ``build-details.json`` generation to use ``INCLUDEPY``, in order to
reference the ``pythonX.Y`` subdirectory of the include directory, as
required in :pep:`739`, instead of the top-level include directory.

* test_build_details: Add tests for the c_api section

* test_build_details: Expect pkgconfig for CPython unconditionally

4 months agogh-123299: Add PEP 779 to What's New in Python 3.14 (#135555)
Hugo van Kemenade [Tue, 17 Jun 2025 06:02:35 +0000 (09:02 +0300)] 
gh-123299: Add PEP 779 to What's New in Python 3.14 (#135555)

4 months agogh-135489: Show verbose output for failing tests during PGO profiling step with ...
PuQing [Tue, 17 Jun 2025 05:06:48 +0000 (13:06 +0800)] 
gh-135489: Show verbose output for failing tests during PGO profiling step with `--enable-optimizations` (#135512)

4 months agogh-119132: Update 'Using Python on macOS' documentation. (#135591)
Ned Deily [Mon, 16 Jun 2025 23:35:59 +0000 (01:35 +0200)] 
gh-119132: Update 'Using Python on macOS' documentation. (#135591)

Remove `experimental` qualification for free-threading in the document text. Note that images included in the document will be updated later in the release cycle.

4 months agogh-135443: Sometimes Fall Back to __main__.__dict__ For Globals (gh-135491)
Eric Snow [Mon, 16 Jun 2025 23:34:19 +0000 (17:34 -0600)] 
gh-135443: Sometimes Fall Back to __main__.__dict__ For Globals (gh-135491)

For several builtin functions, we now fall back to __main__.__dict__ for the globals
when there is no current frame and _PyInterpreterState_IsRunningMain() returns
true.  This allows those functions to be run with Interpreter.call().

The affected builtins:

* exec()
* eval()
* globals()
* locals()
* vars()
* dir()

We take a similar approach with "stateless" functions, which don't use any
global variables.

4 months agogh-128627: Emscripten: Add missing semicolon in ios detection code (#135590)
Hood Chatham [Mon, 16 Jun 2025 23:17:17 +0000 (16:17 -0700)] 
gh-128627: Emscripten: Add missing semicolon in ios detection code (#135590)

4 months agoAdd Peter Bierma as a codeowner for the object and runtime lifecycle (#135588)
Peter Bierma [Mon, 16 Jun 2025 23:03:53 +0000 (19:03 -0400)] 
Add Peter Bierma as a codeowner for the object and runtime lifecycle (#135588)

4 months agoUse replacements to update versions in "Using Python on macOS" (#130400)
Hugo van Kemenade [Mon, 16 Jun 2025 22:07:25 +0000 (01:07 +0300)] 
Use replacements to update versions in "Using Python on macOS" (#130400)

4 months agogh-132617: Fix `dict.update()` mutation check (gh-134815)
Sam Gross [Mon, 16 Jun 2025 16:55:20 +0000 (12:55 -0400)] 
gh-132617: Fix `dict.update()` mutation check (gh-134815)

Use `ma_used` instead of `ma_keys->dk_nentries` for modification check
so that we only check if the dictionary is modified, not if new keys are
added to a different dictionary that shared the same keys object.

4 months agogh-135513: Fix unused variable warning in `crossinterp.c` (#135514)
sobolevn [Mon, 16 Jun 2025 16:12:20 +0000 (19:12 +0300)] 
gh-135513: Fix unused variable warning in `crossinterp.c` (#135514)

4 months agogh-119132: Remove "experimental" tag from the CPython free-threading. (gh-135550)
Donghee Na [Mon, 16 Jun 2025 14:32:52 +0000 (23:32 +0900)] 
gh-119132: Remove "experimental" tag from the CPython free-threading. (gh-135550)

* gh-119132: Remove "experimental" tag from the CPython free-threading build

* Address code review

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* Add NEWS.d

* Regen configure.ac

* Update doc

* Update

* Update

* Update

* Update Doc/howto/free-threading-python.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Update ctypes.rst

* Update

* Update Doc/howto/free-threading-python.rst

Co-authored-by: T. Wouters <thomas@python.org>
* Apply suggestions from code review

Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: T. Wouters <thomas@python.org>
4 months agogh-120608: fix NEWS entry typo (#135535)
Rafael Fontenelle [Mon, 16 Jun 2025 10:11:49 +0000 (07:11 -0300)] 
gh-120608: fix NEWS entry typo (#135535)

4 months agogh-131798: JIT: replace _CHECK_METHOD_VERSION with _CHECK_FUNCTION_VERSION_INLINE...
Nadeshiko Manju [Mon, 16 Jun 2025 05:25:50 +0000 (13:25 +0800)] 
gh-131798: JIT: replace _CHECK_METHOD_VERSION with _CHECK_FUNCTION_VERSION_INLINE (GH-135022)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
4 months agogh-67022: Document bytes/str inconsistency in email.header.decode_header() and sugges...
Dan Lenski [Sun, 15 Jun 2025 19:29:38 +0000 (12:29 -0700)] 
gh-67022: Document bytes/str inconsistency in email.header.decode_header() and suggest email.headerregistry.HeaderRegistry as a sane alternative (#92900)

* gh-67022: Document bytes/str inconsistency in email.header.decode_header()

This function's possible return types have been surprising and error-prone
for the entirety of its Python 3.x history. It can return either:

1. `typing.List[typing.Tuple[bytes, typing.Optional[str]]]` of length >1
2. or `typing.List[typing.Tuple[str, None]]`, of length exactly 1

This means that any user of this function must be prepared to accept either
`bytes` or `str` for the first member of the 2-tuples it returns, which is a
very surprising behavior in Python 3.x, particularly given that the second
member of the tuple is supposed to represent the charset/encoding of the
first member.

This patch documents the behavior of this function, and adds test cases
to demonstrate it.

As discussed in bpo-22833, this cannot be changed in a backwards-compatible
way, and some users of this function depend precisely on the existing
behavior.

Add warnings about obsolescence of 'email.header.decode_header' and 'email.header.make_header' functions.

Recommend use of `email.headerregistry.HeaderRegistry` instead, as suggested
in https://github.com/python/cpython/pull/92900#discussion_r1112472177

4 months agogh-111178: fix UBSan failures for `RemoteUnwinderObject` (#135539)
Bénédikt Tran [Sun, 15 Jun 2025 19:00:58 +0000 (21:00 +0200)] 
gh-111178: fix UBSan failures for `RemoteUnwinderObject` (#135539)

4 months agogh-135361: update documentation for `remote_debugger_script` audit event (#135362)
Nadeshiko Manju [Sun, 15 Jun 2025 18:49:49 +0000 (02:49 +0800)] 
gh-135361: update documentation for `remote_debugger_script` audit event (#135362)

4 months agogh-135371: Clean tags from pointers in all cases in remote debugging module (#135534)
Pablo Galindo Salgado [Sun, 15 Jun 2025 18:32:32 +0000 (20:32 +0200)] 
gh-135371: Clean tags from pointers in all cases in remote debugging module (#135534)

4 months agogh-65697: Improved error msg for configparser key validation (#135527)
Jacob Austin Lincoln [Sun, 15 Jun 2025 16:13:19 +0000 (09:13 -0700)] 
gh-65697: Improved error msg for configparser key validation (#135527)

* Improved error msg for configparser key validation and added note in 3.14 whatsnew

* Properly added change to configparser

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
4 months agogh-127319: Disable port reuse on HTTP, XMLRPC, and logging TCP servers (GH-135405)
Jeremy Cline [Sun, 15 Jun 2025 05:34:29 +0000 (01:34 -0400)] 
gh-127319: Disable port reuse on HTTP, XMLRPC, and logging TCP servers (GH-135405)

Prior to issue #120485 these servers did not allow port reuse, which
makes sense as the behavior of port reuse is surprising if you're not
expecting it. It's unclear to me why these services were switched to
allow port reuse, but I believe the desired behavior (unless subclasses
opt in) is to not allow port reuse.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=2323170

4 months agogh-135171: Update documentation for the generator expression (GH-135351)
Serhiy Storchaka [Sun, 15 Jun 2025 00:32:44 +0000 (03:32 +0300)] 
gh-135171: Update documentation for the generator expression (GH-135351)

* gh-135171: Update documentation for the generator expression

Document that the iterator for the leftmost "for" clause is created
immediately.

* Update Doc/reference/expressions.rst

Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
---------

Co-authored-by: Brian Skinn <brian.skinn@gmail.com>
4 months agogh-135497: fix `MAXLOGNAME` detection in `configure.ac` (#135508)
Caleb Xu [Sat, 14 Jun 2025 16:04:16 +0000 (12:04 -0400)] 
gh-135497: fix `MAXLOGNAME` detection in `configure.ac` (#135508)

4 months agogh-135504: Document `LIBZSTD_CFLAGS` and `LIBZSTD_LIBS` config options (#135505)
sobolevn [Sat, 14 Jun 2025 15:07:19 +0000 (18:07 +0300)] 
gh-135504: Document `LIBZSTD_CFLAGS` and `LIBZSTD_LIBS` config options (#135505)

4 months agogh-135371: Fix asyncio introspection output to include internal coroutine chains...
Pablo Galindo Salgado [Sat, 14 Jun 2025 12:48:25 +0000 (13:48 +0100)] 
gh-135371: Fix asyncio introspection output to include internal coroutine chains (#135436)

4 months agogh-135474: Specialize arithmetic only on compact ints (GH-135479)
Ken Jin [Sat, 14 Jun 2025 09:13:32 +0000 (17:13 +0800)] 
gh-135474: Specialize arithmetic only on compact ints (GH-135479)

Specialize arithmetic only on compact ints. This also makes int operations non-escaping in the JIT and in tier 1.

4 months agogh-135368: Fix mocks on dataclass specs with `instance=True` (#135421)
sobolevn [Sat, 14 Jun 2025 08:46:43 +0000 (11:46 +0300)] 
gh-135368: Fix mocks on dataclass specs with `instance=True` (#135421)

* gh-135368: Fix mocks on dataclass specs with `instance=True`

* Extend dataclass mock_methods

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
4 months agogh-135496: Fix f string exclamation mark error typo (#135495)
GiGaGon [Sat, 14 Jun 2025 04:40:42 +0000 (21:40 -0700)] 
gh-135496: Fix f string exclamation mark error typo (#135495)

4 months agogh-135437: Account For Duplicate Names in _PyCode_SetUnboundVarCounts() (gh-135438)
Eric Snow [Fri, 13 Jun 2025 22:47:49 +0000 (16:47 -0600)] 
gh-135437: Account For Duplicate Names in _PyCode_SetUnboundVarCounts() (gh-135438)

4 months agogh-132775: Clean Up Cross-Interpreter Error Handling (gh-135369)
Eric Snow [Fri, 13 Jun 2025 22:45:21 +0000 (16:45 -0600)] 
gh-132775: Clean Up Cross-Interpreter Error Handling (gh-135369)

In this refactor we:

* move some code around
* make a couple of typedefs opaque
* decouple errors from session state
* improve tracebacks for propagated exceptions

This change helps simplify several upcoming changes.

4 months agogh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH...
Serhiy Storchaka [Fri, 13 Jun 2025 16:57:48 +0000 (19:57 +0300)] 
gh-135462: Fix quadratic complexity in processing special input in HTMLParser (GH-135464)

End-of-file errors are now handled according to the HTML5 specs --
comments and declarations are automatically closed, tags are ignored.

4 months agogh-106318: Add example for `str.expandtabs()` (#134525)
Blaise Pabon [Fri, 13 Jun 2025 15:44:21 +0000 (15:44 +0000)] 
gh-106318: Add example for `str.expandtabs()` (#134525)

4 months agogh-135455: Fix version and architecture detection in PC/layout script. (GH-135461)
Steve Dower [Fri, 13 Jun 2025 15:04:43 +0000 (16:04 +0100)] 
gh-135455: Fix version and architecture detection in PC/layout script. (GH-135461)

4 months agogh-134160: Split extension module init from PyModule docs; emphasize multi-phase...
Petr Viktorin [Fri, 13 Jun 2025 14:39:35 +0000 (16:39 +0200)] 
gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init (GH-135126)

Document behaviour of single-phase init. Call it "legacy".

Reorganize PyModule docs.

Move PyInit_modulename docs from the tutorial to reference documentation.

Move PyMODINIT_FUNC docs from generic macros to the new page.

Add doc stubs for `PYTHON_API_VERSION` & `PYTHON_ABI_VERSION`

Remove incorrect refcounts.dat entry for `PyModuleDef_Init`.
This removes the "Return value: Borrowed reference." note.
Instead, note that the function sometimes returns a borrowed reference,
sometimes as strong one.
(IMO, it's best to not think of `PyModuleDef` as a `PyObject` at all,
and act like it can't be reference-counted.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 months agogh-135244: improve wording of `uuid8` docs about CSPRNG (#135433)
LamentXU [Fri, 13 Jun 2025 14:06:11 +0000 (22:06 +0800)] 
gh-135244: improve wording of `uuid8` docs about CSPRNG (#135433)

4 months agogh-126703: Add freelist for PyComplexObject's (gh-135233)
Sergey B Kirpichev [Fri, 13 Jun 2025 13:32:26 +0000 (16:32 +0300)] 
gh-126703: Add freelist for PyComplexObject's (gh-135233)

4 months agogh-106318: Add example for `str.endswith()` (#134523)
Blaise Pabon [Fri, 13 Jun 2025 11:54:16 +0000 (11:54 +0000)] 
gh-106318: Add example for `str.endswith()` (#134523)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 months agogh-106318: Add example for `str.encode()` (#134520)
Blaise Pabon [Fri, 13 Jun 2025 11:32:07 +0000 (11:32 +0000)] 
gh-106318: Add example for `str.encode()` (#134520)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
4 months agogh-135308: clarify math.issubnormal() description (GH-135324)
Sergey B Kirpichev [Fri, 13 Jun 2025 06:30:44 +0000 (09:30 +0300)] 
gh-135308: clarify math.issubnormal() description (GH-135324)

4 months agoGH-134273: Allow setting JIT compiler flags at build time with CFLAGS_JIT (GH134276)
Zanie Blue [Thu, 12 Jun 2025 23:11:08 +0000 (18:11 -0500)] 
GH-134273: Allow setting JIT compiler flags at build time with CFLAGS_JIT (GH134276)

4 months agoRevert "gh-135410: use a critical section around `StringIO.__next__` (#135412)" ...
Peter Bierma [Thu, 12 Jun 2025 22:32:27 +0000 (18:32 -0400)] 
Revert "gh-135410: use a critical section around `StringIO.__next__` (#135412)" (#135439)

This reverts commit e6c3039cb39e68ae9af9ddcaca341c5af8f9cf23.

4 months agogh-135429: Fix the argument mismatch in lsprof throw event (#135442)
Tian Gao [Thu, 12 Jun 2025 21:46:47 +0000 (14:46 -0700)] 
gh-135429: Fix the argument mismatch in lsprof throw event (#135442)

4 months agodoc: Remove what was essentially duplicate wording. (GH-135431)
Eric Hanchrow [Thu, 12 Jun 2025 17:47:12 +0000 (10:47 -0700)] 
doc: Remove what was essentially duplicate wording. (GH-135431)

4 months agogh-133390: Support SQL keyword completion for sqlite3 CLI (GH-133393) (GH-135292)
Petr Viktorin [Thu, 12 Jun 2025 14:28:30 +0000 (16:28 +0200)] 
gh-133390: Support SQL keyword completion for sqlite3 CLI (GH-133393) (GH-135292)

Co-authored-by: Tan Long <tanloong@foxmail.com>
4 months agogh-135410: use a critical section around `StringIO.__next__` (#135412)
Peter Bierma [Thu, 12 Jun 2025 11:11:05 +0000 (07:11 -0400)] 
gh-135410: use a critical section around `StringIO.__next__` (#135412)

4 months agogh-128627: Fix iPad detection in wasm-gc (#135388)
Gyeongjae Choi [Thu, 12 Jun 2025 04:04:13 +0000 (13:04 +0900)] 
gh-128627: Fix iPad detection in wasm-gc (#135388)

On some iPad versions, Safari reports as "macOS". Modifies the GC trampoline detection
to add a feature-based check to detect this case.

4 months agoFix presentation of dataclasses' `unsafe_hash` default value (#116532)
Victorien [Thu, 12 Jun 2025 01:30:33 +0000 (03:30 +0200)] 
Fix presentation of dataclasses' `unsafe_hash` default value (#116532)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
4 months agogh-134939: Add the concurrent.interpreters Module (gh-133958)
Eric Snow [Wed, 11 Jun 2025 23:35:48 +0000 (17:35 -0600)] 
gh-134939: Add the concurrent.interpreters Module (gh-133958)

PEP-734 has been accepted (for 3.14).

(FTR, I'm opposed to putting this under the concurrent package, but
doing so is the SC condition under which the module can land in 3.14.)

4 months agogh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit...
Malcolm Smith [Wed, 11 Jun 2025 15:23:47 +0000 (16:23 +0100)] 
gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (#135337)

4 months agoGH-135379: Remove types from stack items in code generator. (GH-135384)
Mark Shannon [Wed, 11 Jun 2025 14:52:25 +0000 (15:52 +0100)] 
GH-135379: Remove types from stack items in code generator. (GH-135384)

* Make casts explicit in the instruction definitions

4 months agogh-127545: Add _Py_ALIGNED_DEF(N, T) and use it for PyObject (GH-135209)
Petr Viktorin [Wed, 11 Jun 2025 10:44:58 +0000 (12:44 +0200)] 
gh-127545: Add _Py_ALIGNED_DEF(N, T) and use it for PyObject (GH-135209)

* Replace _Py_ALIGN_AS(V) by _Py_ALIGNED_DEF(N, T)

This is now a common façade for the various `_Alignas` alternatives,
which behave in interesting ways -- see the source comment.

The new macro (and MSVC's `__declspec(align)`) should not be used
on a variable/member declaration that includes a struct declaraton.
A workaround is to separate the struct definition.
Do that for `PyASCIIObject.state`.

* Specify minimum PyGC_Head and PyObject alignment

As documented in InternalDocs/garbage_collector.md, the garbage collector
stores flags in the least significant two bits of the _gc_prev pointer
in struct PyGC_Head. Consequently, this pointer is only capable of storing
a location that's aligned to a 4-byte boundary.

Encode this requirement using _Py_ALIGNED_DEF.

This patch fixes a segfault in m68k, which was previously investigated
by Adrian Glaubitz here:
https://lists.debian.org/debian-68k/2024/11/msg00020.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087600
Original patch (using the GCC-only Py_ALIGNED) by Finn Thain.

Co-authored-by: Finn Thain <fthain@linux-m68k.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
4 months agogh-135321: Always raise a correct exception for BINSTRING argument > 0x7fffffff in...
Justin Applegate [Wed, 11 Jun 2025 10:15:12 +0000 (06:15 -0400)] 
gh-135321: Always raise a correct exception for BINSTRING argument > 0x7fffffff in pickle (GH-135322)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
4 months agogh-135326: Test support of __index__ in random.getrandbits() (#135356)
Serhiy Storchaka [Wed, 11 Jun 2025 01:51:08 +0000 (04:51 +0300)] 
gh-135326: Test support of __index__ in random.getrandbits() (#135356)

4 months agogh-133967: Do not normalize locale name 'C.UTF-8' to 'en_US.UTF-8' (#135347)
Serhiy Storchaka [Tue, 10 Jun 2025 13:38:32 +0000 (16:38 +0300)] 
gh-133967: Do not normalize locale name 'C.UTF-8' to 'en_US.UTF-8' (#135347)

4 months agogh-130077: Properly match full soft keywords in the parser (#135317)
Pablo Galindo Salgado [Tue, 10 Jun 2025 13:19:03 +0000 (14:19 +0100)] 
gh-130077: Properly match full soft keywords in the parser (#135317)

4 months agogh-132969: Fix error/hang when shutdown(wait=False) and task exited abnormally ...
Ajay Kamdar [Tue, 10 Jun 2025 11:28:31 +0000 (07:28 -0400)] 
gh-132969:  Fix error/hang when shutdown(wait=False) and task exited abnormally (GH-133222)

When shutdown is called with wait=False, the executor thread keeps running
even after the ProcessPoolExecutor's state is reset. The executor then tries
to replenish the worker processes pool resulting in an error and a potential hang
when it comes across a worker that has died. Fixed the issue by having
_adjust_process_count() return without doing anything if the ProcessPoolExecutor's
state has been reset.

Added unit tests to validate two scenarios:
max_workers < num_tasks (exception)
max_workers > num_tasks (exception + hang)

4 months agogh-118928: Amend sqlite3 execute*() deprecation notes (#135163)
Erlend E. Aasland [Tue, 10 Jun 2025 11:24:33 +0000 (13:24 +0200)] 
gh-118928: Amend sqlite3 execute*() deprecation notes (#135163)

4 months agoDocs: fix docstring of `email.message.Message.add_header` (#134355)
Alexander Shadchin [Tue, 10 Jun 2025 10:35:37 +0000 (13:35 +0300)] 
Docs: fix docstring of `email.message.Message.add_header` (#134355)

4 months agogh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `Parser/pegen.c` (#134048)
Bénédikt Tran [Tue, 10 Jun 2025 00:08:30 +0000 (02:08 +0200)] 
gh-133157: remove usage of `_Py_NO_SANITIZE_UNDEFINED` in `Parser/pegen.c` (#134048)

4 months agoFix warnings `set but not used [-Wunused-but-set-variable]` in remote_debug.h (#135290)
Chris Eibl [Tue, 10 Jun 2025 00:05:06 +0000 (02:05 +0200)] 
Fix warnings `set but not used [-Wunused-but-set-variable]` in remote_debug.h (#135290)

4 months agoFix definition of `_Py_RemoteDebug_` symbols for static linking (#135146)
Zanie Blue [Tue, 10 Jun 2025 00:03:55 +0000 (19:03 -0500)] 
Fix definition of `_Py_RemoteDebug_` symbols for static linking (#135146)

5 months agogh-116738: Make _heapq module thread-safe (#135036)
Alper [Mon, 9 Jun 2025 17:57:29 +0000 (10:57 -0700)] 
gh-116738: Make _heapq module thread-safe (#135036)

Use critical sections to make heapq methods that update the heap thread-safe when the GIL is disabled.

---------

Co-authored-by: mpage <mpage@meta.com>
5 months agoGH-131296: Suppress clang-cl warnings in socketmodule.c (GH-131821)
Chris Eibl [Mon, 9 Jun 2025 16:38:41 +0000 (18:38 +0200)] 
GH-131296: Suppress clang-cl warnings in socketmodule.c (GH-131821)

5 months agogh-127833: Reword and expand the Notation section (GH-134443)
Petr Viktorin [Mon, 9 Jun 2025 13:50:11 +0000 (15:50 +0200)] 
gh-127833: Reword and expand the Notation section (GH-134443)

Prepare the docs for using the notation used in the `python.gram`
file. If we want to sync the two, the meta-syntax should be the same.

Link the Full Grammar docs here; keep only a few extras.

Also, remove the distinction between lexical and syntactic rules,
except for whitespace handling.
With f- and t-strings, the line between the two is blurry.

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Colin Marquardt <cmarqu42@gmail.com>
5 months agogh-135001: Explicitly specify the encoding parameter value of `calendar.HTMLCalendar...
Wulian233 [Mon, 9 Jun 2025 13:40:09 +0000 (21:40 +0800)] 
gh-135001: Explicitly specify the encoding parameter value of `calendar.HTMLCalendar` as 'utf-8' (#135002)

5 months agogh-133968: Update PyUnicodeWriter_WriteASCII() documentation (#135297)
Victor Stinner [Mon, 9 Jun 2025 12:47:02 +0000 (14:47 +0200)] 
gh-133968: Update PyUnicodeWriter_WriteASCII() documentation (#135297)

The function was added to Python 3.14.

5 months agoGH-135287: clang-cl PGO builds on Windows fail with `could not open '/GENPROFILE...
Chris Eibl [Mon, 9 Jun 2025 11:52:38 +0000 (13:52 +0200)] 
GH-135287: clang-cl PGO builds on Windows fail with `could not open '/GENPROFILE'` (GH-135289)

5 months agogh-131798: Optimize `_UNARY_INVERT` (GH-135222)
Noam Cohen [Mon, 9 Jun 2025 10:33:18 +0000 (13:33 +0300)] 
gh-131798: Optimize `_UNARY_INVERT` (GH-135222)

5 months agogh-131316: fix invalid `DECREF` in `_md5.md5.copy()` (#135291)
Bénédikt Tran [Mon, 9 Jun 2025 09:10:32 +0000 (11:10 +0200)] 
gh-131316: fix invalid `DECREF` in `_md5.md5.copy()` (#135291)

This amends commit 261633bd3f48607478f50d12d8025cd4bb36f6f4.

5 months agobpo-45210: Document that error indicator may be set in tp_dealloc (#28358)
Edward Z. Yang [Mon, 9 Jun 2025 08:56:32 +0000 (04:56 -0400)] 
bpo-45210: Document that error indicator may be set in tp_dealloc (#28358)

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
5 months agogh-135004: rewrite and cleanup `blake2module.c` (#135006)
Bénédikt Tran [Mon, 9 Jun 2025 07:17:43 +0000 (09:17 +0200)] 
gh-135004: rewrite and cleanup `blake2module.c` (#135006)

* Cleanup imports and update module docstring.
* Simplify detection of SIMD support.
* Correctly guard `update()` cases.
* Rewrite `py_blake2b_or_s_new` and rename it to `py_blake2_new`.
* Rewrite `blake2_blake2b_copy_locked` and `py_blake2_clear`.
* Refactor computations of `digest` and `hexdigest`.
* Simplify `py_blake2b_get_name` and `py_blake2b_get_block_size`.
* Add `hacl_get_blake2_info` to extract static BLAKE-2 information.
   This new helper is used by `py_blake2b_get_digest_size`, but can
   be later used to expose `key_length` more easily.

5 months agogh-135234: improve `_hashlib` exceptions when reporting an OpenSSL function failure...
Bénédikt Tran [Mon, 9 Jun 2025 07:13:29 +0000 (09:13 +0200)] 
gh-135234: improve `_hashlib` exceptions when reporting an OpenSSL function failure (#135250)

- Refactor `get_openssl_evp_md_by_utf8name` error branches.
- Refactor `HASH.{digest,hexdigest}` computations.
- Refactor `_hashlib_HASH_copy_locked` and `locked_HMAC_CTX_copy`.

5 months agoUse f-strings in csv docs example (#135245)
Ezio Melotti [Sun, 8 Jun 2025 22:28:37 +0000 (00:28 +0200)] 
Use f-strings in csv docs example (#135245)