Skip to content

Commit ff79617

Browse files
Merge branch 'main' into gh-135552-fix-gc-segfault
2 parents 0e649ab + b57b619 commit ff79617

69 files changed

Lines changed: 1418 additions & 1025 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/CODEOWNERS

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ Python/flowgraph.c @markshannon @iritkatriel
4545
Python/instruction_sequence.c @iritkatriel
4646
Python/bytecodes.c @markshannon
4747
Python/optimizer*.c @markshannon
48-
Python/optimizer_analysis.c @Fidget-Spinner
49-
Python/optimizer_bytecodes.c @Fidget-Spinner
48+
Python/optimizer_analysis.c @Fidget-Spinner @tomasr8
49+
Python/optimizer_bytecodes.c @Fidget-Spinner @tomasr8
50+
Python/optimizer_symbols.c @tomasr8
5051
Python/symtable.c @JelleZijlstra @carljm
5152
Lib/_pyrepl/* @pablogsal @lysnikolaou @ambv
5253
Lib/test/test_patma.py @brandtbucher
@@ -188,13 +189,13 @@ Include/internal/pycore_time.h @pganssle @abalkin
188189
/Tools/cases_generator/ @markshannon
189190

190191
# AST
191-
Python/ast.c @isidentical @JelleZijlstra @eclips4
192-
Python/ast_preprocess.c @isidentical @eclips4
193-
Parser/asdl.py @isidentical @JelleZijlstra @eclips4
194-
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4
195-
Lib/ast.py @isidentical @JelleZijlstra @eclips4
196-
Lib/_ast_unparse.py @isidentical @JelleZijlstra @eclips4
197-
Lib/test/test_ast/ @eclips4
192+
Python/ast.c @isidentical @JelleZijlstra @eclips4 @tomasr8
193+
Python/ast_preprocess.c @isidentical @eclips4 @tomasr8
194+
Parser/asdl.py @isidentical @JelleZijlstra @eclips4 @tomasr8
195+
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4 @tomasr8
196+
Lib/ast.py @isidentical @JelleZijlstra @eclips4 @tomasr8
197+
Lib/_ast_unparse.py @isidentical @JelleZijlstra @eclips4 @tomasr8
198+
Lib/test/test_ast/ @eclips4 @tomasr8
198199

199200
# Mock
200201
/Lib/unittest/mock.py @cjw296
@@ -341,3 +342,6 @@ Modules/_xxtestfuzz/ @ammaraskar
341342
Python/remote_debug.h @pablogsal
342343
Python/remote_debugging.c @pablogsal
343344
Modules/_remote_debugging_module.c @pablogsal @ambv @1st1
345+
346+
# gettext
347+
**/*gettext* @tomasr8

Doc/c-api/exceptions.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,16 @@ Exception Classes
749749
.. versionadded:: 3.2
750750
751751
752+
.. c:function:: int PyExceptionClass_Check(PyObject *ob)
753+
754+
Return non-zero if *ob* is an exception class, zero otherwise. This function always succeeds.
755+
756+
757+
.. c:function:: const char *PyExceptionClass_Name(PyObject *ob)
758+
759+
Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*.
760+
761+
752762
Exception Objects
753763
=================
754764

Doc/c-api/extension-modules.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,6 @@ in the following ways:
242242
* Single-phase modules support module lookup functions like
243243
:c:func:`PyState_FindModule`.
244244

245-
.. [#testsinglephase] ``_testsinglephase`` is an internal module used \
246-
in CPython's self-test suite; your installation may or may not \
245+
.. [#testsinglephase] ``_testsinglephase`` is an internal module used
246+
in CPython's self-test suite; your installation may or may not
247247
include it.

Doc/howto/regex.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,9 @@ extension. This regular expression matches ``foo.bar`` and
10161016
Now, consider complicating the problem a bit; what if you want to match
10171017
filenames where the extension is not ``bat``? Some incorrect attempts:
10181018

1019-
``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by requiring
1019+
``.*[.][^b].*$``
1020+
1021+
The first attempt above tries to exclude ``bat`` by requiring
10201022
that the first character of the extension is not a ``b``. This is wrong,
10211023
because the pattern also doesn't match ``foo.bar``.
10221024

@@ -1043,7 +1045,9 @@ confusing.
10431045

10441046
A negative lookahead cuts through all this confusion:
10451047

1046-
``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression ``bat``
1048+
``.*[.](?!bat$)[^.]*$``
1049+
1050+
The negative lookahead means: if the expression ``bat``
10471051
doesn't match at this point, try the rest of the pattern; if ``bat$`` does
10481052
match, the whole pattern will fail. The trailing ``$`` is required to ensure
10491053
that something like ``sample.batch``, where the extension only starts with

Doc/library/dialog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ is the base class for dialogs defined in other supporting modules.
220220

221221
.. class:: Dialog(master=None, **options)
222222

223-
.. method:: show(color=None, **options)
223+
.. method:: show(**options)
224224

225225
Render the Dialog window.
226226

Doc/library/netrc.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ the Unix :program:`ftp` program and other FTP clients.
2424
a :exc:`FileNotFoundError` exception will be raised.
2525
Parse errors will raise :exc:`NetrcParseError` with diagnostic
2626
information including the file name, line number, and terminating token.
27+
2728
If no argument is specified on a POSIX system, the presence of passwords in
2829
the :file:`.netrc` file will raise a :exc:`NetrcParseError` if the file
2930
ownership or permissions are insecure (owned by a user other than the user
3031
running the process, or accessible for read or write by any other user).
3132
This implements security behavior equivalent to that of ftp and other
32-
programs that use :file:`.netrc`.
33+
programs that use :file:`.netrc`. Such security checks are not available
34+
on platforms that do not support :func:`os.getuid`.
3335

3436
.. versionchanged:: 3.4 Added the POSIX permission check.
3537

Doc/library/pkgutil.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ support.
6969

7070
Yield :term:`finder` objects for the given module name.
7171

72-
If fullname contains a ``'.'``, the finders will be for the package
73-
containing fullname, otherwise they will be all registered top level
72+
If *fullname* contains a ``'.'``, the finders will be for the package
73+
containing *fullname*, otherwise they will be all registered top level
7474
finders (i.e. those on both :data:`sys.meta_path` and :data:`sys.path_hooks`).
7575

7676
If the named module is in a package, that package is imported as a side

Doc/library/sys.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,15 @@ always available. Unless explicitly noted otherwise, all variables are read-only
11851185
``cache_tag`` is set to ``None``, it indicates that module caching should
11861186
be disabled.
11871187

1188+
*supports_isolated_interpreters* is a boolean value, whether
1189+
this implementation supports multiple isolated interpreters.
1190+
It is ``True`` for CPython on most platforms. Platforms with
1191+
this support implement the low-level :mod:`!_interpreters` module.
1192+
1193+
.. seealso::
1194+
1195+
:pep:`684`, :pep:`734`, and :mod:`concurrent.interpreters`.
1196+
11881197
:data:`sys.implementation` may contain additional attributes specific to
11891198
the Python implementation. These non-standard attributes must start with
11901199
an underscore, and are not described here. Regardless of its contents,
@@ -1194,6 +1203,9 @@ always available. Unless explicitly noted otherwise, all variables are read-only
11941203

11951204
.. versionadded:: 3.3
11961205

1206+
.. versionchanged:: 3.14
1207+
Added ``supports_isolated_interpreters`` field.
1208+
11971209
.. note::
11981210

11991211
The addition of new required attributes must go through the normal PEP
@@ -1933,12 +1945,21 @@ always available. Unless explicitly noted otherwise, all variables are read-only
19331945
interpreter is pre-release (alpha, beta, or release candidate) then the
19341946
local and remote interpreters must be the same exact version.
19351947

1936-
.. audit-event:: remote_debugger_script script_path
1948+
.. audit-event:: sys.remote_exec pid script_path
1949+
1950+
When the code is executed in the remote process, an
1951+
:ref:`auditing event <auditing>` ``sys.remote_exec`` is raised with
1952+
the *pid* and the path to the script file.
1953+
This event is raised in the process that called :func:`sys.remote_exec`.
1954+
1955+
.. audit-event:: cpython.remote_debugger_script script_path
19371956

19381957
When the script is executed in the remote process, an
19391958
:ref:`auditing event <auditing>`
1940-
``sys.remote_debugger_script`` is raised
1959+
``cpython.remote_debugger_script`` is raised
19411960
with the path in the remote process.
1961+
This event is raised in the remote process, not the one
1962+
that called :func:`sys.remote_exec`.
19421963

19431964
.. availability:: Unix, Windows.
19441965
.. versionadded:: 3.14

Doc/library/uuid.rst

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,43 +193,52 @@ The :mod:`uuid` module defines the following functions:
193193

194194
.. function:: uuid1(node=None, clock_seq=None)
195195

196-
Generate a UUID from a host ID, sequence number, and the current time. If *node*
197-
is not given, :func:`getnode` is used to obtain the hardware address. If
198-
*clock_seq* is given, it is used as the sequence number; otherwise a random
199-
14-bit sequence number is chosen.
196+
Generate a UUID from a host ID, sequence number, and the current time
197+
according to :rfc:`RFC 9562, §5.1 <9562#section-5.1>`.
198+
199+
When *node* is not specified, :func:`getnode` is used to obtain the hardware
200+
address as a 48-bit positive integer. When a sequence number *clock_seq* is
201+
not specified, a pseudo-random 14-bit positive integer is generated.
202+
203+
If *node* or *clock_seq* exceed their expected bit count,
204+
only their least significant bits are kept.
200205

201206

202207
.. function:: uuid3(namespace, name)
203208

204209
Generate a UUID based on the MD5 hash of a namespace identifier (which is a
205210
UUID) and a name (which is a :class:`bytes` object or a string
206-
that will be encoded using UTF-8).
211+
that will be encoded using UTF-8)
212+
according to :rfc:`RFC 9562, §5.3 <9562#section-5.3>`.
207213

208214

209215
.. function:: uuid4()
210216

211-
Generate a random UUID.
217+
Generate a random UUID in a cryptographically-secure method
218+
according to :rfc:`RFC 9562, §5.4 <9562#section-5.4>`.
212219

213220

214221
.. function:: uuid5(namespace, name)
215222

216223
Generate a UUID based on the SHA-1 hash of a namespace identifier (which is a
217224
UUID) and a name (which is a :class:`bytes` object or a string
218-
that will be encoded using UTF-8).
225+
that will be encoded using UTF-8)
226+
according to :rfc:`RFC 9562, §5.5 <9562#section-5.5>`.
219227

220228

221229
.. function:: uuid6(node=None, clock_seq=None)
222230

223231
Generate a UUID from a sequence number and the current time according to
224-
:rfc:`9562`.
232+
:rfc:`RFC 9562, §5.6 <9562#section-5.6>`.
233+
225234
This is an alternative to :func:`uuid1` to improve database locality.
226235

227236
When *node* is not specified, :func:`getnode` is used to obtain the hardware
228237
address as a 48-bit positive integer. When a sequence number *clock_seq* is
229238
not specified, a pseudo-random 14-bit positive integer is generated.
230239

231-
If *node* or *clock_seq* exceed their expected bit count, only their least
232-
significant bits are kept.
240+
If *node* or *clock_seq* exceed their expected bit count,
241+
only their least significant bits are kept.
233242

234243
.. versionadded:: 3.14
235244

Doc/library/zoneinfo.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ The ``ZoneInfo`` class
195195

196196
The ``ZoneInfo`` class has two alternate constructors:
197197

198-
.. classmethod:: ZoneInfo.from_file(fobj, /, key=None)
198+
.. classmethod:: ZoneInfo.from_file(file_obj, /, key=None)
199199

200200
Constructs a ``ZoneInfo`` object from a file-like object returning bytes
201201
(e.g. a file opened in binary mode or an :class:`io.BytesIO` object).
@@ -325,7 +325,7 @@ The behavior of a ``ZoneInfo`` file depends on how it was constructed:
325325
>>> a is b
326326
False
327327
328-
3. ``ZoneInfo.from_file(fobj, /, key=None)``: When constructed from a file, the
328+
3. ``ZoneInfo.from_file(file_obj, /, key=None)``: When constructed from a file, the
329329
``ZoneInfo`` object raises an exception on pickling. If an end user wants to
330330
pickle a ``ZoneInfo`` constructed from a file, it is recommended that they
331331
use a wrapper type or a custom serialization function: either serializing by

0 commit comments

Comments
 (0)