Skip to content

Commit 57a9eb7

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Sync pre-release CPython 3.15 branch from GitHub (2026-08-02)
Summary: Imported python/cpython `3.15.0b4+dev` from upstream rev [`07e73c0`](https://www.github.com/python/cpython/commit/07e73c01c5ba2f8ff6b5f237a8a87dfb88787383) (committed 2026-08-02 18:49:20+00:00). # Commit Info - Base: (`3.15.0b4+dev`) - [`74887c9`](https://www.github.com/python/cpython/commit/74887c9b832ef316c83e3bff14de0c866e305c7b) (commit date: 2026-08-01 20:22:23+00:00) - Imported: (`3.15.0b4+dev`) - [`07e73c0`](https://www.github.com/python/cpython/commit/07e73c01c5ba2f8ff6b5f237a8a87dfb88787383) (commit date: 2026-08-02 18:49:20+00:00) # Noteworthy file changes - Low-signal files (2 added) (NEWS.d, docs, .github) - Other files (3 added, 10 removed) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GGZjCRNdm7vP55cDAAnhr8_Yt1Y4br0LAAAz Reviewed By: itamaro Differential Revision: D114556804 fbshipit-source-id: 58a6e7e74df2a865d404294d7313e85ced2ba7d9
1 parent 166a2c5 commit 57a9eb7

21 files changed

Lines changed: 82 additions & 111 deletions

File tree

.github/workflows/reusable-san.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ jobs:
3939
run: |
4040
sudo ./.github/workflows/posix-deps-apt.sh
4141
# On ubuntu-26.04 image, clang is clang-21 by default
42+
# NOTE: when bumping to a new version of clang,
43+
# please update the versions in `Tools/pixi-packages/variants.yaml` too.
4244
echo "CC=clang" >> "$GITHUB_ENV"
4345
echo "CXX=clang++" >> "$GITHUB_ENV"
4446
- name: TSan option setup

Doc/library/functools.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ The :mod:`!functools` module defines the following functions:
386386
only one positional argument is provided, but there are two placeholders
387387
that must be filled in.
388388

389-
If :func:`!partial` is applied to an existing :func:`!partial` object,
390-
:data:`!Placeholder` sentinels of the input object are filled in with
391-
new positional arguments.
389+
If :func:`!partial` is applied to an existing
390+
:ref:`partial object <partial-objects>`, :data:`!Placeholder` sentinels of the
391+
input object are filled in with new positional arguments.
392392
A placeholder can be retained by inserting a new
393393
:data:`!Placeholder` sentinel to the place held by a previous :data:`!Placeholder`:
394394

Lib/logging/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,11 @@ def removeHandler(self, hdlr):
16971697
"""
16981698
with _lock:
16991699
if hdlr in self.handlers:
1700-
self.handlers.remove(hdlr)
1700+
# Replace the list instead of mutating it in place, so that
1701+
# callHandlers() can iterate it without a lock (gh-79366).
1702+
handlers = self.handlers.copy()
1703+
handlers.remove(hdlr)
1704+
self.handlers = handlers
17011705

17021706
def hasHandlers(self):
17031707
"""

Lib/test/test_logging.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,23 @@ def lock_holder_thread_fn():
814814

815815
support.wait_process(pid, exitcode=0)
816816

817+
def test_remove_handler_while_emitting(self):
818+
# Removing a handler while callHandlers() iterates over the handlers
819+
# should not cause the following handlers to be skipped (gh-79366).
820+
logger = logging.Logger('test_remove_handler_while_emitting')
821+
calls = []
822+
class RemovingHandler(logging.Handler):
823+
def emit(self, record):
824+
calls.append('removing')
825+
logger.removeHandler(self)
826+
class CountingHandler(logging.Handler):
827+
def emit(self, record):
828+
calls.append('counting')
829+
logger.addHandler(RemovingHandler())
830+
logger.addHandler(CountingHandler())
831+
logger.error('spam')
832+
self.assertEqual(calls, ['removing', 'counting'])
833+
817834

818835
class BadStream(object):
819836
def write(self, data):
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fixed a race condition in :mod:`logging`:
2+
if a handler was removed while a record was being emitted,
3+
the following handlers of the same logger could be skipped.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The CPython Pixi packages are now all accessible at the same
2+
``Tools/pixi-packages`` subdirectory, rather than at
3+
``Tools/pixi-packages/{variant}`` as before. Variants are now selected not
4+
via subdirectory but via ``flags``; see
5+
https://pixi.prefix.dev/latest/concepts/package_specifications/#extras-and-flags
6+
for usage instructions. The ``tsan-freethreading`` variant has been renamed
7+
to ``tsan_freethreading``, while the ``default``, ``asan``, and
8+
``freethreading`` variants retain their previous names.

Modules/_decimal/_decimal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,12 +1690,12 @@ _decimal.Context.copy
16901690
16911691
cls: defining_class
16921692
1693-
Return a duplicate of the context with all flags cleared.
1693+
Return a duplicate of the context.
16941694
[clinic start generated code]*/
16951695

16961696
static PyObject *
16971697
_decimal_Context_copy_impl(PyObject *self, PyTypeObject *cls)
1698-
/*[clinic end generated code: output=31c9c8eeb0c0cf77 input=aef1c0bddabdf8f0]*/
1698+
/*[clinic end generated code: output=31c9c8eeb0c0cf77 input=87f8b92b1c7462a5]*/
16991699
{
17001700
decimal_state *state = PyType_GetModuleState(cls);
17011701

Modules/_decimal/clinic/_decimal.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/pixi-packages/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ in a [Pixi workspace](https://pixi.sh/latest/first_workspace/), like:
1010
```toml
1111
[dependencies]
1212
python.git = "https://github.com/python/cpython"
13-
python.subdirectory = "Tools/pixi-packages/asan"
13+
python.subdirectory = "Tools/pixi-packages"
14+
python.flags = ["asan"]
1415
```
1516

1617
This is particularly useful when developers need to build CPython from source
1718
(for example, for an ASan or TSan-instrumented build), as it does not require any manual
1819
clone or build steps. Instead, Pixi will automatically handle both the build
1920
and installation of the package.
2021

21-
Each package definition is contained in a subdirectory, but they share the build script
22-
`build.sh` in this directory. Currently defined package variants:
22+
Each package variant carries a 'flag' to enable selection of that variant — see
23+
[the Pixi docs](https://pixi.prefix.dev/latest/concepts/package_specifications/#extras-and-flags)
24+
for details of how to use this. Currently defined package variants:
2325

2426
- `default`
2527
- `freethreading`
2628
- `asan`: ASan-instrumented build
27-
- `tsan-freethreading`: TSan-instrumented free-threading build
29+
- `tsan_freethreading`: TSan-instrumented free-threading build
2830

2931
## Maintenance
3032

31-
- Keep the `abi_tag` and `version` fields in each `variants.yaml` up to date with the
33+
- Keep the `version` field in `variants.yaml` up to date with the
3234
Python version
3335
- Update `build.sh` for any breaking changes in the `configure` and `make` workflow
3436

3537
## Opportunities for future improvement
3638

3739
- More package variants (such as UBSan)
3840
- Support for Windows
39-
- Using a single `pixi.toml` for all package variants is blocked on
40-
[pixi#5248](https://github.com/prefix-dev/pixi/issues/5248)
4141

4242
## Troubleshooting
4343

Tools/pixi-packages/asan/variants.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)