Skip to content

Commit 812c4a0

Browse files
committed
Merge branch '3.13' of https://github.com/python/cpython into 3.13
2 parents 7d0a012 + 7e7e88f commit 812c4a0

51 files changed

Lines changed: 471 additions & 216 deletions

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ jobs:
303303
# Keep 1.1.1w in our list despite it being upstream EOL and otherwise
304304
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
305305
# supported by important vendors such as AWS-LC.
306-
openssl_ver: [1.1.1w, 3.0.21, 3.4.6, 3.5.7, 3.6.3]
306+
openssl_ver: [1.1.1w, 3.0.22, 3.4.7, 3.5.8, 3.6.4]
307307
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
308308
env:
309309
OPENSSL_VER: ${{ matrix.openssl_ver }}
@@ -378,7 +378,7 @@ jobs:
378378
needs: build-context
379379
if: needs.build-context.outputs.run-ubuntu == 'true'
380380
env:
381-
OPENSSL_VER: 3.0.21
381+
OPENSSL_VER: 3.0.22
382382
PYTHONSTRICTEXTENSIONBUILD: 1
383383
steps:
384384
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -485,7 +485,7 @@ jobs:
485485
matrix:
486486
os: [ubuntu-24.04]
487487
env:
488-
OPENSSL_VER: 3.0.21
488+
OPENSSL_VER: 3.0.22
489489
PYTHONSTRICTEXTENSIONBUILD: 1
490490
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
491491
steps:

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
matrix:
2626
os: [ubuntu-24.04, ubuntu-24.04-arm]
2727
env:
28-
OPENSSL_VER: 3.0.21
28+
OPENSSL_VER: 3.0.22
2929
PYTHONSTRICTEXTENSIONBUILD: 1
3030
TERM: linux
3131
steps:

Android/android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def unpack_deps(host, prefix_dir, cache_dir):
221221
for name_ver in [
222222
"bzip2-1.0.8-3",
223223
"libffi-3.4.4-3",
224-
"openssl-3.0.21-0",
224+
"openssl-3.0.22-0",
225225
"sqlite-3.50.4-0",
226226
"xz-5.4.6-1"
227227
]:

Doc/conf.py

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

4040
# Skip if downstream redistributors haven't installed them
4141
_OPTIONAL_EXTENSIONS = (
42-
'linklint.ext',
42+
'sphinx_linklint.ext',
4343
'notfound.extension',
4444
'sphinxext.opengraph',
4545
)

Doc/glossary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ Glossary
470470
A piece of syntax which can be evaluated to some value. In other words,
471471
an expression is an accumulation of expression elements like literals,
472472
names, attribute access, operators or function calls which all return a
473-
value. In contrast to many other languages, not all language constructs
473+
value. Not all language constructs
474474
are expressions. There are also :term:`statement`\s which cannot be used
475475
as expressions, such as :keyword:`while`. Assignments are also statements,
476476
not expressions.

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/curses.rst

Lines changed: 70 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Linux and the BSD variants of Unix.
2828

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

3234
Whenever the documentation mentions a *character string* it can be specified
3335
as a Unicode string or a byte string.
@@ -484,8 +486,8 @@ The module :mod:`curses` defines the following functions:
484486
.. function:: putp(str)
485487

486488
Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified
487-
terminfo capability for the current terminal. Note that the output of :func:`putp`
488-
always goes to standard output.
489+
terminfo capability, a bytes object, for the current terminal.
490+
Note that the output of :func:`putp` always goes to standard output.
489491

490492
:func:`setupterm` (or :func:`initscr`) must be called first.
491493

@@ -656,7 +658,7 @@ The module :mod:`curses` defines the following functions:
656658
.. function:: tparm(str[, ...])
657659

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

@@ -677,7 +679,8 @@ The module :mod:`curses` defines the following functions:
677679

678680
.. function:: unctrl(ch)
679681

680-
Return a bytes object which is a printable representation of the character *ch*.
682+
Return a bytes object which is a printable representation of the character *ch*;
683+
any attributes and color pair are ignored.
681684
Control characters are represented as a caret followed by the character, for
682685
example as ``b'^C'``. Printing characters are left as they are.
683686

@@ -686,6 +689,9 @@ The module :mod:`curses` defines the following functions:
686689

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

692+
*ch* may be an integer (a key code or the code of an encoded byte), a byte,
693+
or a string of length 1 which encodes to a single byte.
694+
689695
.. note::
690696

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

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

712+
*ch* may be an integer (a character code, not a key code) or a string of
713+
length 1.
714+
706715
.. note::
707716

708717
Only one *ch* can be pushed before :meth:`!get_wch` is called.
@@ -988,27 +997,58 @@ Window objects
988997

989998
.. method:: window.getch([y, x])
990999

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

9961023

9971024
.. method:: window.get_wch([y, x])
9981025

999-
Get a wide character. Return a character for most keys, or an integer for
1000-
function keys, keypad keys, and other special keys.
1001-
In no-delay mode, raise an exception if there is no input.
1026+
Read a key press, after moving the cursor to *y*, *x* if specified,
1027+
and return it as a one-character :class:`str`.
1028+
The window is refreshed first if it is not a pad and was modified since
1029+
the last refresh.
1030+
Wait until a key is pressed, or raise :exc:`error` if the read is
1031+
non-blocking or times out (see :meth:`nodelay` and :meth:`timeout`).
1032+
1033+
In keypad mode (see :meth:`keypad`) function keys and other special keys
1034+
are returned as one of the :ref:`KEY_* constants <curses-key-constants>`,
1035+
an integer.
1036+
Otherwise, or if their escape sequence does not arrive in time
1037+
(see :meth:`notimeout` and :func:`set_escdelay`),
1038+
their characters are returned one at a time.
1039+
1040+
In echo mode (see :func:`echo`) the key is added to the window as by
1041+
:meth:`addch`; special keys are not echoed.
10021042

10031043
.. versionadded:: 3.3
10041044

10051045

10061046
.. method:: window.getkey([y, x])
10071047

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

10131053

10141054
.. method:: window.getmaxyx()
@@ -1028,9 +1068,12 @@ Window objects
10281068
window.getstr(y, x)
10291069
window.getstr(y, x, n)
10301070

1031-
Read a bytes object from the user, with primitive line editing capacity.
1032-
At most *n* characters are read (1023 by default).
1033-
The maximum value for *n* is 1023.
1071+
Read a line of input from the user, with primitive line editing capacity,
1072+
after moving the cursor to *y*, *x* if specified.
1073+
Return it as a bytes object, in the encoding of the current locale
1074+
and without the terminating newline.
1075+
At most *n* bytes are read;
1076+
*n* defaults to and cannot exceed 1023.
10341077

10351078

10361079
.. method:: window.getyx()
@@ -1128,11 +1171,11 @@ Window objects
11281171
.. method:: window.instr([n])
11291172
window.instr(y, x[, n])
11301173

1131-
Return a bytes object of characters, extracted from the window starting at the
1132-
current cursor position, or at *y*, *x* if specified, and stopping at the end
1133-
of the line. Attributes and color information are stripped
1134-
from the characters. If *n* is specified, :meth:`instr` returns a string
1135-
at most *n* characters long (exclusive of the trailing NUL).
1174+
Read the text of the window from the current cursor position,
1175+
or from *y*, *x* if specified, to the end of the line,
1176+
and return it as a bytes object, in the encoding of the current locale.
1177+
Attributes and color pairs are stripped.
1178+
At most *n* bytes are read; *n* defaults to and cannot exceed 1023.
11361179

11371180

11381181
.. method:: window.is_linetouched(line)
@@ -1153,6 +1196,8 @@ Window objects
11531196
If *flag* is ``True``, escape sequences generated by some keys (keypad, function keys)
11541197
will be interpreted by :mod:`curses`. If *flag* is ``False``, escape sequences will be
11551198
left as is in the input stream.
1199+
Keypad mode is disabled by default, but :func:`wrapper` enables it for the
1200+
main window.
11561201

11571202

11581203
.. method:: window.leaveok(flag)
@@ -1505,6 +1550,8 @@ by some methods.
15051550
| | color-pair field information |
15061551
+-------------------------+-------------------------------+
15071552

1553+
.. _curses-key-constants:
1554+
15081555
Keys are referred to by integer constants with names starting with ``KEY_``.
15091556
The exact keycaps available are system dependent.
15101557

Doc/library/difflib.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This module provides classes and functions for comparing sequences.
2121
Most of them compare sequences of text lines (for example lists of strings,
2222
or :term:`file objects <file object>`) and
2323
produce :dfn:`diffs` -- reports on the differences.
24-
Diffs can be produced in in various formats, including HTML and context
24+
Diffs can be produced in various formats, including HTML and context
2525
and unified diffs -- formats produced by tools like
2626
:manpage:`diff <diff(1)>` and :manpage:`git diff <git-diff(1)>`.
2727

@@ -56,7 +56,7 @@ By default, if the second input sequence is at least 200 items long, items
5656
that account for more than 1% it are considered *junk*.
5757

5858
Depending on your data, you should consider turning this heuristic off
59-
(setting :class:`~difflib.SequenceMatcher`'s *autojunk* argument to to ``False``)
59+
(setting :class:`~difflib.SequenceMatcher`'s *autojunk* argument to ``False``)
6060
or tuning it (using the *isjunk* argument, perhaps to one of the
6161
:ref:`predefined functions <difflib-isjunk-functions>`).
6262

Doc/library/tempfile.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ The module defines the following user-callable items:
321321

322322
#. A platform-specific location:
323323

324-
* On Windows, the directories :file:`C:\\TEMP`, :file:`C:\\TMP`,
325-
:file:`\\TEMP`, and :file:`\\TMP`, in that order.
324+
* On Windows, the directories
325+
:file:`%USERPROFILE%\\AppData\\Local\\Temp`,
326+
:file:`%SYSTEMROOT%\\Temp`, :file:`C:\\TEMP`,
327+
:file:`C:\\TMP`, :file:`\\TEMP`, and
328+
:file:`\\TMP`, in that order.
326329

327330
* On all other platforms, the directories :file:`/tmp`, :file:`/var/tmp`, and
328331
:file:`/usr/tmp`, in that order.

0 commit comments

Comments
 (0)