Skip to content

Commit b6cc6ca

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pythongh-112984
2 parents 903c168 + 4681a52 commit b6cc6ca

File tree

230 files changed

+3561
-2235
lines changed

Some content is hidden

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

230 files changed

+3561
-2235
lines changed

.github/CODEOWNERS

+2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ Doc/c-api/stable.rst @encukou
157157

158158
**/*dataclasses* @ericvsmith
159159

160+
**/*ensurepip* @pfmoore @pradyunsg
161+
160162
**/*idlelib* @terryjreedy
161163

162164
**/*typing* @JelleZijlstra @AlexWaygood

.github/workflows/build.yml

+18-18
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
if: needs.check_source.outputs.run_tests == 'true'
129129
steps:
130130
- uses: actions/checkout@v4
131-
- uses: actions/setup-python@v4
131+
- uses: actions/setup-python@v5
132132
with:
133133
python-version: '3.x'
134134
- name: Restore config.cache
@@ -187,13 +187,13 @@ jobs:
187187
if: needs.check_source.outputs.run_tests == 'true'
188188
uses: ./.github/workflows/reusable-windows.yml
189189

190-
build_windows_free_threaded:
191-
name: 'Windows (free-threaded)'
190+
build_windows_free_threading:
191+
name: 'Windows (free-threading)'
192192
needs: check_source
193193
if: needs.check_source.outputs.run_tests == 'true'
194194
uses: ./.github/workflows/reusable-windows.yml
195195
with:
196-
free-threaded: true
196+
free-threading: true
197197

198198
build_macos:
199199
name: 'macOS'
@@ -203,14 +203,14 @@ jobs:
203203
with:
204204
config_hash: ${{ needs.check_source.outputs.config_hash }}
205205

206-
build_macos_free_threaded:
207-
name: 'macOS (free-threaded)'
206+
build_macos_free_threading:
207+
name: 'macOS (free-threading)'
208208
needs: check_source
209209
if: needs.check_source.outputs.run_tests == 'true'
210210
uses: ./.github/workflows/reusable-macos.yml
211211
with:
212212
config_hash: ${{ needs.check_source.outputs.config_hash }}
213-
free-threaded: true
213+
free-threading: true
214214

215215
build_ubuntu:
216216
name: 'Ubuntu'
@@ -225,8 +225,8 @@ jobs:
225225
--with-pydebug \
226226
--with-openssl=$OPENSSL_DIR
227227
228-
build_ubuntu_free_threaded:
229-
name: 'Ubuntu (free-threaded)'
228+
build_ubuntu_free_threading:
229+
name: 'Ubuntu (free-threading)'
230230
needs: check_source
231231
if: needs.check_source.outputs.run_tests == 'true'
232232
uses: ./.github/workflows/reusable-ubuntu.yml
@@ -395,7 +395,7 @@ jobs:
395395
-x test_subprocess \
396396
-x test_signal \
397397
-x test_sysconfig
398-
- uses: actions/upload-artifact@v3
398+
- uses: actions/upload-artifact@v4
399399
if: always()
400400
with:
401401
name: hypothesis-example-db
@@ -483,14 +483,14 @@ jobs:
483483
output-sarif: true
484484
sanitizer: ${{ matrix.sanitizer }}
485485
- name: Upload crash
486-
uses: actions/upload-artifact@v3
486+
uses: actions/upload-artifact@v4
487487
if: failure() && steps.build.outcome == 'success'
488488
with:
489489
name: ${{ matrix.sanitizer }}-artifacts
490490
path: ./out/artifacts
491491
- name: Upload SARIF
492492
if: always() && steps.build.outcome == 'success'
493-
uses: github/codeql-action/upload-sarif@v2
493+
uses: github/codeql-action/upload-sarif@v3
494494
with:
495495
sarif_file: cifuzz-sarif/results.sarif
496496
checkout_path: cifuzz-sarif
@@ -504,12 +504,12 @@ jobs:
504504
- check-docs
505505
- check_generated_files
506506
- build_macos
507-
- build_macos_free_threaded
507+
- build_macos_free_threading
508508
- build_ubuntu
509-
- build_ubuntu_free_threaded
509+
- build_ubuntu_free_threading
510510
- build_ubuntu_ssltests
511511
- build_windows
512-
- build_windows_free_threaded
512+
- build_windows_free_threading
513513
- test_hypothesis
514514
- build_asan
515515
- cifuzz
@@ -537,12 +537,12 @@ jobs:
537537
&& '
538538
check_generated_files,
539539
build_macos,
540-
build_macos_free_threaded,
540+
build_macos_free_threading,
541541
build_ubuntu,
542-
build_ubuntu_free_threaded,
542+
build_ubuntu_free_threading,
543543
build_ubuntu_ssltests,
544544
build_windows,
545-
build_windows_free_threaded,
545+
build_windows_free_threading,
546546
build_asan,
547547
'
548548
|| ''

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v4
23+
- uses: actions/setup-python@v5
2424
with:
2525
python-version: "3.x"
2626
- uses: pre-commit/[email protected]

.github/workflows/mypy.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
timeout-minutes: 10
4747
steps:
4848
- uses: actions/checkout@v4
49-
- uses: actions/setup-python@v4
49+
- uses: actions/setup-python@v5
5050
with:
5151
python-version: "3.11"
5252
cache: pip

.github/workflows/reusable-docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
git fetch origin ${{ env.refspec_base }} --shallow-since="${DATE}" \
4242
--no-tags --prune --no-recurse-submodules
4343
- name: 'Set up Python'
44-
uses: actions/setup-python@v4
44+
uses: actions/setup-python@v5
4545
with:
4646
python-version: '3'
4747
cache: 'pip'
@@ -72,7 +72,7 @@ jobs:
7272
steps:
7373
- uses: actions/checkout@v4
7474
- name: 'Set up Python'
75-
uses: actions/setup-python@v4
75+
uses: actions/setup-python@v5
7676
with:
7777
python-version: '3.11' # known to work with Sphinx 4.2
7878
cache: 'pip'

.github/workflows/reusable-macos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
config_hash:
55
required: true
66
type: string
7-
free-threaded:
7+
free-threading:
88
required: false
99
type: boolean
1010
default: false
@@ -35,7 +35,7 @@ jobs:
3535
./configure \
3636
--config-cache \
3737
--with-pydebug \
38-
${{ inputs.free-threaded && '--disable-gil' || '' }} \
38+
${{ inputs.free-threading && '--disable-gil' || '' }} \
3939
--prefix=/opt/python-dev \
4040
--with-openssl="$(brew --prefix [email protected])"
4141
- name: Build CPython

.github/workflows/reusable-windows.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
workflow_call:
33
inputs:
4-
free-threaded:
4+
free-threading:
55
required: false
66
type: boolean
77
default: false
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Build CPython
19-
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
19+
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
2020
- name: Display build info
2121
run: .\python.bat -m test.pythoninfo
2222
- name: Tests
@@ -33,7 +33,7 @@ jobs:
3333
- name: Register MSVC problem matcher
3434
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3535
- name: Build CPython
36-
run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
36+
run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
3737
- name: Display build info
3838
run: .\python.bat -m test.pythoninfo
3939
- name: Tests
@@ -50,4 +50,4 @@ jobs:
5050
- name: Register MSVC problem matcher
5151
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
5252
- name: Build CPython
53-
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
53+
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threading && '--disable-gil' || '' }}

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: "Check PRs"
19-
uses: actions/stale@v8
19+
uses: actions/stale@v9
2020
with:
2121
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'

.github/workflows/verify-ensurepip-wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
timeout-minutes: 10
2727
steps:
2828
- uses: actions/checkout@v4
29-
- uses: actions/setup-python@v4
29+
- uses: actions/setup-python@v5
3030
with:
3131
python-version: '3'
3232
- name: Compare checksum of bundled wheels to the ones published on PyPI

Doc/Makefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ SPHINXERRORHANDLING = -W
1919
PAPEROPT_a4 = -D latex_elements.papersize=a4paper
2020
PAPEROPT_letter = -D latex_elements.papersize=letterpaper
2121

22-
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j $(JOBS) \
23-
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
22+
ALLSPHINXOPTS = -b $(BUILDER) \
23+
-d build/doctrees \
24+
-j $(JOBS) \
25+
$(PAPEROPT_$(PAPER)) \
26+
$(SPHINXOPTS) $(SPHINXERRORHANDLING) \
27+
. build/$(BUILDER) $(SOURCES)
2428

2529
.PHONY: help
2630
help:
@@ -142,7 +146,7 @@ htmlview: html
142146

143147
.PHONY: htmllive
144148
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
145-
htmllive: SPHINXOPTS = --re-ignore="/venv/"
149+
htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
146150
htmllive: html
147151

148152
.PHONY: clean

Doc/c-api/exceptions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ Querying the error indicator
440440
.. c:function:: PyObject *PyErr_GetRaisedException(void)
441441
442442
Return the exception currently being raised, clearing the error indicator at
443-
the same time.
443+
the same time. Return ``NULL`` if the error indicator is not set.
444444
445445
This function is used by code that needs to catch exceptions,
446446
or code that needs to save and restore the error indicator temporarily.

Doc/data/refcounts.dat

+7
Original file line numberDiff line numberDiff line change
@@ -1589,6 +1589,13 @@ PyObject_Call:PyObject*:callable_object:0:
15891589
PyObject_Call:PyObject*:args:0:
15901590
PyObject_Call:PyObject*:kw:0:
15911591

1592+
PyObject_CallNoArgs:PyObject*::+1:
1593+
PyObject_CallNoArgs:PyObject*:callable_object:0:
1594+
1595+
PyObject_CallOneArg:PyObject*::+1:
1596+
PyObject_CallOneArg:PyObject*:callable_object:0:
1597+
PyObject_CallOneArg:PyObject*:arg:0:
1598+
15921599
PyObject_CallFunction:PyObject*::+1:
15931600
PyObject_CallFunction:PyObject*:callable_object:0:
15941601
PyObject_CallFunction:const char*:format::

Doc/howto/isolating-extensions.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ That is, heap types should:
337337

338338
- Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag.
339339
- Define a traverse function using ``Py_tp_traverse``, which
340-
visits the type (e.g. using :c:expr:`Py_VISIT(Py_TYPE(self))`).
340+
visits the type (e.g. using ``Py_VISIT(Py_TYPE(self))``).
341341

342342
Please refer to the the documentation of
343343
:c:macro:`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse`
@@ -482,7 +482,7 @@ The largest roadblock is getting *the class a method was defined in*, or
482482
that method's "defining class" for short. The defining class can have a
483483
reference to the module it is part of.
484484

485-
Do not confuse the defining class with :c:expr:`Py_TYPE(self)`. If the method
485+
Do not confuse the defining class with ``Py_TYPE(self)``. If the method
486486
is called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to
487487
that subclass, which may be defined in different module than yours.
488488

Doc/howto/logging-cookbook.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,10 @@ Suppose you configure logging with the following JSON:
332332
}
333333
}
334334
335-
This configuration does *almost* what we want, except that ``sys.stdout`` would
336-
show messages of severity ``ERROR`` and above as well as ``INFO`` and
337-
``WARNING`` messages. To prevent this, we can set up a filter which excludes
338-
those messages and add it to the relevant handler. This can be configured by
335+
This configuration does *almost* what we want, except that ``sys.stdout`` would show messages
336+
of severity ``ERROR`` and only events of this severity and higher will be tracked
337+
as well as ``INFO`` and ``WARNING`` messages. To prevent this, we can set up a filter which
338+
excludes those messages and add it to the relevant handler. This can be configured by
339339
adding a ``filters`` section parallel to ``formatters`` and ``handlers``:
340340

341341
.. code-block:: json

Doc/howto/logging.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ described below (in increasing order of severity):
8989
| | itself may be unable to continue running. |
9090
+--------------+---------------------------------------------+
9191

92-
The default level is ``WARNING``, which means that only events of this level
93-
and above will be tracked, unless the logging package is configured to do
94-
otherwise.
92+
The default level is ``WARNING``, which means that only events of this severity and higher
93+
will be tracked, unless the logging package is configured to do otherwise.
9594

9695
Events that are tracked can be handled in different ways. The simplest way of
9796
handling tracked events is to print them to the console. Another common way

Doc/library/bisect.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ linear searches or frequent resorting.
1919
The module is called :mod:`bisect` because it uses a basic bisection
2020
algorithm to do its work. Unlike other bisection tools that search for a
2121
specific value, the functions in this module are designed to locate an
22-
insertion point. Accordingly, the functions never call an :meth:`__eq__`
22+
insertion point. Accordingly, the functions never call an :meth:`~object.__eq__`
2323
method to determine whether a value has been found. Instead, the
24-
functions only call the :meth:`__lt__` method and will return an insertion
24+
functions only call the :meth:`~object.__lt__` method and will return an insertion
2525
point between values in an array.
2626

2727
.. _bisect functions:
@@ -73,7 +73,7 @@ The following functions are provided:
7373
Insert *x* in *a* in sorted order.
7474

7575
This function first runs :py:func:`~bisect.bisect_left` to locate an insertion point.
76-
Next, it runs the :meth:`insert` method on *a* to insert *x* at the
76+
Next, it runs the :meth:`!insert` method on *a* to insert *x* at the
7777
appropriate position to maintain sort order.
7878

7979
To support inserting records in a table, the *key* function (if any) is
@@ -93,7 +93,7 @@ The following functions are provided:
9393
entries of *x*.
9494

9595
This function first runs :py:func:`~bisect.bisect_right` to locate an insertion point.
96-
Next, it runs the :meth:`insert` method on *a* to insert *x* at the
96+
Next, it runs the :meth:`!insert` method on *a* to insert *x* at the
9797
appropriate position to maintain sort order.
9898

9999
To support inserting records in a table, the *key* function (if any) is

Doc/library/calendar.rst

+10-3
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
196196
output (defaulting to the system default encoding).
197197

198198

199+
.. method:: formatmonthname(theyear, themonth, withyear=True)
200+
201+
Return a month name as an HTML table row. If *withyear* is true the year
202+
will be included in the row, otherwise just the month name will be
203+
used.
204+
205+
199206
:class:`!HTMLCalendar` has the following attributes you can override to
200207
customize the CSS classes used by the calendar:
201208

@@ -289,7 +296,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
289296

290297
.. note::
291298

292-
The constructor, :meth:`formatweekday` and :meth:`formatmonthname` methods
299+
The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods
293300
of these two classes temporarily change the ``LC_TIME`` locale to the given
294301
*locale*. Because the current locale is a process-wide setting, they are
295302
not thread-safe.
@@ -358,7 +365,7 @@ For simple text calendars this module provides the following functions.
358365

359366
.. function:: month(theyear, themonth, w=0, l=0)
360367

361-
Returns a month's calendar in a multi-line string using the :meth:`formatmonth`
368+
Returns a month's calendar in a multi-line string using the :meth:`~TextCalendar.formatmonth`
362369
of the :class:`TextCalendar` class.
363370

364371

@@ -370,7 +377,7 @@ For simple text calendars this module provides the following functions.
370377
.. function:: calendar(year, w=2, l=1, c=6, m=3)
371378

372379
Returns a 3-column calendar for an entire year as a multi-line string using
373-
the :meth:`formatyear` of the :class:`TextCalendar` class.
380+
the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class.
374381

375382

376383
.. function:: timegm(tuple)

0 commit comments

Comments
 (0)