Skip to content

Commit 383f97a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into jit-stencil-initializers
2 parents 51618b6 + cda0ec8 commit 383f97a

File tree

891 files changed

+14158
-4840
lines changed

Some content is hidden

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

891 files changed

+14158
-4840
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,5 @@ Lib/test/test_configparser.py @jaraco
280280

281281
# Doc sections
282282
Doc/reference/ @willingc
283+
284+
**/*weakref* @kumaraditya303

.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/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/reusable-change-detection.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
---
2-
3-
name: Change detection
1+
name: Reusable change detection
42

53
on: # yamllint disable-line rule:truthy
64
workflow_call:

.github/workflows/reusable-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docs
1+
name: Reusable Docs
22

33
on:
44
workflow_call:
@@ -95,7 +95,7 @@ jobs:
9595
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
9696
doctest:
9797
name: 'Doctest'
98-
runs-on: ubuntu-latest
98+
runs-on: ubuntu-22.04
9999
timeout-minutes: 60
100100
steps:
101101
- uses: actions/checkout@v4

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable macOS
2+
13
on:
24
workflow_call:
35
inputs:

.github/workflows/reusable-tsan.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable Thread Sanitizer
2+
13
on:
24
workflow_call:
35
inputs:

.github/workflows/reusable-ubuntu.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable Ubuntu
2+
13
on:
24
workflow_call:
35
inputs:

.github/workflows/reusable-wasi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable WASI
2+
13
on:
24
workflow_call:
35
inputs:

.github/workflows/reusable-windows-msi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: TestsMSI
1+
name: Reusable Windows MSI
22

33
on:
44
workflow_call:

.github/workflows/reusable-windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable Windows
2+
13
on:
24
workflow_call:
35
inputs:

Doc/c-api/contextvars.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,18 @@ Context object management functions:
122122
.. c:type:: PyContextEvent
123123
124124
Enumeration of possible context object watcher events:
125-
- ``Py_CONTEXT_EVENT_ENTER``
126-
- ``Py_CONTEXT_EVENT_EXIT``
125+
126+
- ``Py_CONTEXT_SWITCHED``: The :term:`current context` has switched to a
127+
different context. The object passed to the watch callback is the
128+
now-current :class:`contextvars.Context` object, or None if no context is
129+
current.
127130
128131
.. versionadded:: 3.14
129132
130-
.. c:type:: int (*PyContext_WatchCallback)(PyContextEvent event, PyContext* ctx)
133+
.. c:type:: int (*PyContext_WatchCallback)(PyContextEvent event, PyObject *obj)
131134
132-
Type of a context object watcher callback function.
133-
If *event* is ``Py_CONTEXT_EVENT_ENTER``, then the callback is invoked
134-
after *ctx* has been set as the current context for the current thread.
135-
Otherwise, the callback is invoked before the deactivation of *ctx* as the current context
136-
and the restoration of the previous contex object for the current thread.
135+
Context object watcher callback function. The object passed to the callback
136+
is event-specific; see :c:type:`PyContextEvent` for details.
137137
138138
If the callback returns with an exception set, it must return ``-1``; this
139139
exception will be printed as an unraisable exception using

Doc/c-api/init.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ code, or when embedding the Python interpreter:
11951195
created by Python. Refer to
11961196
:ref:`cautions-regarding-runtime-finalization` for more details.
11971197
1198-
.. versionchanged:: next
1198+
.. versionchanged:: 3.14
11991199
Hangs the current thread, rather than terminating it, if called while the
12001200
interpreter is finalizing.
12011201
@@ -1257,7 +1257,7 @@ with sub-interpreters:
12571257
created by Python. Refer to
12581258
:ref:`cautions-regarding-runtime-finalization` for more details.
12591259
1260-
.. versionchanged:: next
1260+
.. versionchanged:: 3.14
12611261
Hangs the current thread, rather than terminating it, if called while the
12621262
interpreter is finalizing.
12631263
@@ -1547,7 +1547,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
15471547
:c:func:`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`,
15481548
and terminate the current thread if called while the interpreter is finalizing.
15491549
1550-
.. versionchanged:: next
1550+
.. versionchanged:: 3.14
15511551
Hangs the current thread, rather than terminating it, if called while the
15521552
interpreter is finalizing.
15531553

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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)
@@ -608,10 +608,15 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
608608
Exactly what values are considered compact is an implementation detail
609609
and is subject to change.
610610
611+
.. versionadded:: 3.12
612+
613+
611614
.. c:function:: Py_ssize_t PyUnstable_Long_CompactValue(const PyLongObject* op)
612615
613616
If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`,
614617
return its value.
615618
616619
Otherwise, the return value is undefined.
617620
621+
.. versionadded:: 3.12
622+

Doc/c-api/unicode.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ PyUnicodeWriter
15751575
The :c:type:`PyUnicodeWriter` API can be used to create a Python :class:`str`
15761576
object.
15771577
1578-
.. versionadded:: next
1578+
.. versionadded:: 3.14
15791579
15801580
.. c:type:: PyUnicodeWriter
15811581
@@ -1600,6 +1600,8 @@ object.
16001600
16011601
Discard the internal Unicode buffer and destroy the writer instance.
16021602
1603+
If *writer* is ``NULL``, no operation is performed.
1604+
16031605
.. c:function:: int PyUnicodeWriter_WriteChar(PyUnicodeWriter *writer, Py_UCS4 ch)
16041606
16051607
Write the single Unicode character *ch* into *writer*.

Doc/conf.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import sys
1212
import time
1313

14+
import sphinx
15+
1416
sys.path.append(os.path.abspath('tools/extensions'))
1517
sys.path.append(os.path.abspath('includes'))
1618

@@ -21,6 +23,7 @@
2123

2224
extensions = [
2325
'audit_events',
26+
'availability',
2427
'c_annotations',
2528
'glossary_search',
2629
'lexers',
@@ -61,7 +64,10 @@
6164

6265
# General substitutions.
6366
project = 'Python'
64-
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
67+
if sphinx.version_info[:2] >= (8, 1):
68+
copyright = "2001-%Y, Python Software Foundation"
69+
else:
70+
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
6571

6672
# We look for the Include/patchlevel.h file in the current Python source tree
6773
# and replace the values accordingly.
@@ -360,10 +366,14 @@
360366
}
361367

362368
# This 'Last updated on:' timestamp is inserted at the bottom of every page.
363-
html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
364-
html_last_updated_fmt = time.strftime(
365-
'%b %d, %Y (%H:%M UTC)', time.gmtime(html_time)
366-
)
369+
html_last_updated_fmt = '%b %d, %Y (%H:%M UTC)'
370+
if sphinx.version_info[:2] >= (8, 1):
371+
html_last_updated_use_utc = True
372+
else:
373+
html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
374+
html_last_updated_fmt = time.strftime(
375+
html_last_updated_fmt, time.gmtime(html_time)
376+
)
367377

368378
# Path to find HTML templates.
369379
templates_path = ['tools/templates']
@@ -595,13 +605,21 @@
595605
# mapping unique short aliases to a base URL and a prefix.
596606
# https://www.sphinx-doc.org/en/master/usage/extensions/extlinks.html
597607
extlinks = {
598-
"cve": ("https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s", "CVE-%s"),
599-
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
600608
"pypi": ("https://pypi.org/project/%s/", "%s"),
601609
"source": (SOURCE_URI, "%s"),
602610
}
603611
extlinks_detect_hardcoded_links = True
604612

613+
if sphinx.version_info[:2] < (8, 1):
614+
# Sphinx 8.1 has in-built CVE and CWE roles.
615+
extlinks |= {
616+
"cve": (
617+
"https://www.cve.org/CVERecord?id=CVE-%s",
618+
"CVE-%s",
619+
),
620+
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
621+
}
622+
605623
# Options for c_annotations
606624
# -------------------------
607625

Doc/deprecations/c-api-pending-removal-in-3.14.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Pending Removal in Python 3.14
1+
Pending removal in Python 3.14
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

44
* The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Pending Removal in Python 3.15
1+
Pending removal in Python 3.15
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

44
* The bundled copy of ``libmpdecimal``.

Doc/deprecations/c-api-pending-removal-in-future.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Pending Removal in Future Versions
1+
Pending removal in future versions
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

44
The following APIs are deprecated and will be removed,

Doc/deprecations/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Deprecations
77

88
.. include:: pending-removal-in-future.rst
99

10-
C API Deprecations
10+
C API deprecations
1111
------------------
1212

1313
.. include:: c-api-pending-removal-in-3.15.rst

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Pending Removal in Python 3.13
1+
Pending removal in Python 3.13
22
------------------------------
33

44
Modules (see :pep:`594`):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Pending Removal in Python 3.14
1+
Pending removal in Python 3.14
22
------------------------------
33

44
* The import system:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Pending Removal in Python 3.15
1+
Pending removal in Python 3.15
22
------------------------------
33

44
* The import system:
@@ -63,7 +63,7 @@ Pending Removal in Python 3.15
6363

6464
* The undocumented keyword argument syntax for creating
6565
:class:`~typing.NamedTuple` classes
66-
(e.g. ``Point = NamedTuple("Point", x=int, y=int)``)
66+
(for example, ``Point = NamedTuple("Point", x=int, y=int)``)
6767
has been deprecated since Python 3.13.
6868
Use the class-based syntax or the functional syntax instead.
6969

0 commit comments

Comments
 (0)