Skip to content

Commit 76a88ba

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Sync pre-release CPython 3.15 branch from GitHub (2026-06-13)
Summary: Imported python/cpython `3.15.0b2+dev` from upstream rev [`75289a9`](https://www.github.com/python/cpython/commit/75289a92dfb460acde427b9f399881a108427b6c) (committed 2026-06-13 23:40:19+00:00). # Commit Info - Base: (`3.15.0b2+dev`) - [`a2e5516`](https://www.github.com/python/cpython/commit/a2e551610f6248cfd130172e1cf9f5ee811758b9) (commit date: 2026-06-12 01:47:01+00:00) - Imported: (`3.15.0b2+dev`) - [`75289a9`](https://www.github.com/python/cpython/commit/75289a92dfb460acde427b9f399881a108427b6c) (commit date: 2026-06-13 23:40:19+00:00) # Noteworthy file changes - Low-signal files (4 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GAlRSyBZB6EslScJAPwquOqAdDAJbr0LAAAz Differential Revision: D108538177 fbshipit-source-id: 4ff7f84c9ad92788b8a057a72621ea49385b97b6
1 parent a2fee60 commit 76a88ba

17 files changed

Lines changed: 89 additions & 29 deletions

.github/workflows/reusable-san.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,10 @@ jobs:
8282
run: make -j4
8383
- name: Display build info
8484
run: make pythoninfo
85-
# test_capi is skipped under UBSan because
86-
# they raise signals that UBSan with halt_on_error=1 intercepts.
8785
- name: Tests
8886
run: >-
8987
./python -m test
9088
${{ inputs.sanitizer == 'TSan' && '--tsan' || '' }}
91-
${{ inputs.sanitizer == 'UBSan' && '-x test_capi' || '' }}
9289
-j4 -W
9390
- name: Parallel tests
9491
if: >-

Doc/library/curses.ascii.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ C library:
130130

131131
.. function:: isgraph(c)
132132

133-
Checks for ASCII any printable character except space.
133+
Checks for any ASCII printable character except space.
134134

135135

136136
.. function:: islower(c)
@@ -145,7 +145,7 @@ C library:
145145

146146
.. function:: ispunct(c)
147147

148-
Checks for any printable ASCII character which is not a space or an alphanumeric
148+
Checks for any ASCII printable character which is not a space or an alphanumeric
149149
character.
150150

151151

Doc/library/enum.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ Data types
629629
>>> white in purple
630630
False
631631

632-
.. method:: __iter__(self):
632+
.. method:: __iter__(self)
633633

634634
Returns all contained non-alias members::
635635

@@ -640,7 +640,7 @@ Data types
640640

641641
.. versionadded:: 3.11
642642

643-
.. method:: __len__(self):
643+
.. method:: __len__(self)
644644

645645
Returns number of members in flag::
646646

@@ -651,7 +651,7 @@ Data types
651651

652652
.. versionadded:: 3.11
653653

654-
.. method:: __bool__(self):
654+
.. method:: __bool__(self)
655655

656656
Returns *True* if any members in flag, *False* otherwise::
657657

@@ -688,7 +688,7 @@ Data types
688688
>>> purple ^ Color.GREEN
689689
<Color.RED|GREEN|BLUE: 7>
690690

691-
.. method:: __invert__(self):
691+
.. method:: __invert__(self)
692692

693693
Returns all the flags in *type(self)* that are not in *self*::
694694

Doc/library/functions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ are always available. They are listed here in alphabetical order.
485485
:noindex:
486486
487487
Create a new dictionary. The :class:`dict` object is the dictionary class.
488-
See :class:`dict` and :ref:`typesmapping` for documentation about this class.
488+
See also :ref:`typesmapping` for documentation about this class.
489489

490490
For other containers see the built-in :class:`frozendict`, :class:`list`,
491491
:class:`set`, and :class:`tuple` classes, as well as the :mod:`collections` module.
@@ -873,7 +873,7 @@ are always available. They are listed here in alphabetical order.
873873
:noindex:
874874
875875
Create a new frozen dictionary. The :class:`frozendict` object is a built-in class.
876-
See :class:`frozendict` and :ref:`typesmapping` for documentation about this class.
876+
See also :ref:`typesmapping` for documentation about this class.
877877

878878
For other containers see the built-in :class:`dict`, :class:`list`, :class:`set`,
879879
and :class:`tuple` classes, as well as the :mod:`collections` module.
@@ -886,7 +886,7 @@ are always available. They are listed here in alphabetical order.
886886
:noindex:
887887

888888
Return a new :class:`frozenset` object, optionally with elements taken from
889-
*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and
889+
*iterable*. :class:`frozenset` is a built-in class. See also
890890
:ref:`types-set` for documentation about this class.
891891

892892
For other containers see the built-in :class:`set`, :class:`list`,
@@ -1814,7 +1814,7 @@ are always available. They are listed here in alphabetical order.
18141814
:noindex:
18151815

18161816
Return a new :class:`set` object, optionally with elements taken from
1817-
*iterable*. ``set`` is a built-in class. See :class:`set` and
1817+
*iterable*. :class:`set` is a built-in class. See also
18181818
:ref:`types-set` for documentation about this class.
18191819

18201820
For other containers see the built-in :class:`frozenset`, :class:`list`,

Doc/library/unittest.mock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ Alternatively you can just use ``vars(my_mock)`` (instance members) and
25392539
mock_open
25402540
~~~~~~~~~
25412541

2542-
.. function:: mock_open(mock=None, read_data=None)
2542+
.. function:: mock_open(mock=None, read_data='')
25432543

25442544
A helper function to create a mock to replace the use of :func:`open`. It works
25452545
for :func:`open` called directly or used as a context manager.

Lib/base64.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
1+
"""Base16, Base32, Base64 (RFC 4648), Base85 and Ascii85 data encodings"""
22

33
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
44
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
@@ -219,7 +219,7 @@ def urlsafe_b64decode(s, *, padded=False):
219219
characters present in the input.
220220
'''
221221
_B32_DECODE_MAP01_DOCSTRING = '''
222-
RFC 3548 allows for optional mapping of the digit 0 (zero) to the
222+
RFC 4648 allows for optional mapping of the digit 0 (zero) to the
223223
letter O (oh), and for optional mapping of the digit 1 (one) to
224224
either the letter I (eye) or letter L (el). The optional argument
225225
map01 when not None, specifies which letter the digit 1 should be
@@ -266,7 +266,7 @@ def b32hexdecode(s, casefold=False, *, padded=True, ignorechars=b'',
266266
extra_args='')
267267

268268

269-
# RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns
269+
# RFC 4648, Base 16 Alphabet specifies uppercase, but hexlify() returns
270270
# lowercase. The RFC also recommends against accepting input case
271271
# insensitively.
272272
def b16encode(s, *, wrapcol=0):

Lib/concurrent/futures/process.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,9 @@ def _terminate_broken(self, cause):
469469
executor._shutdown_thread = True
470470
executor = None
471471

472-
# All pending tasks are to be marked failed with the following
473-
# BrokenProcessPool error
474-
bpe = BrokenProcessPool("A process in the process pool was "
475-
"terminated abruptly while the future was "
476-
"running or pending.")
472+
# All pending tasks are to be marked failed with a
473+
# BrokenProcessPool error, as separate instances to avoid sharing
474+
# a traceback (gh-101267).
477475
cause_str = None
478476
if cause is not None:
479477
cause_str = ''.join(cause)
@@ -489,11 +487,15 @@ def _terminate_broken(self, cause):
489487
f"with exit code {p.exitcode}")
490488
if errors:
491489
cause_str = "\n".join(errors)
492-
if cause_str:
493-
bpe.__cause__ = _RemoteTraceback(f"\n'''\n{cause_str}'''")
490+
cause_tb = f"\n'''\n{cause_str}'''" if cause_str else None
494491

495492
# Mark pending tasks as failed.
496493
for work_id, work_item in self.pending_work_items.items():
494+
bpe = BrokenProcessPool("A process in the process pool was "
495+
"terminated abruptly while the future was "
496+
"running or pending.")
497+
if cause_tb is not None:
498+
bpe.__cause__ = _RemoteTraceback(cause_tb)
497499
try:
498500
work_item.future.set_exception(bpe)
499501
except _base.InvalidStateError:

Lib/test/test_capi/test_unicode.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,16 +842,18 @@ def test_fromwidechar(self):
842842
if SIZEOF_WCHAR_T == 2:
843843
self.assertEqual(fromwidechar('a\U0001f600'.encode(encoding), 2), 'a\ud83d')
844844

845-
self.assertRaises(MemoryError, fromwidechar, b'', PY_SSIZE_T_MAX)
846845
self.assertRaises(SystemError, fromwidechar, b'\0'*SIZEOF_WCHAR_T, -2)
847-
self.assertRaises(SystemError, fromwidechar, b'\0'*SIZEOF_WCHAR_T, PY_SSIZE_T_MIN)
848846
self.assertEqual(fromwidechar(NULL, 0), '')
849847
self.assertRaises(SystemError, fromwidechar, NULL, 1)
850848
self.assertRaises(SystemError, fromwidechar, NULL, PY_SSIZE_T_MAX)
851849
self.assertRaises(SystemError, fromwidechar, NULL, -1)
852850
self.assertRaises(SystemError, fromwidechar, NULL, -2)
853851
self.assertRaises(SystemError, fromwidechar, NULL, PY_SSIZE_T_MIN)
854852

853+
# The following tests are skipped since they rely on undefined behavior
854+
#self.assertRaises(MemoryError, fromwidechar, b'', PY_SSIZE_T_MAX)
855+
#self.assertRaises(SystemError, fromwidechar, b'\0'*SIZEOF_WCHAR_T, PY_SSIZE_T_MIN)
856+
855857
@support.cpython_only
856858
@unittest.skipIf(_testlimitedcapi is None, 'need _testlimitedcapi module')
857859
def test_aswidechar(self):

Lib/test/test_concurrent_futures/test_process_pool.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import threading
55
import time
6+
import traceback
67
import unittest
78
import unittest.mock
89
from concurrent import futures
@@ -62,6 +63,32 @@ def test_killed_child(self):
6263
# Submitting other jobs fails as well.
6364
self.assertRaises(BrokenProcessPool, self.executor.submit, pow, 2, 8)
6465

66+
@warnings_helper.ignore_fork_in_thread_deprecation_warnings()
67+
def test_broken_process_pool_traceback(self):
68+
# When a child process is abruptly terminated, the whole pool gets
69+
# "broken", and a BrokenProcessPool exception should be created
70+
# for each future instead of sharing one exception among all futures.
71+
event = self.create_event()
72+
futures = [self.executor.submit(event.wait) for _ in range(3)]
73+
p = next(iter(self.executor._processes.values()))
74+
p.terminate()
75+
for fut in futures:
76+
# Don't use assertRaises(): it clears the traceback off exc.
77+
try:
78+
fut.result()
79+
except BrokenProcessPool as exc:
80+
tb = exc.__traceback__
81+
else:
82+
self.fail("BrokenProcessPool not raised")
83+
count = sum(
84+
1
85+
for frame_summary in traceback.extract_tb(tb)
86+
if frame_summary.filename == __file__
87+
)
88+
# This code file should appear exactly once in the traceback.
89+
# A shared exception would accumulate a frame per result() call.
90+
self.assertEqual(count, 1)
91+
6592
@warnings_helper.ignore_fork_in_thread_deprecation_warnings()
6693
def test_map_chunksize(self):
6794
def bad_map():

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,7 @@ Charlie Shepherd
17621762
Bruce Sherwood
17631763
Gregory Shevchenko
17641764
Hai Shi
1765+
Daniel Shields
17651766
Alexander Shigin
17661767
Pete Shinners
17671768
Michael Shiplett

0 commit comments

Comments
 (0)