Skip to content

Commit ddb90e5

Browse files
authored
Merge branch 'main' into patch-4
2 parents e25168d + 3e23047 commit ddb90e5

File tree

545 files changed

+9362
-5895
lines changed

Some content is hidden

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

545 files changed

+9362
-5895
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ Lib/test/test_interpreters/ @ericsnowcurrently
298298
**/*-ios* @freakboy3742
299299

300300
# WebAssembly
301-
/Tools/wasm/ @brettcannon @freakboy3742
301+
Tools/wasm/config.site-wasm32-emscripten @freakboy3742
302+
/Tools/wasm/README.md @brettcannon @freakboy3742
303+
/Tools/wasm/wasi-env @brettcannon
304+
/Tools/wasm/wasi.py @brettcannon
305+
/Tools/wasm/emscripten @freakboy3742
306+
/Tools/wasm/wasi @brettcannon
302307

303308
# SBOM
304309
/Misc/externals.spdx.json @sethmlarson

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ body:
4040
- "3.12"
4141
- "3.13"
4242
- "3.14"
43+
- "3.15"
4344
- "CPython main branch"
4445
validations:
4546
required: true

.github/ISSUE_TEMPLATE/crash.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ body:
3333
- "3.12"
3434
- "3.13"
3535
- "3.14"
36+
- "3.15"
3637
- "CPython main branch"
3738
validations:
3839
required: true

.github/workflows/mypy.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ on:
1313
- "Lib/test/libregrtest/**"
1414
- "Lib/tomllib/**"
1515
- "Misc/mypy/**"
16+
- "Tools/build/compute-changes.py"
1617
- "Tools/build/generate_sbom.py"
18+
- "Tools/build/generate-build-details.py"
19+
- "Tools/build/verify_ensurepip_wheels.py"
20+
- "Tools/build/update_file.py"
1721
- "Tools/cases_generator/**"
1822
- "Tools/clinic/**"
1923
- "Tools/jit/**"
2024
- "Tools/peg_generator/**"
2125
- "Tools/requirements-dev.txt"
22-
- "Tools/wasm/**"
2326
workflow_dispatch:
2427

2528
permissions:
@@ -51,7 +54,6 @@ jobs:
5154
"Tools/clinic",
5255
"Tools/jit",
5356
"Tools/peg_generator",
54-
"Tools/wasm",
5557
]
5658
steps:
5759
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ repos:
4747
exclude: Lib/test/tokenizedata/coding20731.py
4848
- id: trailing-whitespace
4949
types_or: [c, inc, python, rst]
50+
- id: trailing-whitespace
51+
files: '\.(gram)$'
5052

5153
- repo: https://github.com/python-jsonschema/check-jsonschema
5254
rev: 0.33.0

Doc/c-api/arg.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ small to receive the value.
274274
Convert a Python integer to a C :c:expr:`unsigned long` without
275275
overflow checking.
276276

277-
.. versionchanged:: next
277+
.. versionchanged:: 3.14
278278
Use :meth:`~object.__index__` if available.
279279

280280
``L`` (:class:`int`) [long long]
@@ -284,7 +284,7 @@ small to receive the value.
284284
Convert a Python integer to a C :c:expr:`unsigned long long`
285285
without overflow checking.
286286

287-
.. versionchanged:: next
287+
.. versionchanged:: 3.14
288288
Use :meth:`~object.__index__` if available.
289289

290290
``n`` (:class:`int`) [:c:type:`Py_ssize_t`]
@@ -380,10 +380,10 @@ Other objects
380380
The *converter* for the ``O&`` format unit in *items* must not store
381381
a borrowed buffer or a borrowed reference.
382382

383-
.. versionchanged:: next
383+
.. versionchanged:: 3.14
384384
:class:`str` and :class:`bytearray` objects no longer accepted as a sequence.
385385

386-
.. deprecated:: next
386+
.. deprecated:: 3.14
387387
Non-tuple sequences are deprecated if *items* contains format units
388388
which store a borrowed buffer or a borrowed reference.
389389

@@ -396,7 +396,7 @@ Other objects
396396
If the argument is not ``None``, it is parsed according to the specified
397397
format unit.
398398

399-
.. versionadded:: next
399+
.. versionadded:: 3.14
400400

401401
A few other characters have a meaning in a format string. These may not occur
402402
inside nested parentheses. They are:

Doc/c-api/import.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ Importing Modules
1616
This is a wrapper around :c:func:`PyImport_Import()` which takes a
1717
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
1818
19-
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
20-
21-
This function is a deprecated alias of :c:func:`PyImport_ImportModule`.
22-
23-
.. versionchanged:: 3.3
24-
This function used to fail immediately when the import lock was held
25-
by another thread. In Python 3.3 though, the locking scheme switched
26-
to per-module locks for most purposes, so this function's special
27-
behaviour isn't needed anymore.
28-
29-
.. deprecated-removed:: 3.13 3.15
30-
Use :c:func:`PyImport_ImportModule` instead.
31-
3219
3320
.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
3421

Doc/c-api/init.rst

Lines changed: 3 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ The following functions can be safely called before Python is initialized:
7777

7878
Despite their apparent similarity to some of the functions listed above,
7979
the following functions **should not be called** before the interpreter has
80-
been initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
81-
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
82-
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`,
83-
:c:func:`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and
80+
been initialized: :c:func:`Py_EncodeLocale`, :c:func:`PyEval_InitThreads`, and
8481
:c:func:`Py_RunMain`.
8582

8683

@@ -145,9 +142,6 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
145142
:c:member:`PyConfig.pathconfig_warnings` should be used instead, see
146143
:ref:`Python Initialization Configuration <init-config>`.
147144

148-
Suppress error messages when calculating the module search path in
149-
:c:func:`Py_GetPath`.
150-
151145
Private flag used by ``_freeze_module`` and ``frozenmain`` programs.
152146

153147
.. deprecated-removed:: 3.12 3.15
@@ -203,7 +197,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
203197

204198
Set by the :option:`-i` option.
205199

206-
.. deprecated:: 3.12
200+
.. deprecated-removed:: 3.12 3.15
207201

208202
.. c:var:: int Py_IsolatedFlag
209203
@@ -586,7 +580,6 @@ Process-wide parameters
586580
.. index::
587581
single: Py_Initialize()
588582
single: main()
589-
single: Py_GetPath()
590583
591584
This API is kept for backward compatibility: setting
592585
:c:member:`PyConfig.program_name` should be used instead, see :ref:`Python
@@ -596,7 +589,7 @@ Process-wide parameters
596589
the first time, if it is called at all. It tells the interpreter the value
597590
of the ``argv[0]`` argument to the :c:func:`main` function of the program
598591
(converted to wide characters).
599-
This is used by :c:func:`Py_GetPath` and some other functions below to find
592+
This is used by some other functions below to find
600593
the Python run-time libraries relative to the interpreter executable. The
601594
default value is ``'python'``. The argument should point to a
602595
zero-terminated wide character string in static storage whose contents will not
@@ -609,146 +602,6 @@ Process-wide parameters
609602
.. deprecated-removed:: 3.11 3.15
610603
611604
612-
.. c:function:: wchar_t* Py_GetProgramName()
613-
614-
Return the program name set with :c:member:`PyConfig.program_name`, or the default.
615-
The returned string points into static storage; the caller should not modify its
616-
value.
617-
618-
This function should not be called before :c:func:`Py_Initialize`, otherwise
619-
it returns ``NULL``.
620-
621-
.. versionchanged:: 3.10
622-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
623-
624-
.. deprecated-removed:: 3.13 3.15
625-
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
626-
(:data:`sys.executable`) instead.
627-
628-
629-
.. c:function:: wchar_t* Py_GetPrefix()
630-
631-
Return the *prefix* for installed platform-independent files. This is derived
632-
through a number of complicated rules from the program name set with
633-
:c:member:`PyConfig.program_name` and some environment variables; for example, if the
634-
program name is ``'/usr/local/bin/python'``, the prefix is ``'/usr/local'``. The
635-
returned string points into static storage; the caller should not modify its
636-
value. This corresponds to the :makevar:`prefix` variable in the top-level
637-
:file:`Makefile` and the :option:`--prefix` argument to the :program:`configure`
638-
script at build time. The value is available to Python code as ``sys.base_prefix``.
639-
It is only useful on Unix. See also the next function.
640-
641-
This function should not be called before :c:func:`Py_Initialize`, otherwise
642-
it returns ``NULL``.
643-
644-
.. versionchanged:: 3.10
645-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
646-
647-
.. deprecated-removed:: 3.13 3.15
648-
Use :c:func:`PyConfig_Get("base_prefix") <PyConfig_Get>`
649-
(:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get("prefix")
650-
<PyConfig_Get>` (:data:`sys.prefix`) if :ref:`virtual environments
651-
<venv-def>` need to be handled.
652-
653-
654-
.. c:function:: wchar_t* Py_GetExecPrefix()
655-
656-
Return the *exec-prefix* for installed platform-*dependent* files. This is
657-
derived through a number of complicated rules from the program name set with
658-
:c:member:`PyConfig.program_name` and some environment variables; for example, if the
659-
program name is ``'/usr/local/bin/python'``, the exec-prefix is
660-
``'/usr/local'``. The returned string points into static storage; the caller
661-
should not modify its value. This corresponds to the :makevar:`exec_prefix`
662-
variable in the top-level :file:`Makefile` and the ``--exec-prefix``
663-
argument to the :program:`configure` script at build time. The value is
664-
available to Python code as ``sys.base_exec_prefix``. It is only useful on
665-
Unix.
666-
667-
Background: The exec-prefix differs from the prefix when platform dependent
668-
files (such as executables and shared libraries) are installed in a different
669-
directory tree. In a typical installation, platform dependent files may be
670-
installed in the :file:`/usr/local/plat` subtree while platform independent may
671-
be installed in :file:`/usr/local`.
672-
673-
Generally speaking, a platform is a combination of hardware and software
674-
families, e.g. Sparc machines running the Solaris 2.x operating system are
675-
considered the same platform, but Intel machines running Solaris 2.x are another
676-
platform, and Intel machines running Linux are yet another platform. Different
677-
major revisions of the same operating system generally also form different
678-
platforms. Non-Unix operating systems are a different story; the installation
679-
strategies on those systems are so different that the prefix and exec-prefix are
680-
meaningless, and set to the empty string. Note that compiled Python bytecode
681-
files are platform independent (but not independent from the Python version by
682-
which they were compiled!).
683-
684-
System administrators will know how to configure the :program:`mount` or
685-
:program:`automount` programs to share :file:`/usr/local` between platforms
686-
while having :file:`/usr/local/plat` be a different filesystem for each
687-
platform.
688-
689-
This function should not be called before :c:func:`Py_Initialize`, otherwise
690-
it returns ``NULL``.
691-
692-
.. versionchanged:: 3.10
693-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
694-
695-
.. deprecated-removed:: 3.13 3.15
696-
Use :c:func:`PyConfig_Get("base_exec_prefix") <PyConfig_Get>`
697-
(:data:`sys.base_exec_prefix`) instead. Use
698-
:c:func:`PyConfig_Get("exec_prefix") <PyConfig_Get>`
699-
(:data:`sys.exec_prefix`) if :ref:`virtual environments <venv-def>` need
700-
to be handled.
701-
702-
.. c:function:: wchar_t* Py_GetProgramFullPath()
703-
704-
.. index::
705-
single: executable (in module sys)
706-
707-
Return the full program name of the Python executable; this is computed as a
708-
side-effect of deriving the default module search path from the program name
709-
(set by :c:member:`PyConfig.program_name`). The returned string points into
710-
static storage; the caller should not modify its value. The value is available
711-
to Python code as ``sys.executable``.
712-
713-
This function should not be called before :c:func:`Py_Initialize`, otherwise
714-
it returns ``NULL``.
715-
716-
.. versionchanged:: 3.10
717-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
718-
719-
.. deprecated-removed:: 3.13 3.15
720-
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
721-
(:data:`sys.executable`) instead.
722-
723-
724-
.. c:function:: wchar_t* Py_GetPath()
725-
726-
.. index::
727-
triple: module; search; path
728-
single: path (in module sys)
729-
730-
Return the default module search path; this is computed from the program name
731-
(set by :c:member:`PyConfig.program_name`) and some environment variables.
732-
The returned string consists of a series of directory names separated by a
733-
platform dependent delimiter character. The delimiter character is ``':'``
734-
on Unix and macOS, ``';'`` on Windows. The returned string points into
735-
static storage; the caller should not modify its value. The list
736-
:data:`sys.path` is initialized with this value on interpreter startup; it
737-
can be (and usually is) modified later to change the search path for loading
738-
modules.
739-
740-
This function should not be called before :c:func:`Py_Initialize`, otherwise
741-
it returns ``NULL``.
742-
743-
.. XXX should give the exact rules
744-
745-
.. versionchanged:: 3.10
746-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
747-
748-
.. deprecated-removed:: 3.13 3.15
749-
Use :c:func:`PyConfig_Get("module_search_paths") <PyConfig_Get>`
750-
(:data:`sys.path`) instead.
751-
752605
.. c:function:: const char* Py_GetVersion()
753606
754607
Return the version of this Python interpreter. This is a string that looks
@@ -919,23 +772,6 @@ Process-wide parameters
919772
.. deprecated-removed:: 3.11 3.15
920773
921774
922-
.. c:function:: wchar_t* Py_GetPythonHome()
923-
924-
Return the default "home", that is, the value set by
925-
:c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME`
926-
environment variable if it is set.
927-
928-
This function should not be called before :c:func:`Py_Initialize`, otherwise
929-
it returns ``NULL``.
930-
931-
.. versionchanged:: 3.10
932-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
933-
934-
.. deprecated-removed:: 3.13 3.15
935-
Use :c:func:`PyConfig_Get("home") <PyConfig_Get>` or the
936-
:envvar:`PYTHONHOME` environment variable instead.
937-
938-
939775
.. _threads:
940776
941777
Thread State and the Global Interpreter Lock

Doc/c-api/init_config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1486,7 +1486,7 @@ PyConfig
14861486
14871487
Default: ``0``.
14881488
1489-
.. versionchanged:: next
1489+
.. versionchanged:: 3.14
14901490
14911491
Added support for ``import_time = 2``
14921492

Doc/c-api/intro.rst

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -779,20 +779,11 @@ found along :envvar:`PATH`.) The user can override this behavior by setting the
779779
environment variable :envvar:`PYTHONHOME`, or insert additional directories in
780780
front of the standard path by setting :envvar:`PYTHONPATH`.
781781

782-
.. index::
783-
single: Py_GetPath (C function)
784-
single: Py_GetPrefix (C function)
785-
single: Py_GetExecPrefix (C function)
786-
single: Py_GetProgramFullPath (C function)
787-
788782
The embedding application can steer the search by setting
789783
:c:member:`PyConfig.program_name` *before* calling
790784
:c:func:`Py_InitializeFromConfig`. Note that
791785
:envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` is still
792-
inserted in front of the standard path. An application that requires total
793-
control has to provide its own implementation of :c:func:`Py_GetPath`,
794-
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and
795-
:c:func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`).
786+
inserted in front of the standard path.
796787

797788
.. index:: single: Py_IsInitialized (C function)
798789

@@ -826,14 +817,17 @@ frequently used builds will be described in the remainder of this section.
826817
827818
Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined produces
828819
what is generally meant by :ref:`a debug build of Python <debug-build>`.
829-
:c:macro:`!Py_DEBUG` is enabled in the Unix build by adding
830-
:option:`--with-pydebug` to the :file:`./configure` command.
831-
It is also implied by the presence of the
832-
not-Python-specific :c:macro:`!_DEBUG` macro. When :c:macro:`!Py_DEBUG` is enabled
833-
in the Unix build, compiler optimization is disabled.
820+
821+
On Unix, :c:macro:`!Py_DEBUG` can be enabled by adding :option:`--with-pydebug`
822+
to the :file:`./configure` command. This will also disable compiler optimization.
823+
824+
On Windows, selecting a debug build (e.g., by passing the :option:`-d` option to
825+
:file:`PCbuild/build.bat`) automatically enables :c:macro:`!Py_DEBUG`.
826+
Additionally, the presence of the not-Python-specific :c:macro:`!_DEBUG` macro,
827+
when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
834828

835829
In addition to the reference count debugging described below, extra checks are
836-
performed, see :ref:`Python Debug Build <debug-build>`.
830+
performed. See :ref:`Python Debug Build <debug-build>` for more details.
837831

838832
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
839833
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).

0 commit comments

Comments
 (0)