Skip to content

Commit 76b2ee6

Browse files
committed
Merge branch 'master' into save-python/151464
2 parents 8b5f1e4 + fe7717c commit 76b2ee6

423 files changed

Lines changed: 18954 additions & 16517 deletions

File tree

Some content is hidden

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

‎.claude/CLAUDE.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎.github/workflows/reusable-wasi.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-26.04-arm
1616
timeout-minutes: 60
1717
env:
18-
WASMTIME_VERSION: 38.0.3
18+
WASMTIME_VERSION: 48.0.2
1919
CROSS_BUILD_WASI: cross-build/wasm32-wasip1
2020
steps:
2121
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

‎.pre-commit-config.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ repos:
143143
entry: Space found in path, move to Misc/NEWS.d/next/Core_and_Builtins/
144144
files: Misc/NEWS.d/next/Core and Builtins/20.*.rst
145145

146+
- repo: local
147+
hooks:
148+
- id: check-capi-macros
149+
name: Check C API macros start with Py
150+
language: python
151+
entry: python Tools/build/check_capi_macros.py
152+
pass_filenames: false
153+
files: ^(Include/(cpython/)?[^/]+\.h|pyconfig\.h\.in|Tools/build/check_capi_macros)
154+
146155
- repo: meta
147156
hooks:
148157
- id: check-hooks-apply

‎Doc/Makefile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ lock:
191191
# Dependencies have a 14 day cooldown period to mitigate supply chain attacks,
192192
# except for sphinx_linklint and python-docs-theme, which are maintained by
193193
# core team members.
194-
uv pip compile requirements.txt \
195-
--exclude-newer P14D \
194+
$(UV) pip compile requirements.txt \
195+
--upgrade --exclude-newer P14D \
196196
--exclude-newer-package sphinx_linklint=PT0S \
197197
--exclude-newer-package python-docs-theme=PT0S \
198198
--no-cache --output-file $(REQUIREMENTS) \

‎Doc/builtins/functions.rst‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,14 @@ are always available. They are listed here in alphabetical order.
384384
It is needed to unambiguous :ref:`filter <warning-filter>` syntax warnings
385385
by module name.
386386

387-
This function raises :exc:`SyntaxError` or :exc:`ValueError` if the compiled
388-
source is invalid.
387+
This function raises :exc:`SyntaxError` if the compiled source is invalid,
388+
including a *source* containing a null character or that cannot be decoded;
389+
:exc:`ValueError` if *mode* or *flags* is invalid,
390+
or if a string *source* contains surrogate characters;
391+
:exc:`MemoryError` or :exc:`RecursionError` if *source* is too complex
392+
to parse or compile,
393+
for example an expression with many thousands of nested operators;
394+
and :exc:`OverflowError` if *source* is too large.
389395

390396
If you want to parse Python code into its AST representation, see
391397
:func:`ast.parse`.
@@ -417,11 +423,15 @@ are always available. They are listed here in alphabetical order.
417423
Previously, :exc:`TypeError` was raised when null bytes were encountered
418424
in *source*.
419425

420-
.. versionadded:: 3.8
426+
.. versionchanged:: 3.8
421427
``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable
422428
support for top-level ``await``, ``async for``, and ``async with``.
423429

424-
.. versionadded:: 3.15
430+
.. versionchanged:: 3.12
431+
:exc:`SyntaxError` is raised instead of :exc:`ValueError` when null bytes
432+
are encountered in *source*.
433+
434+
.. versionchanged:: 3.15
425435
Added the *module* parameter.
426436

427437

‎Doc/c-api/init_config.rst‎

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,14 @@ Error Handling
116116
117117
Get the *config* exit code.
118118
119-
* Set *\*exitcode* and return ``1`` if *config* has an exit code set.
120-
* Return ``0`` if *config* has no exit code set.
119+
Return ``0`` and leave *\*exitcode* unchanged.
121120
122-
Only the ``Py_InitializeFromInitConfig()`` function can set an exit
123-
code if the ``parse_argv`` option is non-zero.
121+
In Python 3.15, :c:func:`Py_InitializeFromInitConfig` sets an exit code if a
122+
command line option wants to exit Python. This is no longer the case in
123+
Python 3.16. Instead, the option is now processed in :c:func:`Py_RunMain`.
124+
This function became useless.
124125
125-
An exit code can be set when parsing the command line failed (exit
126-
code ``2``) or when a command line option asks to display the command
127-
line help (exit code ``0``).
126+
.. deprecated:: next
128127
129128
130129
Get Options
@@ -247,10 +246,11 @@ Initialize Python
247246
248247
* Return ``0`` on success.
249248
* Set an error in *config* and return ``-1`` on error.
250-
* Set an exit code in *config* and return ``-1`` if Python wants to
251-
exit.
252249
253-
See ``PyInitConfig_GetExitcode()`` for the exit code case.
250+
.. versionchanged:: next
251+
The function no longer sets an exit code if a command line option wants
252+
to exit Python. Instead, the option is now processed in
253+
:c:func:`Py_RunMain`.
254254
255255
256256
.. _pyinitconfig-opts:
@@ -690,9 +690,6 @@ Example of customized Python always running in isolated mode::
690690
691691
exception:
692692
PyConfig_Clear(&config);
693-
if (PyStatus_IsExit(status)) {
694-
return status.exitcode;
695-
}
696693
/* Display the error message and exit the process with
697694
non-zero exit code */
698695
Py_ExitStatusException(status);
@@ -758,6 +755,8 @@ PyStatus
758755
759756
Exit code. Argument passed to ``exit()``.
760757
758+
.. deprecated:: next
759+
761760
.. c:member:: const char *err_msg
762761
763762
Error message.
@@ -788,6 +787,11 @@ PyStatus
788787
789788
Exit Python with the specified exit code.
790789
790+
.. deprecated:: next
791+
:c:func:`Py_InitializeFromConfig` no longer sets an exit code if a
792+
command line option wants to exit Python. Instead, the option is
793+
now processed in :c:func:`Py_RunMain`.
794+
791795
Functions to handle a status:
792796
793797
.. c:function:: int PyStatus_Exception(PyStatus status)
@@ -803,6 +807,11 @@ PyStatus
803807
804808
Is the result an exit?
805809
810+
.. deprecated:: next
811+
:c:func:`Py_InitializeFromConfig` no longer sets an exit code if a
812+
command line option wants to exit Python. Instead, the option is
813+
now processed in :c:func:`Py_RunMain`.
814+
806815
.. c:function:: void Py_ExitStatusException(PyStatus status)
807816
808817
Call ``exit(exitcode)`` if *status* is an exit. Print the error

0 commit comments

Comments
 (0)