Skip to content

Commit 3e54da6

Browse files
Merge branch '3.14' into backport-5915a1f-3.14
2 parents 8db671a + 24cb16e commit 3e54da6

41 files changed

Lines changed: 300 additions & 233 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: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,10 @@ jobs:
305305
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
306306
# supported by important vendors such as AWS-LC.
307307
- { name: openssl, version: 1.1.1w }
308-
- { name: openssl, version: 3.0.20 }
309-
- { name: openssl, version: 3.3.7 }
310-
- { name: openssl, version: 3.4.5 }
311-
- { name: openssl, version: 3.5.6 }
312-
- { name: openssl, version: 3.6.2 }
308+
- { name: openssl, version: 3.0.21 }
309+
- { name: openssl, version: 3.4.6 }
310+
- { name: openssl, version: 3.5.7 }
311+
- { name: openssl, version: 3.6.3 }
313312
env:
314313
SSLLIB_VER: ${{ matrix.ssllib.version }}
315314
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -423,7 +422,7 @@ jobs:
423422
needs: build-context
424423
if: needs.build-context.outputs.run-ubuntu == 'true'
425424
env:
426-
OPENSSL_VER: 3.5.6
425+
OPENSSL_VER: 3.5.7
427426
PYTHONSTRICTEXTENSIONBUILD: 1
428427
steps:
429428
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -531,7 +530,7 @@ jobs:
531530
matrix:
532531
os: [ubuntu-24.04]
533532
env:
534-
OPENSSL_VER: 3.5.6
533+
OPENSSL_VER: 3.5.7
535534
PYTHONSTRICTEXTENSIONBUILD: 1
536535
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
537536
steps:

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ${{ inputs.os }}
3131
timeout-minutes: 60
3232
env:
33-
OPENSSL_VER: 3.5.6
33+
OPENSSL_VER: 3.5.7
3434
PYTHONSTRICTEXTENSIONBUILD: 1
3535
TERM: linux
3636
steps:

Android/android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def unpack_deps(host, prefix_dir, cache_dir):
216216
for name_ver in [
217217
"bzip2-1.0.8-3",
218218
"libffi-3.4.4-3",
219-
"openssl-3.5.6-0",
219+
"openssl-3.5.7-0",
220220
"sqlite-3.50.4-0",
221221
"xz-5.4.6-1",
222222
"zstd-1.5.7-2"

Apple/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def unpack_deps(
319319
for name_ver in [
320320
"BZip2-1.0.8-2",
321321
"libFFI-3.4.7-2",
322-
"OpenSSL-3.5.6-1",
322+
"OpenSSL-3.5.7-1",
323323
"XZ-5.6.4-2",
324324
"mpdecimal-4.0.0-2",
325325
"zstd-1.5.7-1",

Doc/library/argparse.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,8 @@ is considered equivalent to the expression ``['-f', 'foo', '-f', 'bar']``.
442442

443443
.. note::
444444

445-
Empty lines are treated as empty strings (``''``), which are allowed as values but
446-
not as arguments. Empty lines that are read as arguments will result in an
447-
"unrecognized arguments" error.
445+
Each line is treated as a single argument, so an empty line is read as an
446+
empty string (``''``).
448447

449448
:class:`ArgumentParser` uses :term:`filesystem encoding and error handler`
450449
to read the file containing arguments.
@@ -1048,6 +1047,10 @@ is used when no command-line argument was present::
10481047
>>> parser.parse_args([])
10491048
Namespace(foo=42)
10501049

1050+
Because ``nargs='*'`` gathers any supplied values into a list, an absent
1051+
positional argument yields an empty list (``[]``). Only a non-``None``
1052+
*default* overrides this (so ``default=None`` still gives ``[]``).
1053+
10511054
For required_ arguments, the ``default`` value is ignored. For example, this
10521055
applies to positional arguments with nargs_ values other than ``?`` or ``*``,
10531056
or optional arguments marked as ``required=True``.
@@ -1360,6 +1363,10 @@ behavior::
13601363
>>> parser.parse_args('--foo XXX'.split())
13611364
Namespace(bar='XXX')
13621365

1366+
Multiple arguments may share the same ``dest``. By default, the value from the
1367+
last such argument given on the command line wins. Use ``action='append'`` to
1368+
collect values from all of them into a list instead. For conflicting *option
1369+
strings* rather than ``dest`` names, see conflict_handler_.
13631370

13641371
.. _deprecated:
13651372

@@ -1755,6 +1762,11 @@ Subcommands
17551762
present, and when the ``b`` command is specified, only the ``foo`` and
17561763
``baz`` attributes are present.
17571764

1765+
If a subparser defines an argument with the same ``dest`` as the parent
1766+
parser, the two share a single namespace attribute, so the parent's value
1767+
won't be retained. Users should give them distinct ``dest`` values to
1768+
keep both.
1769+
17581770
Similarly, when a help message is requested from a subparser, only the help
17591771
for that particular parser will be printed. The help message will not
17601772
include parent parser or sibling parser messages. (A help message for each
@@ -2199,6 +2211,9 @@ Customizing file parsing
21992211
def convert_arg_line_to_args(self, arg_line):
22002212
return arg_line.split()
22012213

2214+
Note that with this override an argument can no longer contain spaces, since
2215+
each space-separated word becomes a separate argument.
2216+
22022217

22032218
Exiting methods
22042219
^^^^^^^^^^^^^^^

Include/internal/pycore_pyhash.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ _Py_HashPointerRaw(const void *ptr)
2727
* pppppppp ssssssss ........ fnv -- two Py_hash_t
2828
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t
2929
* ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t
30-
* ........ ........ eeeeeeee pyexpat XML hash salt
30+
* eeeeeeee eeeeeeee eeeeeeee pyexpat XML hash salt
3131
*
3232
* memory layout on 32 bit systems
3333
* cccccccc cccccccc cccccccc uc
3434
* ppppssss ........ ........ fnv -- two Py_hash_t
3535
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*)
3636
* ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t
37-
* ........ ........ eeee.... pyexpat XML hash salt
37+
* eeeeeeee eeeeeeee eeee.... pyexpat XML hash salt
3838
*
3939
* (*) The siphash member may not be available on 32 bit platforms without
4040
* an unsigned int64 data type.
@@ -58,7 +58,9 @@ typedef union {
5858
Py_hash_t suffix;
5959
} djbx33a;
6060
struct {
61-
unsigned char padding[16];
61+
/* 16 bytes for XML_SetHashSalt16Bytes */
62+
uint8_t hashsalt16[16];
63+
/* 4/8 bytes for legacy XML_SetHashSalt */
6264
Py_hash_t hashsalt;
6365
} expat;
6466
} _Py_HashSecret_t;

Include/pyexpat.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ struct PyExpat_CAPI
6262
XML_Parser parser, unsigned long long activationThresholdBytes);
6363
XML_Bool (*SetBillionLaughsAttackProtectionMaximumAmplification)(
6464
XML_Parser parser, float maxAmplificationFactor);
65+
/* might be NULL for expat < 2.8.0 */
66+
XML_Bool (*SetHashSalt16Bytes)(
67+
XML_Parser parser, const uint8_t entropy[16]);
6568
/* always add new stuff to the end! */
6669
};
6770

Lib/asyncio/base_events.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,10 @@ def set_task_factory(self, factory):
483483
If factory is None the default task factory will be set.
484484
485485
If factory is a callable, it should have a signature matching
486-
'(loop, coro, **kwargs)', where 'loop' will be a reference to the active
487-
event loop, 'coro' will be a coroutine object, and **kwargs will be
488-
arbitrary keyword arguments that should be passed on to Task.
489-
The callable must return a Task.
486+
'(loop, coro, **kwargs)', where 'loop' will be a reference to the
487+
active event loop, 'coro' will be a coroutine object, and **kwargs
488+
will be arbitrary keyword arguments that should be passed on to
489+
Task. The callable must return a Task.
490490
"""
491491
if factory is not None and not callable(factory):
492492
raise TypeError('task factory must be a callable or None')
@@ -721,8 +721,8 @@ def run_until_complete(self, future):
721721
def stop(self):
722722
"""Stop running the event loop.
723723
724-
Every callback already scheduled will still run. This simply informs
725-
run_forever to stop looping after a complete iteration.
724+
Every callback already scheduled will still run. This simply
725+
informs run_forever to stop looping after a complete iteration.
726726
"""
727727
self._stopping = True
728728

@@ -1070,12 +1070,12 @@ async def create_connection(
10701070
10711071
Create a streaming transport connection to a given internet host and
10721072
port: socket family AF_INET or socket.AF_INET6 depending on host (or
1073-
family if specified), socket type SOCK_STREAM. protocol_factory must be
1074-
a callable returning a protocol instance.
1073+
family if specified), socket type SOCK_STREAM. protocol_factory must
1074+
be a callable returning a protocol instance.
10751075
1076-
This method is a coroutine which will try to establish the connection
1077-
in the background. When successful, the coroutine returns a
1078-
(transport, protocol) pair.
1076+
This method is a coroutine which will try to establish the
1077+
connection in the background. When successful, the coroutine
1078+
returns a (transport, protocol) pair.
10791079
"""
10801080
if server_hostname is not None and not ssl:
10811081
raise ValueError('server_hostname is only meaningful with ssl')
@@ -1542,11 +1542,11 @@ async def create_server(
15421542
The host parameter can be a string, in that case the TCP server is
15431543
bound to host and port.
15441544
1545-
The host parameter can also be a sequence of strings and in that case
1546-
the TCP server is bound to all hosts of the sequence. If a host
1547-
appears multiple times (possibly indirectly e.g. when hostnames
1548-
resolve to the same IP address), the server is only bound once to that
1549-
host.
1545+
The host parameter can also be a sequence of strings and in that
1546+
case the TCP server is bound to all hosts of the sequence. If
1547+
a host appears multiple times (possibly indirectly e.g. when
1548+
hostnames resolve to the same IP address), the server is only bound
1549+
once to that host.
15501550
15511551
Return a Server object which can be used to stop the service.
15521552

Lib/asyncio/events.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ async def create_server(
374374
375375
If host is an empty string or None all interfaces are assumed
376376
and a list of multiple sockets will be returned (most likely
377-
one for IPv4 and another one for IPv6). The host parameter can also be
378-
a sequence (e.g. list) of hosts to bind to.
377+
one for IPv4 and another one for IPv6). The host parameter can also
378+
be a sequence (e.g. list) of hosts to bind to.
379379
380380
family can be set to either AF_INET or AF_INET6 to force the
381381
socket to use IPv4 or IPv6. If not set it will be determined
@@ -415,8 +415,9 @@ async def create_server(
415415
416416
start_serving set to True (default) causes the created server
417417
to start accepting connections immediately. When set to False,
418-
the user should await Server.start_serving() or Server.serve_forever()
419-
to make the server to start accepting connections.
418+
the user should await Server.start_serving() or
419+
Server.serve_forever() to make the server to start accepting
420+
connections.
420421
"""
421422
raise NotImplementedError
422423

@@ -479,8 +480,9 @@ async def create_unix_server(
479480
480481
start_serving set to True (default) causes the created server
481482
to start accepting connections immediately. When set to False,
482-
the user should await Server.start_serving() or Server.serve_forever()
483-
to make the server to start accepting connections.
483+
the user should await Server.start_serving() or
484+
Server.serve_forever() to make the server to start accepting
485+
connections.
484486
"""
485487
raise NotImplementedError
486488

@@ -511,8 +513,8 @@ async def create_datagram_endpoint(self, protocol_factory,
511513
512514
protocol_factory must be a callable returning a protocol instance.
513515
514-
socket family AF_INET, socket.AF_INET6 or socket.AF_UNIX depending on
515-
host (or family if specified), socket type SOCK_DGRAM.
516+
socket family AF_INET, socket.AF_INET6 or socket.AF_UNIX depending
517+
on host (or family if specified), socket type SOCK_DGRAM.
516518
517519
reuse_address tells the kernel to reuse a local socket in
518520
TIME_WAIT state, without waiting for its natural timeout to
@@ -552,7 +554,8 @@ async def connect_read_pipe(self, protocol_factory, pipe):
552554
async def connect_write_pipe(self, protocol_factory, pipe):
553555
"""Register write pipe in event loop.
554556
555-
protocol_factory should instantiate object with BaseProtocol interface.
557+
protocol_factory should instantiate object with BaseProtocol
558+
interface.
556559
Pipe is file-like object already switched to nonblocking.
557560
Return pair (transport, protocol), where transport support
558561
WriteTransport interface."""

Lib/asyncio/graph.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@ def capture_call_graph(
112112
optional keyword-only 'depth' argument can be used to skip the specified
113113
number of frames from top of the stack.
114114
115-
If the optional keyword-only 'limit' argument is provided, each call stack
116-
in the resulting graph is truncated to include at most ``abs(limit)``
117-
entries. If 'limit' is positive, the entries left are the closest to
118-
the invocation point. If 'limit' is negative, the topmost entries are
119-
left. If 'limit' is omitted or None, all entries are present.
120-
If 'limit' is 0, the call stack is not captured at all, only
121-
"awaited by" information is present.
115+
If the optional keyword-only 'limit' argument is provided, each call
116+
stack in the resulting graph is truncated to include at most
117+
``abs(limit)`` entries. If 'limit' is positive, the entries left are
118+
the closest to the invocation point. If 'limit' is negative, the
119+
topmost entries are left. If 'limit' is omitted or None, all entries
120+
are present. If 'limit' is 0, the call stack is not captured at all,
121+
only "awaited by" information is present.
122122
"""
123123

124124
loop = events._get_running_loop()

0 commit comments

Comments
 (0)