Skip to content

Commit 0b740a4

Browse files
authored
Merge branch 'main' into issue-126883
2 parents d908d9d + 3e222e3 commit 0b740a4

File tree

331 files changed

+12332
-5543
lines changed

Some content is hidden

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

331 files changed

+12332
-5543
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
Windows
155155
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
156156
needs: build-context
157-
if: fromJSON(needs.build-context.outputs.run-tests)
157+
if: fromJSON(needs.build-context.outputs.run-windows-tests)
158158
strategy:
159159
fail-fast: false
160160
matrix:
@@ -247,13 +247,13 @@ jobs:
247247
- true
248248
os:
249249
- ubuntu-24.04
250-
- ubuntu-24.04-arm
250+
- ubuntu-22.04-arm
251251
exclude:
252252
# Do not test BOLT with free-threading, to conserve resources
253253
- bolt: true
254254
free-threading: true
255255
# BOLT currently crashes during instrumentation on aarch64
256-
- os: ubuntu-24.04-arm
256+
- os: ubuntu-22.04-arm
257257
bolt: true
258258
uses: ./.github/workflows/reusable-ubuntu.yml
259259
with:
@@ -654,13 +654,19 @@ jobs:
654654
build_ubuntu,
655655
build_ubuntu_ssltests,
656656
build_wasi,
657-
build_windows,
658657
build_asan,
659658
build_tsan,
660659
test_hypothesis,
661660
'
662661
|| ''
663662
}}
663+
${{
664+
!fromJSON(needs.build-context.outputs.run-windows-tests)
665+
&& '
666+
build_windows,
667+
'
668+
|| ''
669+
}}
664670
${{
665671
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
666672
&& '

.github/workflows/jit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
runner: ubuntu-24.04
8787
- target: aarch64-unknown-linux-gnu/gcc
8888
architecture: aarch64
89-
runner: ubuntu-24.04-arm
89+
runner: ubuntu-22.04-arm
9090
steps:
9191
- uses: actions/checkout@v4
9292
with:

.github/workflows/reusable-context.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on: # yamllint disable-line rule:truthy
2626
run-tests:
2727
description: Whether to run the regular tests
2828
value: ${{ jobs.compute-changes.outputs.run-tests }} # bool
29+
run-windows-tests:
30+
description: Whether to run the Windows tests
31+
value: ${{ jobs.compute-changes.outputs.run-windows-tests }} # bool
2932
run-windows-msi:
3033
description: Whether to run the MSI installer smoke tests
3134
value: ${{ jobs.compute-changes.outputs.run-windows-msi }} # bool
@@ -44,6 +47,7 @@ jobs:
4447
run-docs: ${{ steps.changes.outputs.run-docs }}
4548
run-tests: ${{ steps.changes.outputs.run-tests }}
4649
run-windows-msi: ${{ steps.changes.outputs.run-windows-msi }}
50+
run-windows-tests: ${{ steps.changes.outputs.run-windows-tests }}
4751
steps:
4852
- name: Set up Python
4953
uses: actions/setup-python@v5

.github/workflows/reusable-tsan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474
run: make pythoninfo
7575
- name: Tests
7676
run: ./python -m test --tsan -j4
77+
- name: Parallel tests
78+
if: fromJSON(inputs.free-threading)
79+
run: ./python -m test --tsan-parallel --parallel-threads=4 -j4
7780
- name: Display TSAN logs
7881
if: always()
7982
run: find "${GITHUB_WORKSPACE}" -name 'tsan_log.*' | xargs head -n 1000

.github/workflows/tail-call.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Tail calling interpreter
2+
on:
3+
pull_request:
4+
paths:
5+
- 'Python/bytecodes.c'
6+
- 'Python/ceval.c'
7+
- 'Python/ceval_macros.h'
8+
- 'Python/generated_cases.c.h'
9+
push:
10+
paths:
11+
- 'Python/bytecodes.c'
12+
- 'Python/ceval.c'
13+
- 'Python/ceval_macros.h'
14+
- 'Python/generated_cases.c.h'
15+
workflow_dispatch:
16+
17+
permissions:
18+
contents: read
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
23+
24+
env:
25+
FORCE_COLOR: 1
26+
27+
jobs:
28+
tail-call:
29+
name: ${{ matrix.target }}
30+
runs-on: ${{ matrix.runner }}
31+
timeout-minutes: 90
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
target:
36+
# Un-comment as we add support for more platforms for tail-calling interpreters.
37+
# - i686-pc-windows-msvc/msvc
38+
# - x86_64-pc-windows-msvc/msvc
39+
# - aarch64-pc-windows-msvc/msvc
40+
- x86_64-apple-darwin/clang
41+
- aarch64-apple-darwin/clang
42+
- x86_64-unknown-linux-gnu/gcc
43+
- aarch64-unknown-linux-gnu/gcc
44+
llvm:
45+
- 19
46+
include:
47+
# - target: i686-pc-windows-msvc/msvc
48+
# architecture: Win32
49+
# runner: windows-latest
50+
# - target: x86_64-pc-windows-msvc/msvc
51+
# architecture: x64
52+
# runner: windows-latest
53+
# - target: aarch64-pc-windows-msvc/msvc
54+
# architecture: ARM64
55+
# runner: windows-latest
56+
- target: x86_64-apple-darwin/clang
57+
architecture: x86_64
58+
runner: macos-13
59+
- target: aarch64-apple-darwin/clang
60+
architecture: aarch64
61+
runner: macos-14
62+
- target: x86_64-unknown-linux-gnu/gcc
63+
architecture: x86_64
64+
runner: ubuntu-24.04
65+
- target: aarch64-unknown-linux-gnu/gcc
66+
architecture: aarch64
67+
runner: ubuntu-22.04-arm
68+
steps:
69+
- uses: actions/checkout@v4
70+
with:
71+
persist-credentials: false
72+
- uses: actions/setup-python@v5
73+
with:
74+
python-version: '3.11'
75+
76+
- name: Native Windows (debug)
77+
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
78+
run: |
79+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
80+
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
81+
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
82+
83+
# No tests (yet):
84+
- name: Emulated Windows (release)
85+
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
86+
run: |
87+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
88+
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
89+
90+
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
91+
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
92+
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
93+
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
94+
- name: Native macOS (debug)
95+
if: runner.os == 'macOS'
96+
run: |
97+
brew update
98+
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
99+
brew install llvm@${{ matrix.llvm }}
100+
export SDKROOT="$(xcrun --show-sdk-path)"
101+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
102+
export PATH="/usr/local/opt/llvm/bin:$PATH"
103+
CC=clang-19 ./configure --with-tail-call-interp --with-pydebug
104+
make all --jobs 4
105+
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
106+
107+
- name: Native Linux (release)
108+
if: runner.os == 'Linux'
109+
run: |
110+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
111+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
112+
CC=clang-19 ./configure --with-tail-call-interp
113+
make all --jobs 4
114+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
115+

Doc/c-api/bytearray.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ Direct API functions
7474
.. c:function:: int PyByteArray_Resize(PyObject *bytearray, Py_ssize_t len)
7575
7676
Resize the internal buffer of *bytearray* to *len*.
77+
Failure is a ``-1`` return with an exception set.
78+
79+
.. versionchanged:: 3.14
80+
A negative *len* will now result in an exception being set and -1 returned.
81+
7782
7883
Macros
7984
^^^^^^

Doc/c-api/init.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ Process-wide parameters
604604
interpreter will change the contents of this storage.
605605
606606
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
607-
:c:expr:`wchar_*` string.
607+
:c:expr:`wchar_t*` string.
608608
609609
.. deprecated-removed:: 3.11 3.15
610610
@@ -852,7 +852,7 @@ Process-wide parameters
852852
directory (``"."``).
853853
854854
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
855-
:c:expr:`wchar_*` string.
855+
:c:expr:`wchar_t*` string.
856856
857857
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
858858
members of the :ref:`Python Initialization Configuration <init-config>`.
@@ -888,7 +888,7 @@ Process-wide parameters
888888
:option:`-I`.
889889
890890
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
891-
:c:expr:`wchar_*` string.
891+
:c:expr:`wchar_t*` string.
892892
893893
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
894894
members of the :ref:`Python Initialization Configuration <init-config>`.
@@ -914,7 +914,7 @@ Process-wide parameters
914914
this storage.
915915
916916
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
917-
:c:expr:`wchar_*` string.
917+
:c:expr:`wchar_t*` string.
918918
919919
.. deprecated-removed:: 3.11 3.15
920920
@@ -1501,7 +1501,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
15011501
15021502
.. c:function:: PyObject* PyUnstable_InterpreterState_GetMainModule(PyInterpreterState *interp)
15031503
1504-
Return a :term:`strong reference` to the ``__main__`` `module object <moduleobjects>`_
1504+
Return a :term:`strong reference` to the ``__main__`` :ref:`module object <moduleobjects>`
15051505
for the given interpreter.
15061506
15071507
The caller must hold the GIL.

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ Object Protocol
623623
Objects that are immortal in one CPython version are not guaranteed to
624624
be immortal in another.
625625
626-
.. versionadded:: next
626+
.. versionadded:: 3.14
627627
628628
.. c:function:: int PyUnstable_TryIncRef(PyObject *obj)
629629

Doc/c-api/unicode.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,13 @@ the user settings on the machine running the codec.
13521352
in *consumed*.
13531353
13541354
1355+
.. c:function:: PyObject* PyUnicode_DecodeCodePageStateful(int code_page, const char *str, \
1356+
Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
1357+
1358+
Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page
1359+
specified by *code_page*.
1360+
1361+
13551362
.. c:function:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
13561363
13571364
Encode a Unicode object using MBCS and return the result as Python bytes

Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
'changes',
2929
'glossary_search',
3030
'grammar_snippet',
31+
'implementation_detail',
3132
'lexers',
3233
'misc_news',
3334
'pydoc_topics',

0 commit comments

Comments
 (0)