Skip to content

Commit d81c042

Browse files
committed
Merge branch 'main' into trim-code-object-2
2 parents d891db9 + 160f2fe commit d81c042

498 files changed

Lines changed: 23895 additions & 12980 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.

.azure-pipelines/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
displayName: Pre-build checks
99

1010
pool:
11-
vmImage: ubuntu-20.04
11+
vmImage: ubuntu-22.04
1212

1313
steps:
1414
- template: ./prebuild-checks.yml
@@ -20,7 +20,7 @@ jobs:
2020
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))
2121

2222
pool:
23-
vmImage: ubuntu-20.04
23+
vmImage: ubuntu-22.04
2424

2525
steps:
2626
- template: ./docs-steps.yml
@@ -52,12 +52,12 @@ jobs:
5252
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
5353

5454
pool:
55-
vmImage: ubuntu-20.04
55+
vmImage: ubuntu-22.04
5656

5757
variables:
5858
testRunTitle: '$(build.sourceBranchName)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1q
60+
openssl_version: 1.1.1t
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -78,12 +78,12 @@ jobs:
7878
)
7979
8080
pool:
81-
vmImage: ubuntu-20.04
81+
vmImage: ubuntu-22.04
8282

8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1q
86+
openssl_version: 1.1.1t
8787

8888
steps:
8989
- template: ./posix-steps.yml

.azure-pipelines/pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
displayName: Pre-build checks
99

1010
pool:
11-
vmImage: ubuntu-20.04
11+
vmImage: ubuntu-22.04
1212

1313
steps:
1414
- template: ./prebuild-checks.yml
@@ -20,7 +20,7 @@ jobs:
2020
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))
2121

2222
pool:
23-
vmImage: ubuntu-20.04
23+
vmImage: ubuntu-22.04
2424

2525
steps:
2626
- template: ./docs-steps.yml
@@ -52,12 +52,12 @@ jobs:
5252
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
5353

5454
pool:
55-
vmImage: ubuntu-20.04
55+
vmImage: ubuntu-22.04
5656

5757
variables:
5858
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1q
60+
openssl_version: 1.1.1t
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -78,12 +78,12 @@ jobs:
7878
)
7979
8080
pool:
81-
vmImage: ubuntu-20.04
81+
vmImage: ubuntu-22.04
8282

8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1q
86+
openssl_version: 1.1.1t
8787

8888
steps:
8989
- template: ./posix-steps.yml

.azure-pipelines/windows-layout-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ steps:
1212
displayName: Show layout info (${{ parameters.kind }})
1313

1414
- ${{ if eq(parameters.fulltest, 'true') }}:
15-
- script: .\python.exe -m test -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results-${{ parameters.kind }}.xml" --tempdir "$(Build.BinariesDirectory)\tmp-${{ parameters.kind }}-$(arch)"
15+
- script: .\python.exe -m test -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results-${{ parameters.kind }}.xml" --tempdir "$(Build.BinariesDirectory)\tmp-${{ parameters.kind }}-$(arch)" -i test_launcher
1616
workingDirectory: $(Build.BinariesDirectory)\layout-${{ parameters.kind }}-$(arch)
1717
displayName: ${{ parameters.kind }} Tests
1818
env:

.github/CODEOWNERS

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# GitHub
88
.github/** @ezio-melotti
99

10+
# Build system
11+
configure* @erlend-aasland @corona10
12+
1013
# asyncio
1114
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303
1215

@@ -63,7 +66,7 @@ Python/traceback.c @iritkatriel
6366
# bytecode.
6467
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6568
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
66-
**/*importlib/resources/* @jaraco @warsaw @brettcannon @FFY00
69+
**/*importlib/resources/* @jaraco @warsaw @FFY00
6770
**/importlib/metadata/* @jaraco @warsaw
6871

6972
# Dates and times
@@ -144,16 +147,18 @@ Lib/ast.py @isidentical
144147
**/*cgi* @ethanfurman
145148
**/*tarfile* @ethanfurman
146149

147-
**/*tomllib* @encukou
150+
**/*tomllib* @encukou @hauntsaninja
148151

149152
**/*sysconfig* @FFY00
150153

154+
**/*cjkcodecs* @corona10
155+
151156
# macOS
152157
/Mac/ @python/macos-team
153158
**/*osx_support* @python/macos-team
154159

155160
# pathlib
156-
**/*pathlib* @brettcannon
161+
**/*pathlib* @barneygale
157162

158163
# zipfile.Path
159164
**/*zipfile/*_path.py @jaraco

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
needs: check_source
177177
if: needs.check_source.outputs.run_tests == 'true'
178178
env:
179-
OPENSSL_VER: 1.1.1s
179+
OPENSSL_VER: 1.1.1t
180180
PYTHONSTRICTEXTENSIONBUILD: 1
181181
steps:
182182
- uses: actions/checkout@v3
@@ -235,7 +235,7 @@ jobs:
235235
strategy:
236236
fail-fast: false
237237
matrix:
238-
openssl_ver: [1.1.1s, 3.0.7, 3.1.0-beta1]
238+
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
239239
env:
240240
OPENSSL_VER: ${{ matrix.openssl_ver }}
241241
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -282,7 +282,7 @@ jobs:
282282
needs: check_source
283283
if: needs.check_source.outputs.run_tests == 'true'
284284
env:
285-
OPENSSL_VER: 1.1.1s
285+
OPENSSL_VER: 1.1.1t
286286
PYTHONSTRICTEXTENSIONBUILD: 1
287287
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
288288
steps:

Doc/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ VENVDIR = ./venv
99
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
1010
SPHINXLINT = PATH=$(VENVDIR)/bin:$$PATH sphinx-lint
1111
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
12+
JOBS = auto
1213
PAPER =
1314
SOURCES =
1415
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
@@ -18,7 +19,7 @@ SPHINXERRORHANDLING = -W
1819
PAPEROPT_a4 = -D latex_elements.papersize=a4paper
1920
PAPEROPT_letter = -D latex_elements.papersize=letterpaper
2021

21-
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j auto \
22+
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j $(JOBS) \
2223
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
2324

2425
.PHONY: help

Doc/bugs.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ If you find a bug in this documentation or would like to propose an improvement,
1919
please submit a bug report on the :ref:`tracker <using-the-tracker>`. If you
2020
have a suggestion on how to fix it, include that as well.
2121

22+
You can also open a discussion item on our
23+
`Documentation Discourse forum <https://discuss.python.org/c/documentation/26>`_.
24+
2225
If you're short on time, you can also email documentation bug reports to
2326
docs@python.org (behavioral bugs can be sent to python-list@python.org).
2427
'docs@' is a mailing list run by volunteers; your request will be noticed,

Doc/c-api/code.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ bound into a function.
7777
7878
Returns ``1`` if the function succeeds and 0 otherwise.
7979
80+
.. versionadded:: 3.11
81+
8082
.. c:function:: PyObject* PyCode_GetCode(PyCodeObject *co)
8183
8284
Equivalent to the Python code ``getattr(co, 'co_code')``.

Doc/c-api/exceptions.rst

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,61 @@ Querying the error indicator
400400
recursively in subtuples) are searched for a match.
401401
402402
403+
.. c:function:: PyObject *PyErr_GetRaisedException(void)
404+
405+
Returns the exception currently being raised, clearing the exception at
406+
the same time. Do not confuse this with the exception currently being
407+
handled which can be accessed with :c:func:`PyErr_GetHandledException`.
408+
409+
.. note::
410+
411+
This function is normally only used by code that needs to catch exceptions or
412+
by code that needs to save and restore the error indicator temporarily, e.g.::
413+
414+
{
415+
PyObject *exc = PyErr_GetRaisedException();
416+
417+
/* ... code that might produce other errors ... */
418+
419+
PyErr_SetRaisedException(exc);
420+
}
421+
422+
.. versionadded:: 3.12
423+
424+
425+
.. c:function:: void PyErr_SetRaisedException(PyObject *exc)
426+
427+
Sets the exception currently being raised ``exc``.
428+
If the exception is already set, it is cleared first.
429+
430+
``exc`` must be a valid exception.
431+
(Violating this rules will cause subtle problems later.)
432+
This call consumes a reference to the ``exc`` object: you must own a
433+
reference to that object before the call and after the call you no longer own
434+
that reference.
435+
(If you don't understand this, don't use this function. I warned you.)
436+
437+
.. note::
438+
439+
This function is normally only used by code that needs to save and restore the
440+
error indicator temporarily. Use :c:func:`PyErr_GetRaisedException` to save
441+
the current exception, e.g.::
442+
443+
{
444+
PyObject *exc = PyErr_GetRaisedException();
445+
446+
/* ... code that might produce other errors ... */
447+
448+
PyErr_SetRaisedException(exc);
449+
}
450+
451+
.. versionadded:: 3.12
452+
453+
403454
.. c:function:: void PyErr_Fetch(PyObject **ptype, PyObject **pvalue, PyObject **ptraceback)
404455
456+
As of 3.12, this function is deprecated. Use :c:func:`PyErr_GetRaisedException` instead.
457+
405458
Retrieve the error indicator into three variables whose addresses are passed.
406459
If the error indicator is not set, set all three variables to ``NULL``. If it is
407460
set, it will be cleared and you own a reference to each object retrieved. The
@@ -421,10 +474,14 @@ Querying the error indicator
421474
PyErr_Restore(type, value, traceback);
422475
}
423476
477+
.. deprecated:: 3.12
478+
424479
425480
.. c:function:: void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
426481
427-
Set the error indicator from the three objects. If the error indicator is
482+
As of 3.12, this function is deprecated. Use :c:func:`PyErr_SetRaisedException` instead.
483+
484+
Set the error indicator from the three objects. If the error indicator is
428485
already set, it is cleared first. If the objects are ``NULL``, the error
429486
indicator is cleared. Do not pass a ``NULL`` type and non-``NULL`` value or
430487
traceback. The exception type should be a class. Do not pass an invalid
@@ -440,9 +497,15 @@ Querying the error indicator
440497
error indicator temporarily. Use :c:func:`PyErr_Fetch` to save the current
441498
error indicator.
442499
500+
.. deprecated:: 3.12
501+
443502
444503
.. c:function:: void PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
445504
505+
As of 3.12, this function is deprecated.
506+
Use :c:func:`PyErr_GetRaisedException` instead of :c:func:`PyErr_Fetch` to avoid
507+
any possible de-normalization.
508+
446509
Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` below
447510
can be "unnormalized", meaning that ``*exc`` is a class object but ``*val`` is
448511
not an instance of the same class. This function can be used to instantiate
@@ -459,6 +522,8 @@ Querying the error indicator
459522
PyException_SetTraceback(val, tb);
460523
}
461524
525+
.. deprecated:: 3.12
526+
462527
463528
.. c:function:: PyObject* PyErr_GetHandledException(void)
464529
@@ -704,6 +769,18 @@ Exception Objects
704769
:attr:`__suppress_context__` is implicitly set to ``True`` by this function.
705770
706771
772+
.. c:function:: PyObject* PyException_GetArgs(PyObject *ex)
773+
774+
Return args of the given exception as a new reference,
775+
as accessible from Python through :attr:`args`.
776+
777+
778+
.. c:function:: void PyException_SetArgs(PyObject *ex, PyObject *args)
779+
780+
Set the args of the given exception,
781+
as accessible from Python through :attr:`args`.
782+
783+
707784
.. _unicodeexceptions:
708785
709786
Unicode Exception Objects

Doc/c-api/init_config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ PyConfig
839839
will produce an error.
840840
841841
Configured by the :option:`-X int_max_str_digits <-X>` command line
842-
flag or the :envvar:`PYTHONINTMAXSTRDIGITS` environment varable.
842+
flag or the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable.
843843
844844
Default: ``-1`` in Python mode. 4300
845845
(:data:`sys.int_info.default_max_str_digits`) in isolated mode.
@@ -1582,7 +1582,7 @@ applied during the "Main" phase. It may allow to customize Python in Python to
15821582
override or tune the :ref:`Path Configuration <init-path-config>`, maybe
15831583
install a custom :data:`sys.meta_path` importer or an import hook, etc.
15841584
1585-
It may become possible to calculatin the :ref:`Path Configuration
1585+
It may become possible to calculate the :ref:`Path Configuration
15861586
<init-path-config>` in Python, after the Core phase and before the Main phase,
15871587
which is one of the :pep:`432` motivation.
15881588

0 commit comments

Comments
 (0)