Skip to content

Commit 2a76c9e

Browse files
committed
Merge branch 'main' into deprecated-signature
2 parents 0736846 + 25717ff commit 2a76c9e

File tree

130 files changed

+1779
-1035
lines changed

Some content is hidden

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

130 files changed

+1779
-1035
lines changed

.github/actionlint.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
self-hosted-runner:
2-
labels: ["windows-aarch64"]
2+
# Pending https://github.com/rhysd/actionlint/issues/533
3+
labels: ["windows-11-arm"]
34

45
config-variables: null
56

.github/workflows/build.yml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -156,28 +156,18 @@ jobs:
156156
strategy:
157157
fail-fast: false
158158
matrix:
159-
os:
160-
- windows-latest
161159
arch:
162160
- x64
161+
- Win32
162+
- arm64
163163
free-threading:
164164
- false
165165
- true
166-
include:
167-
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
168-
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
169-
arch: arm64
170-
free-threading: false
171-
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
172-
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
173-
arch: arm64
174-
free-threading: true
175-
- os: windows-latest
176-
arch: Win32
177-
free-threading: false
166+
exclude:
167+
# Skip Win32 on free-threaded builds
168+
- { arch: Win32, free-threading: true }
178169
uses: ./.github/workflows/reusable-windows.yml
179170
with:
180-
os: ${{ matrix.os }}
181171
arch: ${{ matrix.arch }}
182172
free-threading: ${{ matrix.free-threading }}
183173

@@ -189,18 +179,12 @@ jobs:
189179
strategy:
190180
fail-fast: false
191181
matrix:
192-
os:
193-
- windows-latest
194182
arch:
195183
- x86
196184
- x64
197-
include:
198-
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
199-
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
200-
arch: arm64
185+
- arm64
201186
uses: ./.github/workflows/reusable-windows-msi.yml
202187
with:
203-
os: ${{ matrix.os }}
204188
arch: ${{ matrix.arch }}
205189

206190
build-macos:

.github/workflows/jit.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ jobs:
7474
runner: windows-latest
7575
- target: aarch64-pc-windows-msvc/msvc
7676
architecture: ARM64
77-
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
78-
runner: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
77+
runner: windows-11-arm
7978
- target: x86_64-apple-darwin/clang
8079
architecture: x86_64
8180
runner: macos-13
@@ -97,8 +96,7 @@ jobs:
9796
python-version: '3.11'
9897

9998
- name: Windows
100-
# Forks don't have access to Windows on Arm runners. Skip those:
101-
if: runner.os == 'Windows' && (matrix.architecture != 'ARM64' || github.repository_owner == 'python')
99+
if: runner.os == 'Windows'
102100
run: |
103101
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
104102
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}

.github/workflows/reusable-windows-msi.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Reusable Windows MSI
33
on:
44
workflow_call:
55
inputs:
6-
os:
7-
description: OS to run on
8-
required: true
9-
type: string
106
arch:
117
description: CPU architecture
128
required: true
@@ -21,7 +17,7 @@ env:
2117
jobs:
2218
build:
2319
name: installer for ${{ inputs.arch }}
24-
runs-on: ${{ inputs.os }}
20+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-latest' }}
2521
timeout-minutes: 60
2622
env:
2723
ARCH: ${{ inputs.arch }}
@@ -31,7 +27,5 @@ jobs:
3127
with:
3228
persist-credentials: false
3329
- name: Build CPython installer
34-
# Forks don't have access to Windows on Arm runners. Skip those:
35-
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
3630
run: ./Tools/msi/build.bat --doc -"${ARCH}"
3731
shell: bash

.github/workflows/reusable-windows.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Reusable Windows
33
on:
44
workflow_call:
55
inputs:
6-
os:
7-
description: OS to run on
8-
required: true
9-
type: string
106
arch:
117
description: CPU architecture
128
required: true
@@ -25,7 +21,7 @@ env:
2521
jobs:
2622
build:
2723
name: Build and test (${{ inputs.arch }})
28-
runs-on: ${{ inputs.os }}
24+
runs-on: ${{ inputs.arch == 'arm64' && 'windows-11-arm' || 'windows-latest' }}
2925
timeout-minutes: 60
3026
env:
3127
ARCH: ${{ inputs.arch }}
@@ -37,21 +33,15 @@ jobs:
3733
if: inputs.arch != 'Win32'
3834
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3935
- name: Build CPython
40-
# Forks don't have access to Windows on Arm runners. Skip those:
41-
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
4236
run: >-
4337
.\\PCbuild\\build.bat
4438
-e -d -v
4539
-p "${ARCH}"
4640
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
4741
shell: bash
4842
- name: Display build info
49-
# Forks don't have access to Windows on Arm runners. Skip those:
50-
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
5143
run: .\\python.bat -m test.pythoninfo
5244
- name: Tests
53-
# Forks don't have access to Windows on Arm runners. Skip those:
54-
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
5545
run: >-
5646
.\\PCbuild\\rt.bat
5747
-p "${ARCH}"

Doc/c-api/unicode.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,14 @@ APIs:
596596
Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
597597
598598
599+
.. c:function:: PyObject* PyUnicode_FromOrdinal(int ordinal)
600+
601+
Create a Unicode Object from the given Unicode code point *ordinal*.
602+
603+
The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is
604+
raised in the case it is not.
605+
606+
599607
.. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \
600608
const char *encoding, const char *errors)
601609

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,6 +2770,9 @@ PyUnicode_FromFormatV:PyObject*::+1:
27702770
PyUnicode_FromFormatV:const char*:format::
27712771
PyUnicode_FromFormatV:va_list:args::
27722772

2773+
PyUnicode_FromOrdinal:PyObject*::+1:
2774+
PyUnicode_FromOrdinal:int:ordinal::
2775+
27732776
PyUnicode_Append:void:::
27742777
PyUnicode_Append:PyObject**:p_left:0:
27752778
PyUnicode_Append:PyObject*:right::

Doc/library/annotationlib.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Functions
214214

215215
Convert an annotations dict containing runtime values to a
216216
dict containing only strings. If the values are not already strings,
217-
they are converted using :func:`value_to_string`.
217+
they are converted using :func:`type_repr`.
218218
This is meant as a helper for user-provided
219219
annotate functions that support the :attr:`~Format.STRING` format but
220220
do not have access to the code creating the annotations.
@@ -317,11 +317,22 @@ Functions
317317
Compute the annotations dict for an object.
318318

319319
*obj* may be a callable, class, module, or other object with
320-
:attr:`~object.__annotate__` and :attr:`~object.__annotations__` attributes.
321-
Passing in an object of any other type raises :exc:`TypeError`.
320+
:attr:`~object.__annotate__` or :attr:`~object.__annotations__` attributes.
321+
Passing any other object raises :exc:`TypeError`.
322322

323323
The *format* parameter controls the format in which annotations are returned,
324324
and must be a member of the :class:`Format` enum or its integer equivalent.
325+
The different formats work as follows:
326+
327+
* VALUE: :attr:`!object.__annotations__` is tried first; if that does not exist,
328+
the :attr:`!object.__annotate__` function is called if it exists.
329+
* FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated successfully,
330+
it is used; otherwise, the :attr:`!object.__annotate__` function is called. If it
331+
does not exist either, :attr:`!object.__annotations__` is tried again and any error
332+
from accessing it is re-raised.
333+
* STRING: If :attr:`!object.__annotate__` exists, it is called first;
334+
otherwise, :attr:`!object.__annotations__` is used and stringified
335+
using :func:`annotations_to_string`.
325336

326337
Returns a dict. :func:`!get_annotations` returns a new dict every time
327338
it's called; calling it twice on the same object will return two
@@ -382,7 +393,7 @@ Functions
382393

383394
.. versionadded:: 3.14
384395

385-
.. function:: value_to_string(value)
396+
.. function:: type_repr(value)
386397

387398
Convert an arbitrary Python value to a format suitable for use by the
388399
:attr:`~Format.STRING` format. This calls :func:`repr` for most

Doc/library/asyncio-eventloop.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,6 +1440,8 @@ Allows customizing how exceptions are handled in the event loop.
14401440
* 'protocol' (optional): :ref:`Protocol <asyncio-protocol>` instance;
14411441
* 'transport' (optional): :ref:`Transport <asyncio-transport>` instance;
14421442
* 'socket' (optional): :class:`socket.socket` instance;
1443+
* 'source_traceback' (optional): Traceback of the source;
1444+
* 'handle_traceback' (optional): Traceback of the handle;
14431445
* 'asyncgen' (optional): Asynchronous generator that caused
14441446
the exception.
14451447

Doc/library/audit_events.rst

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,30 @@ information on handling these events.
2323
The following events are raised internally and do not correspond to any
2424
public API of CPython:
2525

26-
+--------------------------+-------------------------------------------+
27-
| Audit event | Arguments |
28-
+==========================+===========================================+
29-
| _winapi.CreateFile | ``file_name``, ``desired_access``, |
30-
| | ``share_mode``, ``creation_disposition``, |
31-
| | ``flags_and_attributes`` |
32-
+--------------------------+-------------------------------------------+
33-
| _winapi.CreateJunction | ``src_path``, ``dst_path`` |
34-
+--------------------------+-------------------------------------------+
35-
| _winapi.CreateNamedPipe | ``name``, ``open_mode``, ``pipe_mode`` |
36-
+--------------------------+-------------------------------------------+
37-
| _winapi.CreatePipe | |
38-
+--------------------------+-------------------------------------------+
39-
| _winapi.CreateProcess | ``application_name``, ``command_line``, |
40-
| | ``current_directory`` |
41-
+--------------------------+-------------------------------------------+
42-
| _winapi.OpenProcess | ``process_id``, ``desired_access`` |
43-
+--------------------------+-------------------------------------------+
44-
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
45-
+--------------------------+-------------------------------------------+
46-
| ctypes.PyObj_FromPtr | ``obj`` |
47-
+--------------------------+-------------------------------------------+
26+
+----------------------------+-------------------------------------------+
27+
| Audit event | Arguments |
28+
+============================+===========================================+
29+
| _winapi.CreateFile | ``file_name``, ``desired_access``, |
30+
| | ``share_mode``, ``creation_disposition``, |
31+
| | ``flags_and_attributes`` |
32+
+----------------------------+-------------------------------------------+
33+
| _winapi.CreateJunction | ``src_path``, ``dst_path`` |
34+
+----------------------------+-------------------------------------------+
35+
| _winapi.CreateNamedPipe | ``name``, ``open_mode``, ``pipe_mode`` |
36+
+----------------------------+-------------------------------------------+
37+
| _winapi.CreatePipe | |
38+
+----------------------------+-------------------------------------------+
39+
| _winapi.CreateProcess | ``application_name``, ``command_line``, |
40+
| | ``current_directory`` |
41+
+----------------------------+-------------------------------------------+
42+
| _winapi.OpenProcess | ``process_id``, ``desired_access`` |
43+
+----------------------------+-------------------------------------------+
44+
| _winapi.TerminateProcess | ``handle``, ``exit_code`` |
45+
+----------------------------+-------------------------------------------+
46+
| _posixsubprocess.fork_exec | ``exec_list``, ``args``, ``env`` |
47+
+----------------------------+-------------------------------------------+
48+
| ctypes.PyObj_FromPtr | ``obj`` |
49+
+----------------------------+-------------------------------------------+
50+
51+
.. versionadded:: next
52+
The ``_posixsubprocess.fork_exec`` internal audit event.

0 commit comments

Comments
 (0)