Skip to content

Commit 9d48175

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cycle
2 parents 437593a + 95746b3 commit 9d48175

File tree

114 files changed

+1557
-560
lines changed

Some content is hidden

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

114 files changed

+1557
-560
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
.azure-pipelines/ @AA-Turner
6464

6565
# GitHub & related scripts
66-
.github/ @ezio-melotti @hugovk @AA-Turner
67-
Tools/build/compute-changes.py @AA-Turner
66+
.github/ @ezio-melotti @hugovk @AA-Turner @webknjaz
67+
Tools/build/compute-changes.py @AA-Turner @hugovk @webknjaz
6868
Tools/build/verify_ensurepip_wheels.py @AA-Turner @pfmoore @pradyunsg
6969

7070
# Pre-commit

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ jobs:
261261
# Keep 1.1.1w in our list despite it being upstream EOL and otherwise
262262
# unsupported as it most resembles other 1.1.1-work-a-like ssl APIs
263263
# supported by important vendors such as AWS-LC.
264-
openssl_ver: [1.1.1w, 3.0.18, 3.2.6, 3.3.5, 3.4.3, 3.5.4]
264+
openssl_ver: [1.1.1w, 3.0.18, 3.3.5, 3.4.3, 3.5.4, 3.6.0]
265265
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
266266
env:
267267
OPENSSL_VER: ${{ matrix.openssl_ver }}

.github/workflows/jit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- 'Python/optimizer*.c'
88
- 'Python/executor_cases.c.h'
99
- 'Python/optimizer_cases.c.h'
10+
- '**_testinternalcapi**'
1011
- '!Python/perf_jit_trampoline.c'
1112
- '!**/*.md'
1213
- '!**/*.ini'
@@ -17,6 +18,7 @@ on:
1718
- 'Python/optimizer*.c'
1819
- 'Python/executor_cases.c.h'
1920
- 'Python/optimizer_cases.c.h'
21+
- '**_testinternalcapi**'
2022
- '!Python/perf_jit_trampoline.c'
2123
- '!**/*.md'
2224
- '!**/*.ini'

Doc/c-api/descriptor.rst

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ found in the dictionary of type objects.
1010

1111
.. XXX document these!
1212
13-
.. c:var:: PyTypeObject PyProperty_Type
14-
15-
The type object for the built-in descriptor types.
16-
17-
1813
.. c:function:: PyObject* PyDescr_NewGetSet(PyTypeObject *type, struct PyGetSetDef *getset)
1914
2015
@@ -74,9 +69,26 @@ found in the dictionary of type objects.
7469
.. c:function:: PyObject* PyWrapper_New(PyObject *, PyObject *)
7570
7671
72+
.. c:macro:: PyDescr_COMMON
73+
74+
This is a :term:`soft deprecated` macro including the common fields for a
75+
descriptor object.
76+
77+
This was included in Python's C API by mistake; do not use it in extensions.
78+
For creating custom descriptor objects, create a class implementing the
79+
descriptor protocol (:c:member:`~PyTypeObject.tp_descr_get` and
80+
:c:member:`~PyTypeObject.tp_descr_set`).
81+
82+
7783
Built-in descriptors
7884
^^^^^^^^^^^^^^^^^^^^
7985
86+
.. c:var:: PyTypeObject PyProperty_Type
87+
88+
The type object for property objects. This is the same object as
89+
:class:`property` in the Python layer.
90+
91+
8092
.. c:var:: PyTypeObject PySuper_Type
8193
8294
The type object for super objects. This is the same object as

Doc/c-api/exceptions.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,17 @@ Exception Classes
793793
Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*.
794794
795795
796+
.. c:macro:: PyException_HEAD
797+
798+
This is a :term:`soft deprecated` macro including the base fields for an
799+
exception object.
800+
801+
This was included in Python's C API by mistake and is not designed for use
802+
in extensions. For creating custom exception objects, use
803+
:c:func:`PyErr_NewException` or otherwise create a class inheriting from
804+
:c:data:`PyExc_BaseException`.
805+
806+
796807
Exception Objects
797808
=================
798809

Doc/c-api/lifecycle.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ To allocate and free memory, see :ref:`allocating-objects`.
256256
collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set); this may
257257
change in the future.
258258
259+
.. versionadded:: 3.4
260+
259261
260262
.. c:function:: int PyObject_CallFinalizerFromDealloc(PyObject *op)
261263
@@ -266,6 +268,8 @@ To allocate and free memory, see :ref:`allocating-objects`.
266268
should happen. Otherwise, this function returns 0 and destruction can
267269
continue normally.
268270
271+
.. versionadded:: 3.4
272+
269273
.. seealso::
270274
271275
:c:member:`~PyTypeObject.tp_dealloc` for example code.

Doc/library/http.cookies.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ The following example demonstrates how to use the :mod:`http.cookies` module.
294294
Set-Cookie: chips=ahoy
295295
Set-Cookie: vienna=finger
296296
>>> C = cookies.SimpleCookie()
297-
>>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
297+
>>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=;";')
298298
>>> print(C)
299-
Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"
299+
Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=;"
300300
>>> C = cookies.SimpleCookie()
301301
>>> C["oreo"] = "doublestuff"
302302
>>> C["oreo"]["path"] = "/"

Doc/library/idle.rst

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Go to Line
158158

159159
Show Completions
160160
Open a scrollable list allowing selection of existing names. See
161-
:ref:`Completions <completions>` in the Editing and navigation section below.
161+
:ref:`Completions <completions>` in the Editing and Navigation section below.
162162

163163
Expand Word
164164
Expand a prefix you have typed to match a full word in the same window;
@@ -167,7 +167,7 @@ Expand Word
167167
Show Call Tip
168168
After an unclosed parenthesis for a function, open a small window with
169169
function parameter hints. See :ref:`Calltips <calltips>` in the
170-
Editing and navigation section below.
170+
Editing and Navigation section below.
171171

172172
Show Surrounding Parens
173173
Highlight the surrounding parenthesis.
@@ -178,9 +178,9 @@ Format menu (Editor window only)
178178
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179179

180180
Format Paragraph
181-
Reformat the current blank-line-delimited paragraph in comment block or
182-
multiline string or selected line in a string. All lines in the
183-
paragraph will be formatted to less than N columns, where N defaults to 72.
181+
Rewrap the text block containing the text insert cursor.
182+
Avoid code lines. See :ref:`Format block<format-block>` in the
183+
Editing and Navigation section below.
184184

185185
Indent Region
186186
Shift selected lines right by the indent width (default 4 spaces).
@@ -566,6 +566,20 @@ In an editor, import statements have no effect until one runs the file.
566566
One might want to run a file after writing import statements, after
567567
adding function definitions, or after opening an existing file.
568568

569+
.. _format-block:
570+
571+
Format block
572+
^^^^^^^^^^^^
573+
574+
Reformat Paragraph rewraps a block ('paragraph') of contiguous equally
575+
indented non-blank comments, a similar block of text within a multiline
576+
string, or a selected subset of either.
577+
If needed, add a blank line to separate string from code.
578+
Partial lines in a selection expand to complete lines.
579+
The resulting lines have the same indent as before
580+
but have maximum total length of N columns (characters).
581+
Change the default N of 72 on the Window tab of IDLE Settings.
582+
569583
.. _code-context:
570584

571585
Code Context

Doc/library/multiprocessing.rst

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,22 +1234,32 @@ Miscellaneous
12341234
.. versionchanged:: 3.11
12351235
Accepts a :term:`path-like object`.
12361236

1237-
.. function:: set_forkserver_preload(module_names)
1237+
.. function:: set_forkserver_preload(module_names, *, on_error='ignore')
12381238

12391239
Set a list of module names for the forkserver main process to attempt to
12401240
import so that their already imported state is inherited by forked
1241-
processes. Any :exc:`ImportError` when doing so is silently ignored.
1242-
This can be used as a performance enhancement to avoid repeated work
1243-
in every process.
1241+
processes. This can be used as a performance enhancement to avoid repeated
1242+
work in every process.
12441243

12451244
For this to work, it must be called before the forkserver process has been
12461245
launched (before creating a :class:`Pool` or starting a :class:`Process`).
12471246

1247+
The *on_error* parameter controls how :exc:`ImportError` exceptions during
1248+
module preloading are handled: ``"ignore"`` (default) silently ignores
1249+
failures, ``"warn"`` causes the forkserver subprocess to emit an
1250+
:exc:`ImportWarning` to stderr, and ``"fail"`` causes the forkserver
1251+
subprocess to exit with the exception traceback on stderr, making
1252+
subsequent process creation fail with :exc:`EOFError` or
1253+
:exc:`ConnectionError`.
1254+
12481255
Only meaningful when using the ``'forkserver'`` start method.
12491256
See :ref:`multiprocessing-start-methods`.
12501257

12511258
.. versionadded:: 3.4
12521259

1260+
.. versionchanged:: next
1261+
Added the *on_error* parameter.
1262+
12531263
.. function:: set_start_method(method, force=False)
12541264

12551265
Set the method which should be used to start child processes.

Doc/library/stdtypes.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,6 +2562,19 @@ expression support in the :mod:`re` module).
25622562
after the separator. If the separator is not found, return a 3-tuple containing
25632563
two empty strings, followed by the string itself.
25642564

2565+
For example:
2566+
2567+
.. doctest::
2568+
2569+
>>> 'Monty Python'.rpartition(' ')
2570+
('Monty', ' ', 'Python')
2571+
>>> "Monty Python's Flying Circus".rpartition(' ')
2572+
("Monty Python's Flying", ' ', 'Circus')
2573+
>>> 'Monty Python'.rpartition('-')
2574+
('', '', 'Monty Python')
2575+
2576+
See also :meth:`partition`.
2577+
25652578

25662579
.. method:: str.rsplit(sep=None, maxsplit=-1)
25672580

0 commit comments

Comments
 (0)