8000 Merge branch 'main' into gh-116380 · barneygale/cpython@413b12e · GitHub
[go: up one dir, main page]

Skip to content

Commit 413b12e

Browse files
authored
Merge branch 'main' into pythongh-116380
2 parents 10a6cf4 + 3402e13 commit 413b12e

File tree

324 files changed

+8886
-4561
lines changed

Some content is hidden

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

324 files changed

+8886
-4561
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 2 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:
@@ -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,10 +655,17 @@ jobs:
654655
build_ubuntu,
655656
build_ubuntu_ssltests,
656657
build_wasi,
657-
build_windows,
658658
build_asan,
659659
build_tsan,
660660
test_hypothesis,
661+
cross-build-linux,
662+
'
663+
|| ''
664+
}}
665+
${{
666+
!fromJSON(needs.build-context.outputs.run-windows-tests)
667+
&& '
668+
build_windows,
661669
'
662670
|| ''
663671
}}

.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/tail-call.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
- 'Python/bytecodes.c'
66
- 'Python/ceval.c'
77
- 'Python/ceval_macros.h'
8+
- 'Python/generated_cases.c.h'
89
push:
910
paths:
1011
- 'Python/bytecodes.c'
1112
- 'Python/ceval.c'
1213
- 'Python/ceval_macros.h'
14+
- 'Python/generated_cases.c.h'
1315
workflow_dispatch:
1416

1517
permissions:
@@ -39,6 +41,7 @@ jobs:
3941
- aarch64-apple-darwin/clang
4042
- x86_64-unknown-linux-gnu/gcc
4143
- aarch64-unknown-linux-gnu/gcc
44+
- free-threading
4245
llvm:
4346
- 19
4447
include:
@@ -63,6 +66,9 @@ jobs:
6366
- target: aarch64-unknown-linux-gnu/gcc
6467
architecture: aarch64
6568
runner: ubuntu-22.04-arm
69+
- target: free-threading
70+
architecture: x86_64
71+
runner: ubuntu-24.04
6672
steps:
6773
- uses: actions/checkout@v4
6874
with:
@@ -103,11 +109,20 @@ jobs:
103109
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
104110
105111
- name: Native Linux (release)
106-
if: runner.os == 'Linux'
112+
if: runner.os == 'Linux' && matrix.target != 'free-threading'
107113
run: |
108114
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
109115
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
110116
CC=clang-19 ./configure --with-tail-call-interp
111117
make all --jobs 4
112118
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
113119
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Direct API functions
7676
Resize the internal buffer of *bytearray* to *len*.
7777
Failure is a ``-1`` return with an exception set.
7878
79-
.. versionchanged:: next
79+
.. versionchanged:: 3.14
8080
A negative *len* will now result in an exception being set and -1 returned.
8181
8282

Doc/c-api/init.rst

Lines changed: 4 additions & 4 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

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+
10000 .. 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: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,8 @@ the Python configuration.
256256
257257
.. c:function:: int Py_UNICODE_ISPRINTABLE(Py_UCS4 ch)
258258
259-
Return ``1`` or ``0`` depending on whether *ch* is a printable character.
260-
Nonprintable characters are those characters defined in the Unicode character
261-
database as "Other" or "Separator", excepting the ASCII space (0x20) which is
262-
considered printable. (Note that printable characters in this context are
263-
those which should not be escaped when :func:`repr` is invoked on a string.
264-
It has no bearing on the handling of strings written to :data:`sys.stdout` or
265-
:data:`sys.stderr`.)
259+
Return ``1`` or ``0`` depending on whether *ch* is a printable character,
260+
in the sense of :meth:`str.isprintable`.
266261
267262
268263
These APIs can be used for fast direct character conversions:
@@ -1352,6 +1347,13 @@ the user settings on the machine running the codec.
13521347
in *consumed*.
13531348
13541349
1350+
.. c:function:: PyObject* PyUnicode_DecodeCodePageStateful(int code_page, const char *str, \
1351+
Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
1352+
1353+
Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page
1354+
specified by *code_page*.
1355+
1356+
13551357
.. c:function:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
13561358
13571359
Encode a Unicode object using MBCS and return the result as Python bytes

Doc/data/refcounts.dat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,13 @@ PyUnicode_DecodeMBCSStateful:Py_ssize_t:size::
26362636
PyUnicode_DecodeMBCSStateful:const char*:errors::
26372637
PyUnicode_DecodeMBCSStateful:Py_ssize_t*:consumed::
26382638

2639+
PyUnicode_DecodeCodePageStateful:PyObject*::+1:
2640+
PyUnicode_DecodeCodePageStateful:int:code_page::
2641+
PyUnicode_DecodeCodePageStateful:const char*:s::
2642+
PyUnicode_DecodeCodePageStateful:Py_ssize_t:size::
2643+
PyUnicode_DecodeCodePageStateful:const char*:errors::
2644+
PyUnicode_DecodeCodePageStateful:Py_ssize_t*:consumed::
2645+
26392646
PyUnicode_EncodeCodePage:PyObject*::+1:
26402647
PyUnicode_EncodeCodePage:int:code_page::
26412648
PyUnicode_EncodeCodePage:PyObject*:unicode:0:

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Pending removal in Python 3.15
2929
* The :option:`!--cgi` flag to the :program:`python -m http.server`
3030
command-line interface has been deprecated since Python 3.13.
3131

32+
* :mod:`importlib`:
33+
34+
* ``load_module()`` method: use ``exec_module()`` instead.
35+
3236
* :class:`locale`:
3337

3438
* The :func:`~locale.getdefaultlocale` function
@@ -92,3 +96,9 @@ Pending removal in Python 3.15
9296
and :meth:`~wave.Wave_read.getmarkers` methods of
9397
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes
9498
have been deprecated since Python 3.13.
99+
100+
* :mod:`zipimport`:
101+
102+
* :meth:`~zipimport.zipimporter.load_module` has been deprecated since
103+
Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead.
104+
(Contributed by Jiahao Li in :gh:`125746`.)

0 commit comments

Comments
 (0)
0