Skip to content

Commit 5151819

Browse files
authored
Merge branch 'main' into gh-138514-fix-getpass-echo-char
2 parents b063e33 + 766e7f1 commit 5151819

File tree

113 files changed

+4278
-1073
lines changed

Some content is hidden

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

113 files changed

+4278
-1073
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,4 @@ Python/stdlib_module_names.h generated
103103
Tools/peg_generator/pegen/grammar_parser.py generated
104104
aclocal.m4 generated
105105
configure generated
106+
*.min.js generated

.github/CODEOWNERS

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ Tools/patchcheck/ @AA-Turner
8080
# ----------------------------------------------------------------------------
8181

8282
# Autotools
83-
configure* @erlend-aasland @corona10 @AA-Turner
84-
Makefile.pre.in @erlend-aasland @AA-Turner
85-
Modules/Setup* @erlend-aasland @AA-Turner
83+
configure* @erlend-aasland @corona10 @AA-Turner @emmatyping
84+
Makefile.pre.in @erlend-aasland @AA-Turner @emmatyping
85+
Modules/Setup* @erlend-aasland @AA-Turner @emmatyping
86+
Modules/makesetup @emmatyping
8687
Tools/build/regen-configure.sh @AA-Turner
8788

8889

@@ -157,16 +158,16 @@ Lib/_osx_support.py @python/macos-team
157158
Lib/test/test__osx_support.py @python/macos-team
158159

159160
# WebAssembly
160-
Tools/wasm/README.md @brettcannon @freakboy3742
161+
Tools/wasm/README.md @brettcannon @freakboy3742 @emmatyping
161162

162163
# WebAssembly (Emscripten)
163-
Tools/wasm/config.site-wasm32-emscripten @freakboy3742
164-
Tools/wasm/emscripten @freakboy3742
164+
Tools/wasm/config.site-wasm32-emscripten @freakboy3742 @emmatyping
165+
Tools/wasm/emscripten @freakboy3742 @emmatyping
165166

166167
# WebAssembly (WASI)
167-
Tools/wasm/wasi-env @brettcannon
168-
Tools/wasm/wasi.py @brettcannon
169-
Tools/wasm/wasi @brettcannon
168+
Tools/wasm/wasi-env @brettcannon @emmatyping
169+
Tools/wasm/wasi.py @brettcannon @emmatyping
170+
Tools/wasm/wasi @brettcannon @emmatyping
170171

171172
# Windows
172173
PC/ @python/windows-team
@@ -603,9 +604,9 @@ Lib/test/test_zipfile/_path/ @jaraco
603604
Lib/zipfile/_path/ @jaraco
604605

605606
# Zstandard
606-
Lib/compression/zstd/ @AA-Turner
607-
Lib/test/test_zstd.py @AA-Turner
608-
Modules/_zstd/ @AA-Turner
607+
Lib/compression/zstd/ @AA-Turner @emmatyping
608+
Lib/test/test_zstd.py @AA-Turner @emmatyping
609+
Modules/_zstd/ @AA-Turner @emmatyping
609610

610611
# ----------------------------------------------------------------------------
611612

Android/android.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,10 @@ def ci(context):
737737
# Prove the package is self-contained by using it to run the tests.
738738
shutil.unpack_archive(package_path, temp_dir)
739739

740-
# Arguments are similar to --fast-ci, but in single-process mode.
740+
# Randomization is disabled because order-dependent failures are
741+
# much less likely to pass on a rerun in single-process mode.
741742
launcher_args = ["--managed", "maxVersion", "-v"]
742-
test_args = [
743-
"--single-process", "--fail-env-changed", "--rerun", "--slowest",
744-
"--verbose3", "-u", "all,-cpu", "--timeout=600"
745-
]
743+
test_args = ["--fast-ci", "--single-process", "--no-randomize"]
746744
run(
747745
["./android.py", "test", *launcher_args, "--", *test_args],
748746
cwd=temp_dir

Doc/c-api/init.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,12 @@ code, or when embedding the Python interpreter:
10201020
interpreter lock is also shared by all threads, regardless of to which
10211021
interpreter they belong.
10221022
1023+
.. versionchanged:: 3.12
1024+
1025+
:pep:`684` introduced the possibility
1026+
of a :ref:`per-interpreter GIL <per-interpreter-gil>`.
1027+
See :c:func:`Py_NewInterpreterFromConfig`.
1028+
10231029
10241030
.. c:type:: PyThreadState
10251031
@@ -1711,6 +1717,8 @@ function. You can create and destroy them using the following functions:
17111717
haven't been explicitly destroyed at that point.
17121718
17131719
1720+
.. _per-interpreter-gil:
1721+
17141722
A Per-Interpreter GIL
17151723
---------------------
17161724
@@ -1722,7 +1730,7 @@ being blocked by other interpreters or blocking any others. Thus a
17221730
single Python process can truly take advantage of multiple CPU cores
17231731
when running Python code. The isolation also encourages a different
17241732
approach to concurrency than that of just using threads.
1725-
(See :pep:`554`.)
1733+
(See :pep:`554` and :pep:`684`.)
17261734
17271735
Using an isolated interpreter requires vigilance in preserving that
17281736
isolation. That especially means not sharing any objects or mutable

Doc/c-api/long.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
4040
4141
Return a new :c:type:`PyLongObject` object from *v*, or ``NULL`` on failure.
4242
43-
The current implementation keeps an array of integer objects for all integers
44-
between ``-5`` and ``256``. When you create an int in that range you actually
45-
just get back a reference to the existing object.
43+
.. impl-detail::
44+
45+
CPython keeps an array of integer objects for all integers
46+
between ``-5`` and ``256``. When you create an int in that range
47+
you actually just get back a reference to the existing object.
4648
4749
4850
.. c:function:: PyObject* PyLong_FromUnsignedLong(unsigned long v)

Doc/conf.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,6 @@
221221
('envvar', 'USER'),
222222
('envvar', 'USERNAME'),
223223
('envvar', 'USERPROFILE'),
224-
# Deprecated function that was never documented:
225-
('py:func', 'getargspec'),
226-
('py:func', 'inspect.getargspec'),
227-
# Undocumented modules that users shouldn't have to worry about
228-
# (implementation details of `os.path`):
229-
('py:mod', 'ntpath'),
230-
('py:mod', 'posixpath'),
231224
]
232225

233226
# Temporary undocumented names.
@@ -242,8 +235,6 @@
242235
('py:meth', '_SubParsersAction.add_parser'),
243236
# Attributes/methods/etc. that definitely should be documented better,
244237
# but are deferred for now:
245-
('py:attr', '__annotations__'),
246-
('py:meth', '__missing__'),
247238
('py:attr', '__wrapped__'),
248239
]
249240

Doc/library/codecs.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,21 @@ The full details for each codec can also be looked up directly:
6868
Looks up the codec info in the Python codec registry and returns a
6969
:class:`CodecInfo` object as defined below.
7070

71-
Encodings are first looked up in the registry's cache. If not found, the list of
71+
This function first normalizes the *encoding*: all ASCII letters are
72+
converted to lower case, spaces are replaced with hyphens.
73+
Then encoding is looked up in the registry's cache. If not found, the list of
7274
registered search functions is scanned. If no :class:`CodecInfo` object is
7375
found, a :exc:`LookupError` is raised. Otherwise, the :class:`CodecInfo` object
7476
is stored in the cache and returned to the caller.
7577

78+
.. versionchanged:: 3.9
79+
Any characters except ASCII letters and digits and a dot are converted to underscore.
80+
81+
.. versionchanged:: next
82+
No characters are converted to underscore anymore.
83+
Spaces are converted to hyphens.
84+
85+
7686
.. class:: CodecInfo(encode, decode, streamreader=None, streamwriter=None, incrementalencoder=None, incrementaldecoder=None, name=None)
7787

7888
Codec details when looking up the codec registry. The constructor
@@ -167,14 +177,11 @@ function:
167177
.. function:: register(search_function, /)
168178

169179
Register a codec search function. Search functions are expected to take one
170-
argument, being the encoding name in all lower case letters with hyphens
171-
and spaces converted to underscores, and return a :class:`CodecInfo` object.
180+
argument, being the encoding name in all lower case letters with spaces
181+
converted to hyphens, and return a :class:`CodecInfo` object.
172182
In case a search function cannot find a given encoding, it should return
173183
``None``.
174184

175-
.. versionchanged:: 3.9
176-
Hyphens and spaces are converted to underscore.
177-
178185

179186
.. function:: unregister(search_function, /)
180187

@@ -1065,7 +1072,7 @@ or with dictionaries as mapping tables. The following table lists the codecs by
10651072
name, together with a few common aliases, and the languages for which the
10661073
encoding is likely used. Neither the list of aliases nor the list of languages
10671074
is meant to be exhaustive. Notice that spelling alternatives that only differ in
1068-
case or use a hyphen instead of an underscore are also valid aliases
1075+
case or use a space or a hyphen instead of an underscore are also valid aliases
10691076
because they are equivalent when normalized by
10701077
:func:`~encodings.normalize_encoding`. For example, ``'utf-8'`` is a valid
10711078
alias for the ``'utf_8'`` codec.

Doc/library/collections.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,9 +758,9 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
758758

759759
.. attribute:: default_factory
760760

761-
This attribute is used by the :meth:`__missing__` method; it is
762-
initialized from the first argument to the constructor, if present, or to
763-
``None``, if absent.
761+
This attribute is used by the :meth:`~defaultdict.__missing__` method;
762+
it is initialized from the first argument to the constructor, if present,
763+
or to ``None``, if absent.
764764

765765
.. versionchanged:: 3.9
766766
Added merge (``|``) and update (``|=``) operators, specified in

Doc/library/dataclasses.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ Module contents
439439
function is used.
440440

441441
This function is not strictly required, because any Python
442-
mechanism for creating a new class with :attr:`!__annotations__` can
442+
mechanism for creating a new class with :attr:`~object.__annotations__` can
443443
then apply the :func:`@dataclass <dataclass>` function to convert that class to
444444
a dataclass. This function is provided as a convenience. For
445445
example::

Doc/library/dis.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,11 @@ iterations of the loop.
10861086
Pushes ``co_consts[consti]`` onto the stack.
10871087

10881088

1089+
.. opcode:: LOAD_CONST_IMMORTAL (consti)
1090+
1091+
Works as :opcode:`LOAD_CONST`, but is more efficient for immortal objects.
1092+
1093+
10891094
.. opcode:: LOAD_SMALL_INT (i)
10901095

10911096
Pushes the integer ``i`` onto the stack.

0 commit comments

Comments
 (0)