Skip to content

Commit c2904bd

Browse files
committed
Merge remote-tracking branch 'upstream/main' into list-extend-pop-top
# Conflicts: # Include/internal/pycore_uop_ids.h
2 parents d356fb0 + c8ee196 commit c2904bd

File tree

245 files changed

+5202
-2090
lines changed

Some content is hidden

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

245 files changed

+5202
-2090
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ Tools/peg_generator/pegen/grammar_parser.py generated
112112
aclocal.m4 generated
113113
configure generated
114114
*.min.js generated
115+
package-lock.json generated

.github/actionlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
self-hosted-runner:
2+
# Pending release of actionlint > 1.7.11 for macos-26-intel support
3+
# https://github.com/rhysd/actionlint/pull/629
4+
labels: ["macos-26-intel"]
5+
16
config-variables: null
27

38
paths:

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,16 @@ jobs:
198198
strategy:
199199
fail-fast: false
200200
matrix:
201-
# macos-14 is M1, macos-15-intel is Intel.
202-
# macos-15-intel only runs tests against the GIL-enabled CPython.
201+
# macos-26 is Apple Silicon, macos-26-intel is Intel.
202+
# macos-26-intel only runs tests against the GIL-enabled CPython.
203203
os:
204-
- macos-14
205-
- macos-15-intel
204+
- macos-26
205+
- macos-26-intel
206206
free-threading:
207207
- false
208208
- true
209209
exclude:
210-
- os: macos-15-intel
210+
- os: macos-26-intel
211211
free-threading: true
212212
uses: ./.github/workflows/reusable-macos.yml
213213
with:
@@ -336,7 +336,7 @@ jobs:
336336
matrix:
337337
include:
338338
- arch: aarch64
339-
runs-on: macos-14
339+
runs-on: macos-26
340340
- arch: x86_64
341341
runs-on: ubuntu-24.04
342342

@@ -369,7 +369,7 @@ jobs:
369369
sudo xcode-select --switch /Applications/Xcode_15.4.app
370370
371371
- name: Build and test
372-
run: python3 Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5'
372+
run: python3 Platforms/Apple ci iOS --fast-ci --simulator 'iPhone SE (3rd generation),OS=17.5'
373373

374374
build-emscripten:
375375
name: 'Emscripten'

.github/workflows/jit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ jobs:
9999
- false
100100
include:
101101
- target: x86_64-apple-darwin/clang
102-
runner: macos-15-intel
102+
runner: macos-26-intel
103103
- target: aarch64-apple-darwin/clang
104-
runner: macos-14
104+
runner: macos-26
105105
steps:
106106
- uses: actions/checkout@v6
107107
with:

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ jobs:
5252
--prefix=/opt/python-dev \
5353
--with-openssl="$(brew --prefix openssl@3.5)"
5454
- name: Build CPython
55-
if : ${{ inputs.free-threading || inputs.os != 'macos-15-intel' }}
55+
if : ${{ inputs.free-threading || inputs.os != 'macos-26-intel' }}
5656
run: gmake -j8
5757
- name: Build CPython for compiler warning check
58-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
58+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
5959
run: set -o pipefail; gmake -j8 --output-sync 2>&1 | tee compiler_output_macos.txt
6060
- name: Display build info
6161
run: make pythoninfo
6262
- name: Check compiler warnings
63-
if : ${{ !inputs.free-threading && inputs.os == 'macos-15-intel' }}
63+
if : ${{ !inputs.free-threading && inputs.os == 'macos-26-intel' }}
6464
run: >-
6565
python3 Tools/build/check_warnings.py
6666
--compiler-output-file-path=compiler_output_macos.txt

.github/workflows/tail-call.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ jobs:
6767
matrix:
6868
include:
6969
- target: x86_64-apple-darwin/clang
70-
runner: macos-15-intel
70+
runner: macos-26-intel
7171
- target: aarch64-apple-darwin/clang
72-
runner: macos-14
72+
runner: macos-26
7373
steps:
7474
- uses: actions/checkout@v6
7575
with:

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ repos:
33
rev: a27a2e47c7751b639d2b5badf0ef6ff11fee893f # frozen: v0.15.4
44
hooks:
55
- id: ruff-check
6-
name: Run Ruff (lint) on Apple/
7-
args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml]
8-
files: ^Apple/
6+
name: Run Ruff (lint) on Platforms/Apple/
7+
args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml]
8+
files: ^Platforms/Apple/
99
- id: ruff-check
1010
name: Run Ruff (lint) on Doc/
1111
args: [--exit-non-zero-on-fix]
@@ -39,9 +39,9 @@ repos:
3939
args: [--exit-non-zero-on-fix, --config=Tools/wasm/.ruff.toml]
4040
files: ^Tools/wasm/
4141
- id: ruff-format
42-
name: Run Ruff (format) on Apple/
43-
args: [--exit-non-zero-on-fix, --config=Apple/.ruff.toml]
44-
files: ^Apple
42+
name: Run Ruff (format) on Platforms/Apple/
43+
args: [--exit-non-zero-on-fix, --config=Platforms/Apple/.ruff.toml]
44+
files: ^Platforms/Apple/
4545
- id: ruff-format
4646
name: Run Ruff (format) on Doc/
4747
args: [--exit-non-zero-on-fix]

Android/android.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,8 @@ async def gradle_task(context):
628628
# Randomization is disabled because order-dependent failures are
629629
# much less likely to pass on a rerun in single-process mode.
630630
"-m", "test",
631-
f"--{context.ci_mode}-ci", "--single-process", "--no-randomize"
631+
f"--{context.ci_mode}-ci", "--single-process", "--no-randomize",
632+
"--pythoninfo",
632633
]
633634

634635
if not any(arg in context.args for arg in ["-c", "-m"]):

Doc/c-api/bytearray.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ Direct API functions
4444
4545
On failure, return ``NULL`` with an exception set.
4646
47+
.. note::
48+
If the object implements the buffer protocol, then the buffer
49+
must not be mutated while the bytearray object is being created.
50+
4751
4852
.. c:function:: PyObject* PyByteArray_FromStringAndSize(const char *string, Py_ssize_t len)
4953
@@ -58,6 +62,10 @@ Direct API functions
5862
5963
On failure, return ``NULL`` with an exception set.
6064
65+
.. note::
66+
If the object implements the buffer protocol, then the buffer
67+
must not be mutated while the bytearray object is being created.
68+
6169
6270
.. c:function:: Py_ssize_t PyByteArray_Size(PyObject *bytearray)
6371
@@ -70,6 +78,9 @@ Direct API functions
7078
``NULL`` pointer. The returned array always has an extra
7179
null byte appended.
7280
81+
.. note::
82+
It is not thread-safe to mutate the bytearray object while using the returned char array.
83+
7384
7485
.. c:function:: int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)
7586
@@ -89,6 +100,9 @@ These macros trade safety for speed and they don't check pointers.
89100
90101
Similar to :c:func:`PyByteArray_AsString`, but without error checking.
91102
103+
.. note::
104+
It is not thread-safe to mutate the bytearray object while using the returned char array.
105+
92106
93107
.. c:function:: Py_ssize_t PyByteArray_GET_SIZE(PyObject *bytearray)
94108

Doc/c-api/bytes.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ called with a non-bytes parameter.
127127
Return the bytes representation of object *o* that implements the buffer
128128
protocol.
129129
130+
.. note::
131+
If the object implements the buffer protocol, then the buffer
132+
must not be mutated while the bytes object is being created.
133+
130134
131135
.. c:function:: Py_ssize_t PyBytes_Size(PyObject *o)
132136
@@ -185,13 +189,20 @@ called with a non-bytes parameter.
185189
created, the old reference to *bytes* will still be discarded and the value
186190
of *\*bytes* will be set to ``NULL``; the appropriate exception will be set.
187191
192+
.. note::
193+
If *newpart* implements the buffer protocol, then the buffer
194+
must not be mutated while the new bytes object is being created.
188195
189196
.. c:function:: void PyBytes_ConcatAndDel(PyObject **bytes, PyObject *newpart)
190197
191198
Create a new bytes object in *\*bytes* containing the contents of *newpart*
192199
appended to *bytes*. This version releases the :term:`strong reference`
193200
to *newpart* (i.e. decrements its reference count).
194201
202+
.. note::
203+
If *newpart* implements the buffer protocol, then the buffer
204+
must not be mutated while the new bytes object is being created.
205+
195206
196207
.. c:function:: PyObject* PyBytes_Join(PyObject *sep, PyObject *iterable)
197208
@@ -210,6 +221,9 @@ called with a non-bytes parameter.
210221
211222
.. versionadded:: 3.14
212223
224+
.. note::
225+
If *iterable* objects implement the buffer protocol, then the buffers
226+
must not be mutated while the new bytes object is being created.
213227
214228
.. c:function:: int _PyBytes_Resize(PyObject **bytes, Py_ssize_t newsize)
215229

0 commit comments

Comments
 (0)