Skip to content

Commit b400516

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Sync pre-release CPython 3.15 branch from GitHub (2026-07-07)
Summary: Imported python/cpython `3.15.0b3+dev` from upstream rev [`017e4e9`](https://www.github.com/python/cpython/commit/017e4e9bb8152bf09acd31b5fcaafceac002d84f) (committed 2026-07-07 00:24:44+00:00). # Commit Info - Base: (`3.15.0b3+dev`) - [`5ae6203`](https://www.github.com/python/cpython/commit/5ae62034e5ef8c9799f08364e06ade9064826e39) (commit date: 2026-07-05 19:36:51+00:00) - Imported: (`3.15.0b3+dev`) - [`017e4e9`](https://www.github.com/python/cpython/commit/017e4e9bb8152bf09acd31b5fcaafceac002d84f) (commit date: 2026-07-07 00:24:44+00:00) # Noteworthy file changes - Low-signal files (5 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GPKyLizWhyQ2yvQEAOlaaVg1AdZ8br0LAAAz Reviewed By: itamaro Differential Revision: D110848646 fbshipit-source-id: 5e44f8de9bdc7b0aa264ea213c01379b2e437fb0
1 parent fb8d627 commit b400516

26 files changed

Lines changed: 181 additions & 38 deletions

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,16 @@ jobs:
253253
strategy:
254254
fail-fast: false
255255
matrix:
256-
# macos-26 is Apple Silicon, macos-15-intel is Intel.
257-
# macos-15-intel only runs tests against the GIL-enabled CPython.
256+
# macos-26 is Apple Silicon, macos-26-intel is Intel.
257+
# macos-26-intel only runs tests against the GIL-enabled CPython.
258258
os:
259259
- macos-26
260-
- macos-15-intel
260+
- macos-26-intel
261261
free-threading:
262262
- false
263263
- true
264264
exclude:
265-
- os: macos-15-intel
265+
- os: macos-26-intel
266266
free-threading: true
267267
uses: ./.github/workflows/reusable-macos.yml
268268
with:

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ jobs:
5454
--prefix=/opt/python-dev \
5555
--with-openssl="$(brew --prefix openssl@3.5)"
5656
- name: Build CPython
57-
if : ${{ inputs.free-threading || inputs.os != 'macos-15-intel' }}
57+
if : ${{ inputs.free-threading || inputs.os != 'macos-26-intel' }}
5858
run: gmake -j8
5959
- name: Build CPython for compiler warning check
60-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
60+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6161
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
6262
- name: Display build info
6363
run: make pythoninfo
6464
- name: Check compiler warnings
65-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
65+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6666
run: >-
6767
python3 Tools/build/check_warnings.py
6868
--compiler-output-file-path=compiler_output_macos.txt

Doc/library/glob.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ not by actually invoking a subshell.
2929
The pathnames are returned in no particular order. If you need a specific
3030
order, sort the results.
3131

32-
Files beginning with a dot (``.``) can only be matched by
32+
By default, files beginning with a dot (``.``) can only be matched by
3333
patterns that also start with a dot,
3434
unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`.
3535
For tilde and shell variable expansion, use :func:`os.path.expanduser` and
@@ -70,7 +70,8 @@ The :mod:`!glob` module defines the following functions:
7070
pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files will not
7171
match.
7272

73-
If *include_hidden* is true, "``**``" pattern will match hidden directories.
73+
If *include_hidden* is true, wildcards can match path segments that
74+
begin with a dot (``.``).
7475

7576
.. audit-event:: glob.glob pathname,recursive glob.glob
7677
.. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob
@@ -131,7 +132,7 @@ The :mod:`!glob` module defines the following functions:
131132
Escape all special characters (``'?'``, ``'*'`` and ``'['``).
132133
This is useful if you want to match an arbitrary literal string that may
133134
have special characters in it. Special characters in drive/UNC
134-
sharepoints are not escaped, e.g. on Windows
135+
sharepoints are not escaped, for example on Windows
135136
``escape('//?/c:/Quo vadis?.txt')`` returns ``'//?/c:/Quo vadis[?].txt'``.
136137

137138
.. versionadded:: 3.4

Doc/library/os.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,6 +2180,11 @@ features:
21802180

21812181
.. audit-event:: os.chdir path os.chdir
21822182

2183+
.. seealso::
2184+
2185+
The :func:`contextlib.chdir` context manager, which changes the current
2186+
working directory on entering and restores the previous one on exit.
2187+
21832188
.. versionchanged:: 3.3
21842189
Added support for specifying *path* as a file descriptor
21852190
on some platforms.
@@ -3032,10 +3037,16 @@ features:
30323037

30333038
.. attribute:: path
30343039

3035-
The entry's full path name: equivalent to ``os.path.join(scandir_path,
3036-
entry.name)`` where *scandir_path* is the :func:`scandir` *path*
3037-
argument. The path is only absolute if the :func:`scandir` *path*
3038-
argument was absolute. If the :func:`scandir` *path*
3040+
The entry's path name: equivalent to ``os.path.join(scandir_path,
3041+
entry.name)`` where *scandir_path* is the original :func:`scandir`
3042+
*path* argument. Apart from the filename, the path preserves the
3043+
original :func:`scandir` argument. If the :func:`scandir` *path*
3044+
argument was relative, the :attr:`path` attribute is also relative.
3045+
Changing the current working directory after creating the
3046+
:func:`scandir` iterator may cause later uses of :attr:`path` to resolve
3047+
differently. On some platforms, the constructed path may not be valid
3048+
if the original :func:`scandir` argument was usable for enumeration but
3049+
not for joining with the entry name. If the :func:`scandir` *path*
30393050
argument was a :ref:`file descriptor <path_fd>`, the :attr:`path`
30403051
attribute is the same as the :attr:`name` attribute.
30413052

Doc/library/urllib.parse.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,16 @@ or on combining URL components into a URL string.
6060
*missing_as_none* is true.
6161
Not defined component are represented an empty string (by default) or
6262
``None`` if *missing_as_none* is true.
63-
The components are not broken up
64-
into smaller parts (for example, the network location is a single string), and %
65-
escapes are not expanded. The delimiters as shown above are not part of the
66-
result, except for a leading slash in the *path* component, which is retained if
67-
present. For example:
63+
The delimiters as shown above are not part of the result, except for a
64+
leading slash in the *path* component, which is retained if present.
65+
66+
Additionally, the netloc property is broken down into these additional
67+
attributes added to the returned object: username, password, hostname, and
68+
port.
69+
70+
Percent-encoded sequences are not decoded.
71+
72+
For example:
6873

6974
.. doctest::
7075
:options: +NORMALIZE_WHITESPACE

Lib/glob.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
3434
If `dir_fd` is not None, it should be a file descriptor referring to a
3535
directory, and paths will then be relative to that directory.
3636
37-
If `include_hidden` is true, the patterns '*', '?', '**' will match
38-
hidden directories.
37+
If `include_hidden` is true, wildcards can match path segments beginning
38+
with a dot ('.').
3939
4040
If `recursive` is true, the pattern '**' will match any files and
4141
zero or more directories and subdirectories.
@@ -64,8 +64,8 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
6464
If `dir_fd` is not None, it should be a file descriptor referring to a
6565
directory, and paths will then be relative to that directory.
6666
67-
If `include_hidden` is true, the patterns '*', '?', '**' will match
68-
hidden directories.
67+
If `include_hidden` is true, wildcards can match path segments beginning
68+
with a dot ('.').
6969
7070
If `recursive` is true, the pattern '**' will match any files and
7171
zero or more directories and subdirectories.

Lib/profiling/tracing/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ def main():
197197
# in the module's namespace.
198198
globs = module.__dict__
199199
globs.update({
200-
'__spec__': spec,
200+
# Set __spec__ to None so the profiled program behaves like a
201+
# script run directly (gh-140729).
202+
'__spec__': None,
201203
'__file__': spec.origin,
202204
'__name__': spec.name,
203205
'__package__': None,

Lib/test/test_capi/test_bytes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ def test_decodeescape(self):
222222
self.assertEqual(decodeescape(br'x\xa\xy', 'replace'), b'x??y')
223223
self.assertEqual(decodeescape(br'x\xa\xy', 'ignore'), b'xy')
224224
self.assertRaises(ValueError, decodeescape, b'\\', 'spam')
225-
self.assertEqual(decodeescape(NULL), b'')
226225
self.assertRaises(OverflowError, decodeescape, b'abc', NULL, PY_SSIZE_T_MAX)
227226
self.assertRaises(OverflowError, decodeescape, NULL, NULL, PY_SSIZE_T_MAX)
228227

228+
# INVALID decodeescape(NULL)
229229
# CRASHES decodeescape(b'abc', NULL, -1)
230230
# CRASHES decodeescape(NULL, NULL, 1)
231231

Lib/test/test_fstring.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,9 @@ def test_invalid_syntax_error_message(self):
17061706
with self.assertRaisesRegex(SyntaxError,
17071707
"f-string: expecting '=', or '!', or ':', or '}'"):
17081708
compile("f'{a $ b}'", "?", "exec")
1709+
with self.assertRaisesRegex(SyntaxError,
1710+
"f-string: expecting '!', or ':', or '}'"):
1711+
compile("f'{a=b}'", "?", "exec")
17091712

17101713
def test_with_two_commas_in_format_specifier(self):
17111714
error_msg = re.escape("Cannot specify ',' with ','.")

Lib/test/test_math_integer.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ def __init__(self, value):
1515
def __index__(self):
1616
return self.value
1717

18+
# int subclass with broken arithmetic operators; implementations must
19+
# convert their arguments to exact ints instead of using these.
20+
class BadIntSubclass(int):
21+
def _binop(self, other='ignored', mod=None):
22+
return 42
23+
__add__ = __radd__ = __sub__ = __rsub__ = _binop
24+
__mul__ = __rmul__ = __mod__ = __rmod__ = _binop
25+
__divmod__ = __rdivmod__ = __pow__ = __rpow__ = _binop
26+
__floordiv__ = __rfloordiv__ = _binop
27+
__lshift__ = __rlshift__ = __rshift__ = __rrshift__ = _binop
28+
__and__ = __rand__ = __or__ = __ror__ = __xor__ = __rxor__ = _binop
29+
__lt__ = __le__ = __gt__ = __ge__ = _binop
30+
1831
# Here's a pure Python version of the math.integer.factorial algorithm, for
1932
# documentation and comparison purposes.
2033
#
@@ -226,6 +239,11 @@ def test_isqrt(self):
226239
self.assertIntEqual(isqrt(False), 0)
227240
self.assertIntEqual(isqrt(MyIndexable(1729)), 41)
228241

242+
# Overridden operators of an int subclass must not affect the
243+
# result.
244+
self.assertIntEqual(isqrt(BadIntSubclass(10**20)), 10**10)
245+
self.assertIntEqual(isqrt(BadIntSubclass(10**20 - 1)), 10**10 - 1)
246+
229247
with self.assertRaises(ValueError):
230248
isqrt(MyIndexable(-3))
231249

0 commit comments

Comments
 (0)