Skip to content

Commit 591ee60

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pygettext-help
2 parents 2be45a2 + 05e89c3 commit 591ee60

File tree

373 files changed

+16030
-7203
lines changed

Some content is hidden

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

373 files changed

+16030
-7203
lines changed

.github/workflows/build.yml

Lines changed: 11 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:
@@ -621,6 +621,7 @@ jobs:
621621
- build_wasi
622622
- build_windows
623623
- build_windows_msi
624+
- cross-build-linux
624625
- test_hypothesis
625626
- build_asan
626627
- build_tsan
@@ -654,13 +655,19 @@ jobs:
654655
build_ubuntu,
655656
build_ubuntu_ssltests,
656657
build_wasi,
657-
build_windows,
658658
build_asan,
659659
build_tsan,
660660
test_hypothesis,
661661
'
662662
|| ''
663663
}}
664+
${{
665+
!fromJSON(needs.build-context.outputs.run-windows-tests)
666+
&& '
667+
build_windows,
668+
'
669+
|| ''
670+
}}
664671
${{
665672
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
666673
&& '

.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: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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+
- free-threading
45+
llvm:
46+
- 19
47+
include:
48+
# - target: i686-pc-windows-msvc/msvc
49+
# architecture: Win32
50+
# runner: windows-latest
51+
# - target: x86_64-pc-windows-msvc/msvc
52+
# architecture: x64
53+
# runner: windows-latest
54+
# - target: aarch64-pc-windows-msvc/msvc
55+
# architecture: ARM64
56+
# runner: windows-latest
57+
- target: x86_64-apple-darwin/clang
58+
architecture: x86_64
59+
runner: macos-13
60+
- target: aarch64-apple-darwin/clang
61+
architecture: aarch64
62+
runner: macos-14
63+
- target: x86_64-unknown-linux-gnu/gcc
64+
architecture: x86_64
65+
runner: ubuntu-24.04
66+
- target: aarch64-unknown-linux-gnu/gcc
67+
architecture: aarch64
68+
runner: ubuntu-22.04-arm
69+
- target: free-threading
70+
architecture: x86_64
71+
runner: ubuntu-24.04
72+
steps:
73+
- uses: actions/checkout@v4
74+
with:
75+
persist-credentials: false
76+
- uses: actions/setup-python@v5
77+
with:
78+
python-version: '3.11'
79+
80+
- name: Native Windows (debug)
81+
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
82+
run: |
83+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
84+
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
85+
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
86+
87+
# No tests (yet):
88+
- name: Emulated Windows (release)
89+
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
90+
run: |
91+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
92+
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
93+
94+
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
95+
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
96+
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
97+
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
98+
- name: Native macOS (debug)
99+
if: runner.os == 'macOS'
100+
run: |
101+
brew update
102+
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
103+
brew install llvm@${{ matrix.llvm }}
104+
export SDKROOT="$(xcrun --show-sdk-path)"
105+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
106+
export PATH="/usr/local/opt/llvm/bin:$PATH"
107+
CC=clang-19 ./configure --with-tail-call-interp --with-pydebug
108+
make all --jobs 4
109+
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
110+
111+
- name: Native Linux (release)
112+
if: runner.os == 'Linux' && matrix.target != 'free-threading'
113+
run: |
114+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
115+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
116+
CC=clang-19 ./configure --with-tail-call-interp
117+
make all --jobs 4
118+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
119+
120+
- name: Native Linux with free-threading (release)
121+
if: matrix.target == 'free-threading'
122+
run: |
123+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
124+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
125+
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
126+
make all --jobs 4
127+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
128+

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/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1830,7 +1830,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
18301830
dictionary, so it is may be more efficient to call :c:func:`PyObject_GetAttr`
18311831
when accessing an attribute on the object.
18321832

1833-
It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit and
1833+
It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and
18341834
:c:member:`~PyTypeObject.tp_dictoffset`.
18351835

18361836
**Inheritance:**

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

0 commit comments

Comments
 (0)