Skip to content

Commit 4f1e56d

Browse files
authored
Merge branch 'python:main' into ANSI-aware-TextWrapper
2 parents 1497de0 + 6a139d6 commit 4f1e56d

149 files changed

Lines changed: 3436 additions & 991 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.

.github/CODEOWNERS

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ Mac/ @python/macos-team
171171
Lib/_osx_support.py @python/macos-team
172172
Lib/test/test__osx_support.py @python/macos-team
173173

174-
# WebAssembly
175-
Tools/wasm/README.md @brettcannon @freakboy3742 @emmatyping
176-
177174
# WebAssembly (Emscripten)
178175
Platforms/emscripten @freakboy3742 @emmatyping
179176
Tools/wasm/emscripten @freakboy3742 @emmatyping
@@ -335,7 +332,6 @@ Modules/_remote_debugging/ @pablogsal
335332

336333
# Sub-Interpreters
337334
**/*crossinterp* @ericsnowcurrently
338-
**/*interpreteridobject.* @ericsnowcurrently
339335
Doc/library/concurrent.interpreters.rst @ericsnowcurrently
340336
Lib/concurrent/futures/interpreter.py @ericsnowcurrently
341337
Lib/concurrent/interpreters/ @ericsnowcurrently
@@ -646,3 +642,6 @@ Modules/**/clinic/
646642
Objects/**/clinic/
647643
PC/**/clinic/
648644
Python/**/clinic/
645+
646+
# Exclude HTML IDs list
647+
Doc/tools/removed-ids.txt

.github/workflows/reusable-san.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
SAN_LOG_OPTION: log_path=${{ github.workspace }}/san_log
5656
SUPPRESSIONS_SUFFIX: >-
5757
${{
58-
fromJSON(inputs.free-threading)
58+
inputs.free-threading
5959
&& '_free_threading'
6060
|| ''
6161
}}
@@ -101,7 +101,7 @@ jobs:
101101
}}
102102
--with-pydebug
103103
${{ inputs.sanitizer == 'TSan' && '--with-openssl="$OPENSSL_DIR" --with-openssl-rpath=auto' || '' }}
104-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
104+
${{ inputs.free-threading && '--disable-gil' || '' }}
105105
- name: Build CPython
106106
run: make -j4
107107
- name: Display build info
@@ -114,7 +114,7 @@ jobs:
114114
- name: Parallel tests
115115
if: >-
116116
inputs.sanitizer == 'TSan'
117-
&& fromJSON(inputs.free-threading)
117+
&& inputs.free-threading
118118
run: ./python -m test --tsan-parallel --parallel-threads=4 -j4 -W --timeout=600 --slowest
119119
- name: Display logs
120120
if: always()
@@ -125,7 +125,7 @@ jobs:
125125
with:
126126
name: >-
127127
${{ inputs.sanitizer }}-logs-${{
128-
fromJSON(inputs.free-threading)
128+
inputs.free-threading
129129
&& 'free-threading'
130130
|| 'default'
131131
}}

.github/workflows/reusable-ubuntu.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ on:
1414
type: boolean
1515
default: false
1616
os:
17-
description: OS to run the job
18-
required: true
19-
type: string
17+
description: OS to run the job
18+
required: true
19+
type: string
2020
test-opts:
21-
description: Extra options to pass to the test runner via TESTOPTS
22-
required: false
23-
type: string
24-
default: ''
21+
description: Extra options to pass to the test runner via TESTOPTS
22+
required: false
23+
type: string
24+
default: ''
2525

2626
permissions:
2727
contents: read
@@ -47,7 +47,7 @@ jobs:
4747
- name: Install dependencies
4848
run: sudo ./.github/workflows/posix-deps-apt.sh
4949
- name: Install Clang and BOLT
50-
if: ${{ fromJSON(inputs.bolt-optimizations) }}
50+
if: inputs.bolt-optimizations
5151
run: |
5252
# On ubuntu-26.04 image, LLVM is LLVM-21 by default
5353
sudo apt-get install --no-install-recommends bolt-21
@@ -88,10 +88,10 @@ jobs:
8888
--enable-slower-safety
8989
--enable-safety
9090
--with-openssl="$OPENSSL_DIR"
91-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
92-
${{ fromJSON(inputs.bolt-optimizations) && '--enable-bolt' || '' }}
91+
${{ inputs.free-threading && '--disable-gil' || '' }}
92+
${{ inputs.bolt-optimizations && '--enable-bolt' || '' }}
9393
- name: Build CPython out-of-tree
94-
if: ${{ inputs.free-threading }}
94+
if: inputs.free-threading
9595
working-directory: ${{ env.CPYTHON_BUILDDIR }}
9696
run: make -j
9797
- name: Build CPython out-of-tree (for compiler warning check)

.github/workflows/reusable-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
-e -v
4646
${{ inputs.interpreter == 'switch-case' && '-d' || '--tail-call-interp -c Release' }}
4747
-p "${ARCH}"
48-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
48+
${{ inputs.free-threading && '--disable-gil' || '' }}
4949
shell: bash
5050
- name: Display build info
5151
run: .\\python.bat -m test.pythoninfo
@@ -55,5 +55,5 @@ jobs:
5555
-p "${ARCH}"
5656
-q --fast-ci
5757
${{ inputs.interpreter == 'switch-case' && '-d' || '' }}
58-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
58+
${{ inputs.free-threading && '--disable-gil' || '' }}
5959
shell: bash

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,14 @@ PCbuild/*-pgo
124124
PCbuild/*.VC.db
125125
PCbuild/*.VC.opendb
126126
PCbuild/amd64/
127+
PCbuild/amd64t/
127128
PCbuild/arm32/
129+
PCbuild/arm32t/
128130
PCbuild/arm64/
131+
PCbuild/arm64t/
129132
PCbuild/obj/
130133
PCbuild/win32/
134+
PCbuild/win32t/
131135
Tools/unicode/data/
132136
/autom4te.cache
133137
/build/

Doc/c-api/exceptions.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ Printing and clearing
119119
.. versionadded:: 3.12
120120
121121
122+
.. c:function:: void PyErr_Display(PyObject *unused, PyObject *value, PyObject *tb)
123+
124+
Legacy variant of :c:func:`PyErr_DisplayException`.
125+
126+
Print the exception *value* with its traceback to :data:`sys.stderr`.
127+
If *value* has no traceback set, *tb* is used as its traceback.
128+
The first argument is ignored.
129+
130+
If :data:`sys.stderr` is ``None``, nothing is printed.
131+
If :data:`sys.stderr` is not set, the exception is dumped to the
132+
C ``stderr`` stream instead.
133+
134+
.. deprecated:: 3.12
135+
Use :c:func:`PyErr_DisplayException` instead.
136+
122137
Raising exceptions
123138
==================
124139

Doc/c-api/init_config.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,9 @@ PyConfig
12351235
12361236
.. c:member:: wchar_t* base_executable
12371237
1238-
Python base executable: :data:`sys._base_executable`.
1238+
Python base executable: ``sys._base_executable``.
12391239
1240-
Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable.
1240+
Set by the ``__PYVENV_LAUNCHER__`` environment variable.
12411241
12421242
Set from :c:member:`PyConfig.executable` if ``NULL``.
12431243
@@ -1748,7 +1748,7 @@ PyConfig
17481748
17491749
* On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set.
17501750
* If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use
1751-
:envvar:`__PYVENV_LAUNCHER__` environment variable if set.
1751+
``__PYVENV_LAUNCHER__`` environment variable if set.
17521752
* Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and
17531753
non-empty.
17541754
* Otherwise, use ``L"python"`` on Windows, or ``L"python3"`` on other
@@ -1984,8 +1984,7 @@ PyConfig
19841984
19851985
The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse
19861986
order: the last :c:member:`PyConfig.warnoptions` item becomes the first
1987-
item of :data:`warnings.filters` which is checked first (highest
1988-
priority).
1987+
item of ``warnings.filters`` which is checked first (highest priority).
19891988
19901989
The :option:`-W` command line options adds its value to
19911990
:c:member:`~PyConfig.warnoptions`, it can be used multiple times.

Doc/c-api/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
11631163
In addition to the reference count debugging described below, extra checks are
11641164
performed. See :ref:`Python Debug Build <debug-build>` for more details.
11651165

1166-
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
1166+
Defining ``Py_TRACE_REFS`` enables reference tracing
11671167
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).
11681168
When defined, a circular doubly linked list of active objects is maintained by adding two extra
11691169
fields to every :c:type:`PyObject`. Total allocations are tracked as well. Upon

Doc/c-api/sys.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ accessible to C code. They all work with the current interpreter thread's
433433
This function is safe to call before :c:func:`Py_Initialize`. When called
434434
after runtime initialization, existing audit hooks are notified and may
435435
silently abort the operation by raising an error subclassed from
436-
:class:`Exception` (other errors will not be silenced).
436+
:class:`RuntimeError` (other errors will not be silenced).
437437
438438
The hook function is always called with an :term:`attached thread state` by
439439
the Python interpreter that raised the event.
@@ -447,7 +447,7 @@ accessible to C code. They all work with the current interpreter thread's
447447
448448
If the interpreter is initialized, this function raises an auditing event
449449
``sys.addaudithook`` with no arguments. If any existing hooks raise an
450-
exception derived from :class:`Exception`, the new hook will not be
450+
exception derived from :class:`RuntimeError`, the new hook will not be
451451
added and the exception is cleared. As a result, callers cannot assume
452452
that their hook has been added unless they control all existing hooks.
453453
@@ -462,6 +462,11 @@ accessible to C code. They all work with the current interpreter thread's
462462
463463
.. versionadded:: 3.8
464464
465+
.. versionchanged:: 3.8.1
466+
467+
Exceptions derived from :class:`Exception` but not :class:`RuntimeError`
468+
are no longer suppressed.
469+
465470
466471
.. _processcontrol:
467472

Doc/deprecations/pending-removal-in-3.20.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,12 @@ Pending removal in Python 3.20
5353

5454
* Creating instances of abstract AST nodes (such as :class:`ast.AST`
5555
or :class:`!ast.expr`) is deprecated and will raise an error in Python 3.20.
56+
57+
* :mod:`typing`:
58+
59+
* It is deprecated to call :func:`isinstance` and :func:`issubclass` checks on
60+
protocol classes that were not explicitly decorated with :func:`!runtime_checkable`
61+
but that inherit from a runtime-checkable protocol class.
62+
This will raise a :exc:`TypeError` in Python 3.20.
63+
64+
(Contributed by Bartosz Sławecki in :gh:`132604`.)

0 commit comments

Comments
 (0)