Skip to content

Commit 0296f29

Browse files
authored
Merge branch 'main' into prefixmatch-b42353
2 parents 6195ad7 + d71edbd commit 0296f29

File tree

520 files changed

+26031
-15887
lines changed

Some content is hidden

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

520 files changed

+26031
-15887
lines changed

.azure-pipelines/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
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
@@ -83,7 +83,7 @@ jobs:
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
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
@@ -83,7 +83,7 @@ jobs:
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

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ Lib/ast.py @isidentical
151151

152152
**/*sysconfig* @FFY00
153153

154+
**/*cjkcodecs* @corona10
155+
154156
# macOS
155157
/Mac/ @python/macos-team
156158
**/*osx_support* @python/macos-team

.github/workflows/build.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,23 @@ jobs:
154154
needs: check_source
155155
if: needs.check_source.outputs.run_tests == 'true'
156156
env:
157+
HOMEBREW_NO_ANALYTICS: 1
158+
HOMEBREW_NO_AUTO_UPDATE: 1
159+
HOMEBREW_NO_INSTALL_CLEANUP: 1
157160
PYTHONSTRICTEXTENSIONBUILD: 1
158161
steps:
159162
- uses: actions/checkout@v3
160-
- name: Prepare homebrew environment variables
161-
run: |
162-
echo "LDFLAGS=-L$(brew --prefix tcl-tk)/lib" >> $GITHUB_ENV
163-
echo "PKG_CONFIG_PATH=$(brew --prefix [email protected])/lib/pkgconfig:$(brew --prefix tcl-tk)/lib/pkgconfig" >> $GITHUB_ENV
163+
- name: Install Homebrew dependencies
164+
run: brew install pkg-config [email protected] xz gdbm tcl-tk
164165
- name: Configure CPython
165-
run: ./configure --with-pydebug --prefix=/opt/python-dev
166+
run: |
167+
CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
168+
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
169+
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
170+
./configure \
171+
--with-pydebug \
172+
--prefix=/opt/python-dev \
173+
--with-openssl="$(brew --prefix [email protected])"
166174
- name: Build CPython
167175
run: make -j4
168176
- name: Display build info
@@ -176,7 +184,7 @@ jobs:
176184
needs: check_source
177185
if: needs.check_source.outputs.run_tests == 'true'
178186
env:
179-
OPENSSL_VER: 1.1.1s
187+
OPENSSL_VER: 1.1.1t
180188
PYTHONSTRICTEXTENSIONBUILD: 1
181189
steps:
182190
- uses: actions/checkout@v3
@@ -235,7 +243,7 @@ jobs:
235243
strategy:
236244
fail-fast: false
237245
matrix:
238-
openssl_ver: [1.1.1s, 3.0.7, 3.1.0-beta1]
246+
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
239247
env:
240248
OPENSSL_VER: ${{ matrix.openssl_ver }}
241249
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -282,7 +290,7 @@ jobs:
282290
needs: check_source
283291
if: needs.check_source.outputs.run_tests == 'true'
284292
env:
285-
OPENSSL_VER: 1.1.1s
293+
OPENSSL_VER: 1.1.1t
286294
PYTHONSTRICTEXTENSIONBUILD: 1
287295
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
288296
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
[email protected] (behavioral bugs can be sent to [email protected]).
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/dict.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Dictionary Objects
8080
8181
.. c:function:: int PyDict_DelItem(PyObject *p, PyObject *key)
8282
83-
Remove the entry in dictionary *p* with key *key*. *key* must be hashable;
83+
Remove the entry in dictionary *p* with key *key*. *key* must be :term:`hashable`;
8484
if it isn't, :exc:`TypeError` is raised.
8585
If *key* is not in the dictionary, :exc:`KeyError` is raised.
8686
Return ``0`` on success or ``-1`` on failure.

Doc/c-api/exceptions.rst

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,59 @@ Querying the error indicator
400400
recursively in subtuples) are searched for a match.
401401
402402
403+
.. c:function:: PyObject *PyErr_GetRaisedException(void)
404+
405+
Return the exception currently being raised, clearing the error indicator at
406+
the same time.
407+
408+
This function is used by code that needs to catch exceptions,
409+
or code that needs to save and restore the error indicator temporarily.
410+
411+
For example::
412+
413+
{
414+
PyObject *exc = PyErr_GetRaisedException();
415+
416+
/* ... code that might produce other errors ... */
417+
418+
PyErr_SetRaisedException(exc);
419+
}
420+
421+
.. seealso:: :c:func:`PyErr_GetHandledException`,
422+
to save the exception currently being handled.
423+
424+
.. versionadded:: 3.12
425+
426+
427+
.. c:function:: void PyErr_SetRaisedException(PyObject *exc)
428+
429+
Set *exc* as the exception currently being raised,
430+
clearing the existing exception if one is set.
431+
432+
.. warning::
433+
434+
This call steals a reference to *exc*, which must be a valid exception.
435+
436+
.. versionadded:: 3.12
437+
438+
403439
.. c:function:: void PyErr_Fetch(PyObject **ptype, PyObject **pvalue, PyObject **ptraceback)
404440
441+
.. deprecated:: 3.12
442+
443+
Use :c:func:`PyErr_GetRaisedException` instead.
444+
405445
Retrieve the error indicator into three variables whose addresses are passed.
406446
If the error indicator is not set, set all three variables to ``NULL``. If it is
407447
set, it will be cleared and you own a reference to each object retrieved. The
408448
value and traceback object may be ``NULL`` even when the type object is not.
409449
410450
.. note::
411451
412-
This function is normally only used by code that needs to catch exceptions or
413-
by code that needs to save and restore the error indicator temporarily, e.g.::
452+
This function is normally only used by legacy code that needs to catch
453+
exceptions or save and restore the error indicator temporarily.
454+
455+
For example::
414456
415457
{
416458
PyObject *type, *value, *traceback;
@@ -424,8 +466,14 @@ Querying the error indicator
424466
425467
.. c:function:: void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
426468
427-
Set the error indicator from the three objects. If the error indicator is
428-
already set, it is cleared first. If the objects are ``NULL``, the error
469+
.. deprecated:: 3.12
470+
471+
Use :c:func:`PyErr_SetRaisedException` instead.
472+
473+
Set the error indicator from the three objects,
474+
*type*, *value*, and *traceback*,
475+
clearing the existing exception if one is set.
476+
If the objects are ``NULL``, the error
429477
indicator is cleared. Do not pass a ``NULL`` type and non-``NULL`` value or
430478
traceback. The exception type should be a class. Do not pass an invalid
431479
exception type or value. (Violating these rules will cause subtle problems
@@ -436,13 +484,18 @@ Querying the error indicator
436484
437485
.. note::
438486
439-
This function is normally only used by code that needs to save and restore the
440-
error indicator temporarily. Use :c:func:`PyErr_Fetch` to save the current
441-
error indicator.
487+
This function is normally only used by legacy code that needs to
488+
save and restore the error indicator temporarily.
489+
Use :c:func:`PyErr_Fetch` to save the current error indicator.
442490
443491
444492
.. c:function:: void PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
445493
494+
.. deprecated:: 3.12
495+
496+
Use :c:func:`PyErr_GetRaisedException` instead,
497+
to avoid any possible de-normalization.
498+
446499
Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` below
447500
can be "unnormalized", meaning that ``*exc`` is a class object but ``*val`` is
448501
not an instance of the same class. This function can be used to instantiate
@@ -704,6 +757,16 @@ Exception Objects
704757
:attr:`__suppress_context__` is implicitly set to ``True`` by this function.
705758
706759
760+
.. c:function:: PyObject* PyException_GetArgs(PyObject *ex)
761+
762+
Return :attr:`~BaseException.args` of exception *ex*.
763+
764+
765+
.. c:function:: void PyException_SetArgs(PyObject *ex, PyObject *args)
766+
767+
Set :attr:`~BaseException.args` of exception *ex* to *args*.
768+
769+
707770
.. _unicodeexceptions:
708771
709772
Unicode Exception Objects

Doc/c-api/function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ There are a few functions specific to Python functions.
169169
before the modification to *func* takes place, so the prior state of *func*
170170
can be inspected. The runtime is permitted to optimize away the creation of
171171
function objects when possible. In such cases no event will be emitted.
172-
Although this creates the possitibility of an observable difference of
172+
Although this creates the possibility of an observable difference of
173173
runtime behavior depending on optimization decisions, it does not change
174174
the semantics of the Python code being executed.
175175

0 commit comments

Comments
 (0)