Skip to content

Commit 06fa1ad

Browse files
authored
Merge branch 'python:main' into main
2 parents f226e21 + c35b33b commit 06fa1ad

File tree

924 files changed

+15382
-4805
lines changed

Some content is hidden

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

924 files changed

+15382
-4805
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ body:
3434
label: "CPython versions tested on:"
3535
multiple: true
3636
options:
37-
- "3.8"
3837
- "3.9"
3938
- "3.10"
4039
- "3.11"
4140
- "3.12"
4241
- "3.13"
42+
- "3.14"
4343
- "CPython main branch"
4444
validations:
4545
required: true

.github/ISSUE_TEMPLATE/crash.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ body:
2727
label: "CPython versions tested on:"
2828
multiple: true
2929
options:
30-
- "3.8"
3130
- "3.9"
3231
- "3.10"
3332
- "3.11"
3433
- "3.12"
3534
- "3.13"
35+
- "3.14"
3636
- "CPython main branch"
3737
validations:
3838
required: true

.github/workflows/build.yml

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,50 @@ jobs:
4040
if: fromJSON(needs.check_source.outputs.run-docs)
4141
uses: ./.github/workflows/reusable-docs.yml
4242

43+
check_autoconf_regen:
44+
name: 'Check if Autoconf files are up to date'
45+
# Don't use ubuntu-latest but a specific version to make the job
46+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
47+
runs-on: ubuntu-24.04
48+
container:
49+
image: ghcr.io/python/autoconf:2024.10.11.11293396815
50+
timeout-minutes: 60
51+
needs: check_source
52+
if: needs.check_source.outputs.run_tests == 'true'
53+
steps:
54+
- name: Install Git
55+
run: |
56+
apt install git -yq
57+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
58+
- uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 1
61+
- name: Runner image version
62+
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
63+
- name: Check Autoconf and aclocal versions
64+
run: |
65+
grep "Generated by GNU Autoconf 2.71" configure
66+
grep "aclocal 1.16.5" aclocal.m4
67+
grep -q "runstatedir" configure
68+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
69+
- name: Regenerate autoconf files
70+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
71+
run: autoreconf -ivf -Werror
72+
- name: Check for changes
73+
run: |
74+
git add -u
75+
changes=$(git status --porcelain)
76+
# Check for changes in regenerated files
77+
if test -n "$changes"; then
78+
echo "Generated files not up to date."
79+
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
80+
echo "configure files must be regenerated with a specific version of autoconf."
81+
echo "$changes"
82+
echo ""
83+
git diff --staged || true
84+
exit 1
85+
fi
86+
4387
check_generated_files:
4488
name: 'Check if generated files are up to date'
4589
# Don't use ubuntu-latest but a specific version to make the job
@@ -69,19 +113,10 @@ jobs:
69113
uses: hendrikmuhs/[email protected]
70114
with:
71115
save: false
72-
- name: Check Autoconf and aclocal versions
73-
run: |
74-
grep "Generated by GNU Autoconf 2.71" configure
75-
grep "aclocal 1.16.5" aclocal.m4
76-
grep -q "runstatedir" configure
77-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
78116
- name: Configure CPython
79117
run: |
80118
# Build Python with the libpython dynamic library
81119
./configure --config-cache --with-pydebug --enable-shared
82-
- name: Regenerate autoconf files
83-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
84-
run: autoreconf -ivf -Werror
85120
- name: Build CPython
86121
run: |
87122
make -j4 regen-all
@@ -501,6 +536,7 @@ jobs:
501536
needs:
502537
- check_source # Transitive dependency, needed to access `run_tests` value
503538
- check-docs
539+
- check_autoconf_regen
504540
- check_generated_files
505541
- build_macos
506542
- build_ubuntu
@@ -536,6 +572,7 @@ jobs:
536572
${{
537573
needs.check_source.outputs.run_tests != 'true'
538574
&& '
575+
check_autoconf_regen,
539576
check_generated_files,
540577
build_macos,
541578
build_ubuntu,

.github/workflows/mypy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/checkout@v4
5454
- uses: actions/setup-python@v5
5555
with:
56-
python-version: "3.11"
56+
python-version: "3.13"
5757
cache: pip
5858
cache-dependency-path: Tools/requirements-dev.txt
5959
- run: pip install -r Tools/requirements-dev.txt

.github/workflows/posix-deps-apt.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/sh
22
apt-get update
33

4-
# autoconf-archive is needed by autoreconf (check_generated_files job)
54
apt-get -yq install \
65
build-essential \
76
pkg-config \
8-
autoconf-archive \
97
ccache \
108
gdb \
119
lcov \

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- name: 'Set up Python'
8585
uses: actions/setup-python@v5
8686
with:
87-
python-version: '3.12' # known to work with Sphinx 6.2.1
87+
python-version: '3.13' # known to work with Sphinx 7.2.6
8888
cache: 'pip'
8989
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
9090
- name: 'Install build dependencies'

Doc/c-api/init.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ Process-wide parameters
625625
returned string points into static storage; the caller should not modify its
626626
value. This corresponds to the :makevar:`prefix` variable in the top-level
627627
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
628-
script at build time. The value is available to Python code as ``sys.prefix``.
628+
script at build time. The value is available to Python code as ``sys.base_prefix``.
629629
It is only useful on Unix. See also the next function.
630630
631631
This function should not be called before :c:func:`Py_Initialize`, otherwise
@@ -635,7 +635,8 @@ Process-wide parameters
635635
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
636636
637637
.. deprecated-removed:: 3.13 3.15
638-
Get :data:`sys.prefix` instead.
638+
Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if
639+
:ref:`virtual environments <venv-def>` need to be handled.
639640
640641
641642
.. c:function:: wchar_t* Py_GetExecPrefix()
@@ -648,7 +649,8 @@ Process-wide parameters
648649
should not modify its value. This corresponds to the :makevar:`exec_prefix`
649650
variable in the top-level :file:`Makefile` and the ``--exec-prefix``
650651
argument to the :program:`configure` script at build time. The value is
651-
available to Python code as ``sys.exec_prefix``. It is only useful on Unix.
652+
available to Python code as ``sys.base_exec_prefix``. It is only useful on
653+
Unix.
652654
653655
Background: The exec-prefix differs from the prefix when platform dependent
654656
files (such as executables and shared libraries) are installed in a different
@@ -679,7 +681,8 @@ Process-wide parameters
679681
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
680682
681683
.. deprecated-removed:: 3.13 3.15
682-
Get :data:`sys.exec_prefix` instead.
684+
Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if
685+
:ref:`virtual environments <venv-def>` need to be handled.
683686
684687
685688
.. c:function:: wchar_t* Py_GetProgramFullPath()
@@ -1195,7 +1198,7 @@ code, or when embedding the Python interpreter:
11951198
created by Python. Refer to
11961199
:ref:`cautions-regarding-runtime-finalization` for more details.
11971200
1198-
.. versionchanged:: next
1201+
.. versionchanged:: 3.14
11991202
Hangs the current thread, rather than terminating it, if called while the
12001203
interpreter is finalizing.
12011204
@@ -1257,7 +1260,7 @@ with sub-interpreters:
12571260
created by Python. Refer to
12581261
:ref:`cautions-regarding-runtime-finalization` for more details.
12591262
1260-
.. versionchanged:: next
1263+
.. versionchanged:: 3.14
12611264
Hangs the current thread, rather than terminating it, if called while the
12621265
interpreter is finalizing.
12631266
@@ -1547,7 +1550,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
15471550
:c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`,
15481551
and terminate the current thread if called while the interpreter is finalizing.
15491552
1550-
.. versionchanged:: next
1553+
.. versionchanged:: 3.14
15511554
Hangs the current thread, rather than terminating it, if called while the
15521555
interpreter is finalizing.
15531556
@@ -2418,7 +2421,7 @@ Example usage::
24182421
24192422
In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which
24202423
can call arbitrary code through an object's deallocation function. The critical
2421-
section API avoids potentital deadlocks due to reentrancy and lock ordering
2424+
section API avoids potential deadlocks due to reentrancy and lock ordering
24222425
by allowing the runtime to temporarily suspend the critical section if the
24232426
code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
24242427

Doc/c-api/init_config.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,8 @@ Create Config
16211621
16221622
Free memory of the initialization configuration *config*.
16231623
1624+
If *config* is ``NULL``, no operation is performed.
1625+
16241626
16251627
Error Handling
16261628
--------------
@@ -1823,14 +1825,18 @@ return ``-1`` on error:
18231825
PyInitConfig_Free(config);
18241826
return 0;
18251827
1826-
// Display the error message
1827-
const char *err_msg;
18281828
error:
1829-
(void)PyInitConfig_GetError(config, &err_msg);
1830-
printf("PYTHON INIT ERROR: %s\n", err_msg);
1831-
PyInitConfig_Free(config);
1829+
{
1830+
// Display the error message
1831+
// This uncommon braces style is used, because you cannot make
1832+
// goto targets point to variable declarations.
1833+
const char *err_msg;
1834+
(void)PyInitConfig_GetError(config, &err_msg);
1835+
printf("PYTHON INIT ERROR: %s\n", err_msg);
1836+
PyInitConfig_Free(config);
18321837
1833-
return -1;
1838+
return -1;
1839+
}
18341840
}
18351841
18361842

Doc/c-api/long.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
511511
free(bignum);
512512
513513
*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults
514-
that behave most like a C cast, or a combintation of the other flags in
514+
that behave most like a C cast, or a combination of the other flags in
515515
the table below.
516516
Note that ``-1`` cannot be combined with other flags.
517517
@@ -579,7 +579,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
579579
On failure, return -1 with an exception set. This function always succeeds
580580
if *obj* is a :c:type:`PyLongObject` or its subtype.
581581
582-
.. versionadded:: next
582+
.. versionadded:: 3.14
583583
584584
585585
.. c:function:: PyObject* PyLong_GetInfo(void)

Doc/c-api/monitoring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ would typically correspond to a python function.
147147
148148
The ``version`` argument is a pointer to a value which should be allocated
149149
by the user together with ``state_array`` and initialized to 0,
150-
and then set only by :c:func:`!PyMonitoring_EnterScope` itelf. It allows this
150+
and then set only by :c:func:`!PyMonitoring_EnterScope` itself. It allows this
151151
function to determine whether event states have changed since the previous call,
152152
and to return quickly if they have not.
153153

0 commit comments

Comments
 (0)