Skip to content

Commit cf99e2d

Browse files
generatedunixname1734921407115435meta-codesync[bot]
authored andcommitted
Sync pre-release CPython 3.15 branch from GitHub (2026-08-27)
Summary: Imported python/cpython `3.15.0rc1+dev` from upstream rev [`431f526`](https://www.github.com/python/cpython/commit/431f526550dd683978b146d2b318ddd1933acf2f) (committed 2026-08-27 14:03:46+00:00). # Commit Info - Base: (`3.15.0rc1+dev`) - [`1c826a4`](https://www.github.com/python/cpython/commit/1c826a40a2f9606e284fd3d6d5f7c7c6732327ed) (commit date: 2026-08-26 00:59:49+00:00) - Imported: (`3.15.0rc1+dev`) - [`431f526`](https://www.github.com/python/cpython/commit/431f526550dd683978b146d2b318ddd1933acf2f) (commit date: 2026-08-27 14:03:46+00:00) # Noteworthy file changes - Low-signal files (8 added) (NEWS.d, docs, .github) Complete list of added/removed files: https://www.internalfb.com/intern/everpaste/?color=0&handle=GDwh9i5mcJlzFRgGAHLO_yxfQHYvbr0LAAAz Differential Revision: D117820797 fbshipit-source-id: 9a9c07f8d98117b454a2587fefae2583b2f58c9d
1 parent 3416e57 commit cf99e2d

73 files changed

Lines changed: 1447 additions & 249 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ help:
3232
@echo "Please use \`make <target>' where <target> is one of"
3333
@echo " clean to remove build files"
3434
@echo " venv to create a venv with necessary tools"
35+
@echo " lock to regenerate the pinned dependencies in $(REQUIREMENTS)"
3536
@echo " html to make standalone HTML files"
3637
@echo " gettext to generate POT files"
3738
@echo " htmlview to open the index page built by the html target in your browser"
@@ -185,6 +186,19 @@ venv:
185186
echo "The venv has been created in the $(VENVDIR) directory"; \
186187
fi
187188

189+
.PHONY: lock
190+
lock:
191+
# Dependencies have a 14 day cooldown period to mitigate supply chain attacks,
192+
# except for sphinx_linklint and python-docs-theme, which are maintained by
193+
# core team members.
194+
uv pip compile requirements.txt \
195+
--exclude-newer P14D \
196+
--exclude-newer-package sphinx_linklint=PT0S \
197+
--exclude-newer-package python-docs-theme=PT0S \
198+
--no-cache --output-file $(REQUIREMENTS) \
199+
--python-version 3.12 --universal \
200+
--custom-compile-command="make lock"
201+
188202
.PHONY: dist-no-html
189203
dist-no-html: dist-text dist-epub dist-texinfo
190204

Doc/c-api/import.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Importing Modules
146146
alternatives.
147147
148148
.. versionchanged:: 3.15
149-
``__cached__`` is no longer set.
149+
The ``__cached__`` attribute is no longer set.
150150
151151
152152
.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
@@ -170,7 +170,7 @@ Importing Modules
170170
:class:`~importlib.machinery.ModuleSpec` for alternatives.
171171
172172
.. versionchanged:: 3.15
173-
``__cached__`` no longer set.
173+
The ``__cached__`` attribute no longer set.
174174
175175
176176
.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname)

Doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
# Skip if downstream redistributors haven't installed them
4343
_OPTIONAL_EXTENSIONS = (
44-
'linklint.ext',
44+
'sphinx_linklint.ext',
4545
'notfound.extension',
4646
'sphinxext.opengraph',
4747
'sphinxcontrib.rsvgconverter',

Doc/library/asyncio-stream.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ and work with streams:
4949

5050

5151
.. function:: open_connection(host=None, port=None, *, \
52-
limit=None, ssl=None, family=0, proto=0, \
52+
limit=65536, ssl=None, family=0, proto=0, \
5353
flags=0, sock=None, local_addr=None, \
5454
server_hostname=None, ssl_handshake_timeout=None, \
5555
ssl_shutdown_timeout=None, \
@@ -89,7 +89,7 @@ and work with streams:
8989

9090

9191
.. function:: start_server(client_connected_cb, host=None, \
92-
port=None, *, limit=None, \
92+
port=None, *, limit=65536, \
9393
family=socket.AF_UNSPEC, \
9494
flags=socket.AI_PASSIVE, sock=None, \
9595
backlog=100, ssl=None, reuse_address=None, \
@@ -137,7 +137,7 @@ and work with streams:
137137

138138
.. rubric:: Unix Sockets
139139

140-
.. function:: open_unix_connection(path=None, *, limit=None, \
140+
.. function:: open_unix_connection(path=None, *, limit=65536, \
141141
ssl=None, sock=None, server_hostname=None, \
142142
ssl_handshake_timeout=None, ssl_shutdown_timeout=None)
143143
:async:
@@ -169,7 +169,7 @@ and work with streams:
169169

170170

171171
.. function:: start_unix_server(client_connected_cb, path=None, \
172-
*, limit=None, sock=None, backlog=100, ssl=None, \
172+
*, limit=65536, sock=None, backlog=100, ssl=None, \
173173
ssl_handshake_timeout=None, \
174174
ssl_shutdown_timeout=None, start_serving=True, cleanup_socket=True)
175175
:async:

Doc/library/asyncio-subprocess.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Creating Subprocesses
6262
=====================
6363

6464
.. function:: create_subprocess_exec(program, *args, stdin=None, \
65-
stdout=None, stderr=None, limit=None, **kwds)
65+
stdout=None, stderr=None, limit=65536, **kwds)
6666
:async:
6767
6868
Create a subprocess.
@@ -84,7 +84,7 @@ Creating Subprocesses
8484

8585

8686
.. function:: create_subprocess_shell(cmd, stdin=None, \
87-
stdout=None, stderr=None, limit=None, **kwds)
87+
stdout=None, stderr=None, limit=65536, **kwds)
8888
:async:
8989
9090
Run the *cmd* shell command.

Doc/library/asyncio-task.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -843,17 +843,13 @@ Timeouts
843843
Wait for the *aw* :ref:`awaitable <asyncio-awaitables>`
844844
to complete with a timeout.
845845

846-
If *aw* is a coroutine it is automatically scheduled as a Task.
847-
848846
*timeout* can either be ``None`` or a float or int number of seconds
849847
to wait for. If *timeout* is ``None``, block until the future
850848
completes.
851849

852-
If a timeout occurs, it cancels the task and raises
853-
:exc:`TimeoutError`.
850+
If a timeout occurs, it cancels *aw* and raises :exc:`TimeoutError`.
854851

855-
To avoid the task :meth:`cancellation <Task.cancel>`,
856-
wrap it in :func:`shield`.
852+
To prevent *aw* from being cancelled, wrap it in :func:`shield`.
857853

858854
The function will wait until the future is actually cancelled,
859855
so the total wait time may exceed the *timeout*. If an exception
@@ -894,6 +890,10 @@ Timeouts
894890
.. versionchanged:: 3.11
895891
Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`.
896892

893+
.. versionchanged:: 3.12
894+
Implemented using :func:`asyncio.timeout`, a coroutine passed as *aw*
895+
is no longer wrapped in a :class:`Task` when *timeout* is positive.
896+
897897

898898
Waiting primitives
899899
==================

Doc/library/csv.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ Dialects support the following attributes:
475475
On reading, the *escapechar* removes any special meaning from
476476
the following character. It defaults to :const:`None`, which disables escaping.
477477

478+
.. versionchanged:: 3.10
479+
Previously the *escapechar* itself was not escaped,
480+
which lost it on reading.
481+
478482
.. versionchanged:: 3.11
479483
An empty *escapechar* is not allowed.
480484

Doc/library/curses.rst

Lines changed: 81 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,24 @@ Linux and the BSD variants of Unix.
2727

2828
Whenever the documentation mentions a *character* it can be specified
2929
as an integer, a one-character Unicode string or a one-byte byte string.
30+
An integer is the code of a single encoded byte, optionally combined with
31+
attributes and a color pair, as returned by :meth:`window.inch`.
3032

3133
Whenever the documentation mentions a *character string* it can be specified
3234
as a Unicode string or a byte string.
3335

36+
.. note::
37+
38+
Whether curses may be used from several threads
39+
depends on the underlying library and how it was built.
40+
In many implementations, including the default build of ncurses,
41+
the screen state is shared and not thread-safe;
42+
since the blocking and refresh methods
43+
(such as :meth:`~window.getch` and :meth:`~window.refresh`)
44+
release the :term:`GIL`,
45+
unsynchronized use from several threads can then crash the interpreter.
46+
Serialize the calls.
47+
3448
.. seealso::
3549

3650
Module :mod:`curses.ascii`
@@ -490,8 +504,8 @@ The module :mod:`!curses` defines the following functions:
490504
.. function:: putp(str)
491505

492506
Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified
493-
terminfo capability for the current terminal. Note that the output of :func:`putp`
494-
always goes to standard output.
507+
terminfo capability, a bytes object, for the current terminal.
508+
Note that the output of :func:`putp` always goes to standard output.
495509

496510
:func:`setupterm` (or :func:`initscr`) must be called first.
497511

@@ -662,7 +676,7 @@ The module :mod:`!curses` defines the following functions:
662676
.. function:: tparm(str[, ...])
663677

664678
Instantiate the bytes object *str* with the supplied parameters, where *str* should
665-
be a parameterized string obtained from the terminfo database. For example,
679+
be a parameterized byte string obtained from the terminfo database. For example,
666680
``tparm(tigetstr("cup"), 5, 3)`` could result in ``b'\033[6;4H'``, the exact
667681
result depending on terminal type. Up to nine integer parameters may be supplied.
668682

@@ -683,7 +697,8 @@ The module :mod:`!curses` defines the following functions:
683697

684698
.. function:: unctrl(ch)
685699

686-
Return a bytes object which is a printable representation of the character *ch*.
700+
Return a bytes object which is a printable representation of the character *ch*;
701+
any attributes and color pair are ignored.
687702
Control characters are represented as a caret followed by the character, for
688703
example as ``b'^C'``. Printing characters are left as they are.
689704

@@ -692,6 +707,9 @@ The module :mod:`!curses` defines the following functions:
692707

693708
Push *ch* so the next :meth:`~window.getch` will return it.
694709

710+
*ch* may be an integer (a key code or the code of an encoded byte), a byte,
711+
or a string of length 1 which encodes to a single byte.
712+
695713
.. note::
696714

697715
Only one *ch* can be pushed before :meth:`!getch` is called.
@@ -709,6 +727,9 @@ The module :mod:`!curses` defines the following functions:
709727

710728
Push *ch* so the next :meth:`~window.get_wch` will return it.
711729

730+
*ch* may be an integer (a character code, not a key code) or a string of
731+
length 1.
732+
712733
.. note::
713734

714735
Only one *ch* can be pushed before :meth:`!get_wch` is called.
@@ -989,27 +1010,58 @@ Window objects
9891010

9901011
.. method:: window.getch([y, x])
9911012

992-
Get a character. Note that the integer returned does *not* have to be in ASCII
993-
range: function keys, keypad keys and so on are represented by numbers higher
994-
than 255. In no-delay mode, return ``-1`` if there is no input, otherwise
995-
wait until a key is pressed.
1013+
Read a key press, after moving the cursor to *y*, *x* if specified,
1014+
and return it as an integer.
1015+
The window is refreshed first if it is not a pad and was modified since
1016+
the last refresh.
1017+
Wait until a key is pressed, or return ``-1`` if the read is non-blocking
1018+
or times out (see :meth:`nodelay` and :meth:`timeout`).
1019+
1020+
An ordinary key is returned as the code of a single byte of its encoding
1021+
in the current locale,
1022+
so a character encoded with several bytes takes several calls.
1023+
For example, in a UTF-8 locale ``'é'`` is read as ``195``, then ``169``.
1024+
Use :meth:`get_wch` to read it as a single character.
1025+
1026+
In keypad mode (see :meth:`keypad`) function keys and other special keys
1027+
are returned as one of the :ref:`KEY_* constants <curses-key-constants>`,
1028+
which cannot be mistaken for an ordinary key.
1029+
Otherwise, or if their escape sequence does not arrive in time
1030+
(see :meth:`notimeout` and :func:`set_escdelay`),
1031+
their bytes are returned one at a time.
1032+
1033+
In echo mode (see :func:`echo`) the key is added to the window as by
1034+
:meth:`addch`; special keys are not echoed.
9961035

9971036

9981037
.. method:: window.get_wch([y, x])
9991038

1000-
Get a wide character. Return a character for most keys, or an integer for
1001-
function keys, keypad keys, and other special keys.
1002-
In no-delay mode, raise an exception if there is no input.
1039+
Read a key press, after moving the cursor to *y*, *x* if specified,
1040+
and return it as a one-character :class:`str`.
1041+
The window is refreshed first if it is not a pad and was modified since
1042+
the last refresh.
1043+
Wait until a key is pressed, or raise :exc:`error` if the read is
1044+
non-blocking or times out (see :meth:`nodelay` and :meth:`timeout`).
1045+
1046+
In keypad mode (see :meth:`keypad`) function keys and other special keys
1047+
are returned as one of the :ref:`KEY_* constants <curses-key-constants>`,
1048+
an integer.
1049+
Otherwise, or if their escape sequence does not arrive in time
1050+
(see :meth:`notimeout` and :func:`set_escdelay`),
1051+
their characters are returned one at a time.
1052+
1053+
In echo mode (see :func:`echo`) the key is added to the window as by
1054+
:meth:`addch`; special keys are not echoed.
10031055

10041056
.. versionadded:: 3.3
10051057

10061058

10071059
.. method:: window.getkey([y, x])
10081060

1009-
Get a character, returning a string instead of an integer, as :meth:`getch`
1010-
does. Function keys, keypad keys and other special keys return a multibyte
1011-
string containing the key name. In no-delay mode, raise an exception if
1012-
there is no input.
1061+
Read a key press as :meth:`getch` does, but return it as a :class:`str`:
1062+
an ordinary key as a one-character string, the byte decoded as Latin-1,
1063+
and a special key as its name, such as ``'KEY_UP'`` (see :func:`keyname`).
1064+
Raise :exc:`error` instead of returning ``-1`` if there is no input.
10131065

10141066

10151067
.. method:: window.getmaxyx()
@@ -1029,8 +1081,11 @@ Window objects
10291081
window.getstr(y, x)
10301082
window.getstr(y, x, n)
10311083

1032-
Read a bytes object from the user, with primitive line editing capacity.
1033-
At most *n* characters are read;
1084+
Read a line of input from the user, with primitive line editing capacity,
1085+
after moving the cursor to *y*, *x* if specified.
1086+
Return it as a bytes object, in the encoding of the current locale
1087+
and without the terminating newline.
1088+
At most *n* bytes are read;
10341089
*n* defaults to and cannot exceed 2047.
10351090

10361091
.. versionchanged:: 3.14
@@ -1132,12 +1187,11 @@ Window objects
11321187
.. method:: window.instr([n])
11331188
window.instr(y, x[, n])
11341189

1135-
Return a bytes object of characters, extracted from the window starting at the
1136-
current cursor position, or at *y*, *x* if specified, and stopping at the end
1137-
of the line. Attributes and color information are stripped
1138-
from the characters. If *n* is specified, :meth:`instr` returns a string
1139-
at most *n* characters long (exclusive of the trailing NUL).
1140-
The maximum value for *n* is 2047.
1190+
Read the text of the window from the current cursor position,
1191+
or from *y*, *x* if specified, to the end of the line,
1192+
and return it as a bytes object, in the encoding of the current locale.
1193+
Attributes and color pairs are stripped.
1194+
At most *n* bytes are read; *n* defaults to and cannot exceed 2047.
11411195

11421196
.. versionchanged:: 3.14
11431197
The maximum value for *n* was increased from 1023 to 2047.
@@ -1161,6 +1215,8 @@ Window objects
11611215
If *flag* is ``True``, escape sequences generated by some keys (keypad, function keys)
11621216
will be interpreted by :mod:`!curses`. If *flag* is ``False``, escape sequences will be
11631217
left as is in the input stream.
1218+
Keypad mode is disabled by default, but :func:`wrapper` enables it for the
1219+
main window.
11641220

11651221

11661222
.. method:: window.leaveok(flag)
@@ -1513,6 +1569,8 @@ by some methods.
15131569
| | color-pair field information |
15141570
+-------------------------+-------------------------------+
15151571

1572+
.. _curses-key-constants:
1573+
15161574
Keys are referred to by integer constants with names starting with ``KEY_``.
15171575
The exact keycaps available are system dependent.
15181576

Doc/library/os.path.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ the :mod:`glob` module.)
5959
Return a normalized absolutized version of the pathname *path*. On most
6060
platforms, this is equivalent to calling ``normpath(join(os.getcwd(), path))``.
6161

62+
On Windows the path is normalized by the operating system,
63+
therefore the result can differ from ``normpath(join(os.getcwd(), path))``.
64+
A drive-relative path is resolved against the current directory
65+
of the specified drive, and the drive letter is capitalized.
66+
Trailing dots and spaces are stripped.
67+
For example::
68+
69+
>>> os.path.abspath('c:spam')
70+
'C:\\Temp\\spam'
71+
>>> os.path.abspath('c:/temp/spam. . .')
72+
'c:\\temp\\spam'
73+
6274
.. seealso:: :func:`os.path.join` and :func:`os.path.normpath`.
6375

6476
.. versionchanged:: 3.6
@@ -435,6 +447,9 @@ the :mod:`glob` module.)
435447
links encountered in the path (if they are supported by the operating
436448
system). On Windows, this function will also resolve MS-DOS (also called 8.3)
437449
style names such as ``C:\\PROGRA~1`` to ``C:\\Program Files``.
450+
The returned path uses the case reported by the operating system,
451+
which can differ from the case of *path*,
452+
in particular the drive letter is capitalized.
438453

439454
By default, the path is evaluated up to the first component that does not
440455
exist, is a symlink loop, or whose evaluation raises :exc:`OSError`.

Doc/library/runpy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ The :mod:`!runpy` module provides two functions:
9797
:class:`~importlib.machinery.ModuleSpec` for alternatives.
9898

9999
.. versionchanged:: 3.15
100-
``__cached__`` is no longer set.
100+
The global variable ``__cached__`` is no longer set.
101101

102102
.. function:: run_path(path_name, init_globals=None, run_name=None)
103103

@@ -175,7 +175,7 @@ The :mod:`!runpy` module provides two functions:
175175
``__package__`` are deprecated.
176176

177177
.. versionchanged:: 3.15
178-
``__cached__`` is no longer set.
178+
The global variable ``__cached__`` is no longer set.
179179

180180
.. seealso::
181181

0 commit comments

Comments
 (0)