Skip to content

Commit 2f08540

Browse files
authored
Merge branch 'main' into gh-150771-fix-email-shift-jis-euc-jp
2 parents 6795f58 + ce916dc commit 2f08540

74 files changed

Lines changed: 941 additions & 351 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.

.github/workflows/build.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,13 @@ jobs:
278278
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
279279
# supported by important vendors such as AWS-LC.
280280
- { name: openssl, version: 1.1.1w }
281-
- { name: openssl, version: 3.0.20 }
282-
- { name: openssl, version: 3.3.7 }
283-
- { name: openssl, version: 3.4.5 }
284-
- { name: openssl, version: 3.5.6 }
285-
- { name: openssl, version: 3.6.2 }
286-
- { name: openssl, version: 4.0.0 }
281+
- { name: openssl, version: 3.0.21 }
282+
- { name: openssl, version: 3.4.6 }
283+
- { name: openssl, version: 3.5.7 }
284+
- { name: openssl, version: 3.6.3 }
285+
- { name: openssl, version: 4.0.1 }
287286
## AWS-LC
288-
- { name: aws-lc, version: 1.72.1 }
287+
- { name: aws-lc, version: 5.0.0 }
289288
env:
290289
SSLLIB_VER: ${{ matrix.ssllib.version }}
291290
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -399,7 +398,7 @@ jobs:
399398
needs: build-context
400399
if: needs.build-context.outputs.run-ubuntu == 'true'
401400
env:
402-
OPENSSL_VER: 3.5.6
401+
OPENSSL_VER: 3.5.7
403402
PYTHONSTRICTEXTENSIONBUILD: 1
404403
steps:
405404
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -507,7 +506,7 @@ jobs:
507506
matrix:
508507
os: [ubuntu-24.04]
509508
env:
510-
OPENSSL_VER: 3.5.6
509+
OPENSSL_VER: 3.5.7
511510
PYTHONSTRICTEXTENSIONBUILD: 1
512511
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
513512
steps:

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ${{ inputs.os }}
3636
timeout-minutes: 60
3737
env:
38-
OPENSSL_VER: 3.5.6
38+
OPENSSL_VER: 3.5.7
3939
PYTHONSTRICTEXTENSIONBUILD: 1
4040
TERM: linux
4141
steps:

Doc/library/argparse.rst

Lines changed: 19 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.
@@ -1052,6 +1051,10 @@ is used when no command-line argument was present::
10521051
>>> parser.parse_args([])
10531052
Namespace(foo=42)
10541053

1054+
Because ``nargs='*'`` gathers any supplied values into a list, an absent
1055+
positional argument yields an empty list (``[]``). Only a non-``None``
1056+
*default* overrides this (so ``default=None`` still gives ``[]``).
1057+
10551058
For required_ arguments, the ``default`` value is ignored. For example, this
10561059
applies to positional arguments with nargs_ values other than ``?`` or ``*``,
10571060
or optional arguments marked as ``required=True``.
@@ -1369,6 +1372,11 @@ behavior::
13691372
>>> parser.parse_args('--foo XXX'.split())
13701373
Namespace(bar='XXX')
13711374

1375+
Multiple arguments may share the same ``dest``. By default, the value from the
1376+
last such argument given on the command line wins. Use ``action='append'`` to
1377+
collect values from all of them into a list instead. For conflicting *option
1378+
strings* rather than ``dest`` names, see conflict_handler_.
1379+
13721380
.. versionchanged:: 3.15
13731381
Single-dash long option now takes precedence over short options.
13741382

@@ -1777,6 +1785,11 @@ Subcommands
17771785
present, and when the ``b`` command is specified, only the ``foo`` and
17781786
``baz`` attributes are present.
17791787

1788+
If a subparser defines an argument with the same ``dest`` as the parent
1789+
parser, the two share a single namespace attribute, so the parent's value
1790+
won't be retained. Users should give them distinct ``dest`` values to
1791+
keep both.
1792+
17801793
Similarly, when a help message is requested from a subparser, only the help
17811794
for that particular parser will be printed. The help message will not
17821795
include parent parser or sibling parser messages. (A help message for each
@@ -2232,6 +2245,9 @@ Customizing file parsing
22322245
def convert_arg_line_to_args(self, arg_line):
22332246
return arg_line.split()
22342247

2248+
Note that with this override an argument can no longer contain spaces, since
2249+
each space-separated word becomes a separate argument.
2250+
22352251

22362252
Exiting methods
22372253
^^^^^^^^^^^^^^^

Doc/library/getpass.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The :mod:`!getpass` module provides two functions:
1818
the string *prompt*, which defaults to ``'Password: '``. On Unix, the
1919
prompt is written to the file-like object *stream* using the replace error
2020
handler if needed. *stream* defaults to the controlling terminal
21-
(:file:`/dev/tty`) or if that is unavailable to ``sys.stderr`` (this
21+
(:file:`/dev/tty`) or if that is unavailable to :data:`sys.stderr` (this
2222
argument is ignored on Windows).
2323

2424
The *echo_char* argument controls how user input is displayed while typing.
@@ -27,12 +27,12 @@ The :mod:`!getpass` module provides two functions:
2727
typed character is replaced by it. For example, ``echo_char='*'`` will
2828
display asterisks instead of the actual input.
2929

30-
If echo free input is unavailable getpass() falls back to printing
31-
a warning message to *stream* and reading from ``sys.stdin`` and
30+
If echo-free input is unavailable, :func:`getpass` falls back to printing
31+
a warning message to *stream* and reading from :data:`sys.stdin` and
3232
issuing a :exc:`GetPassWarning`.
3333

3434
.. note::
35-
If you call getpass from within IDLE, the input may be done in the
35+
If you call :func:`getpass` from within IDLE, the input may be done in the
3636
terminal you launched IDLE from rather than the idle window itself.
3737

3838
.. note::

Doc/library/ssl.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ purposes.
146146
*cadata* is given) or uses :meth:`SSLContext.load_default_certs` to load
147147
default CA certificates.
148148

149-
When :attr:`~SSLContext.keylog_filename` is supported and the environment
150-
variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context`
151-
enables key logging.
149+
When the environment variable :envvar:`!SSLKEYLOGFILE` is set,
150+
:func:`create_default_context` enables key logging by setting
151+
:attr:`~SSLContext.keylog_filename` to the variable's value.
152152

153153
The default settings for this context include
154154
:data:`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`.

Doc/tools/extensions/profiling_trace.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,15 @@ def inject_trace(app, exception):
154154
)
155155

156156

157+
def add_assets(app, pagename, templatename, context, doctree):
158+
if pagename == 'library/profiling.sampling':
159+
app.add_js_file('profiling-sampling-visualization.js')
160+
app.add_css_file('profiling-sampling-visualization.css')
161+
162+
157163
def setup(app):
158164
app.connect('build-finished', inject_trace)
159-
app.add_js_file('profiling-sampling-visualization.js')
160-
app.add_css_file('profiling-sampling-visualization.css')
165+
app.connect('html-page-context', add_assets)
161166

162167
return {
163168
'version': '1.0',

Lib/asyncio/base_events.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,10 @@ def set_task_factory(self, factory):
488488
If factory is None the default task factory will be set.
489489
490490
If factory is a callable, it should have a signature matching
491-
'(loop, coro, **kwargs)', where 'loop' will be a reference to the active
492-
event loop, 'coro' will be a coroutine object, and **kwargs will be
493-
arbitrary keyword arguments that should be passed on to Task.
494-
The callable must return a Task.
491+
'(loop, coro, **kwargs)', where 'loop' will be a reference to the
492+
active event loop, 'coro' will be a coroutine object, and **kwargs
493+
will be arbitrary keyword arguments that should be passed on to
494+
Task. The callable must return a Task.
495495
"""
496496
if factory is not None and not callable(factory):
497497
raise TypeError('task factory must be a callable or None')
@@ -727,8 +727,8 @@ def run_until_complete(self, future):
727727
def stop(self):
728728
"""Stop running the event loop.
729729
730-
Every callback already scheduled will still run. This simply informs
731-
run_forever to stop looping after a complete iteration.
730+
Every callback already scheduled will still run. This simply
731+
informs run_forever to stop looping after a complete iteration.
732732
"""
733733
self._stopping = True
734734

@@ -1076,12 +1076,12 @@ async def create_connection(
10761076
10771077
Create a streaming transport connection to a given internet host and
10781078
port: socket family AF_INET or socket.AF_INET6 depending on host (or
1079-
family if specified), socket type SOCK_STREAM. protocol_factory must be
1080-
a callable returning a protocol instance.
1079+
family if specified), socket type SOCK_STREAM. protocol_factory must
1080+
be a callable returning a protocol instance.
10811081
1082-
This method is a coroutine which will try to establish the connection
1083-
in the background. When successful, the coroutine returns a
1084-
(transport, protocol) pair.
1082+
This method is a coroutine which will try to establish the
1083+
connection in the background. When successful, the coroutine
1084+
returns a (transport, protocol) pair.
10851085
"""
10861086
if server_hostname is not None and not ssl:
10871087
raise ValueError('server_hostname is only meaningful with ssl')
@@ -1550,11 +1550,11 @@ async def create_server(
15501550
The host parameter can be a string, in that case the TCP server is
15511551
bound to host and port.
15521552
1553-
The host parameter can also be a sequence of strings and in that case
1554-
the TCP server is bound to all hosts of the sequence. If a host
1555-
appears multiple times (possibly indirectly e.g. when hostnames
1556-
resolve to the same IP address), the server is only bound once to that
1557-
host.
1553+
The host parameter can also be a sequence of strings and in that
1554+
case the TCP server is bound to all hosts of the sequence. If
1555+
a host appears multiple times (possibly indirectly e.g. when
1556+
hostnames resolve to the same IP address), the server is only bound
1557+
once to that host.
15581558
15591559
Return a Server object which can be used to stop the service.
15601560

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()

Lib/asyncio/locks.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ def _wake_up_first(self):
155155
class Event(mixins._LoopBoundMixin):
156156
"""Asynchronous equivalent to threading.Event.
157157
158-
Class implementing event objects. An event manages a flag that can be set
159-
to true with the set() method and reset to false with the clear() method.
160-
The wait() method blocks until the flag is true. The flag is initially
161-
false.
158+
Class implementing event objects. An event manages a flag that can be
159+
set to true with the set() method and reset to false with the clear()
160+
method. The wait() method blocks until the flag is true. The flag is
161+
initially false.
162162
"""
163163

164164
def __init__(self):
@@ -350,9 +350,9 @@ class Semaphore(_ContextManagerMixin, mixins._LoopBoundMixin):
350350
"""A Semaphore implementation.
351351
352352
A semaphore manages an internal counter which is decremented by each
353-
acquire() call and incremented by each release() call. The counter
354-
can never go below zero; when acquire() finds that it is zero, it blocks,
355-
waiting until some other thread calls release().
353+
acquire() call and incremented by each release() call. The counter
354+
can never go below zero; when acquire() finds that it is zero, it
355+
blocks, waiting until some other thread calls release().
356356
357357
Semaphores also support the context management protocol.
358358
@@ -508,8 +508,8 @@ async def __aexit__(self, *args):
508508
async def wait(self):
509509
"""Wait for the barrier.
510510
511-
When the specified number of tasks have started waiting, they are all
512-
simultaneously awoken.
511+
When the specified number of tasks have started waiting, they are
512+
all simultaneously awoken.
513513
Returns an unique and individual index number from 0 to 'parties-1'.
514514
"""
515515
async with self._cond:

0 commit comments

Comments
 (0)