Skip to content

Commit

Permalink
Merge branch 'main' into rlock
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 authored Oct 13, 2024
2 parents 5edf49b + 0848932 commit 214e500
Show file tree
Hide file tree
Showing 231 changed files with 6,102 additions and 3,654 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/reusable-change-detection.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---

name: Change detection
name: Reusable change detection

on: # yamllint disable-line rule:truthy
workflow_call:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs
name: Reusable Docs

on:
workflow_call:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
doctest:
name: 'Doctest'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable macOS

on:
workflow_call:
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-tsan.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable Thread Sanitizer

on:
workflow_call:
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable Ubuntu

on:
workflow_call:
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-wasi.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable WASI

on:
workflow_call:
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-windows-msi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: TestsMSI
name: Reusable Windows MSI

on:
workflow_call:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Reusable Windows

on:
workflow_call:
inputs:
Expand Down
22 changes: 14 additions & 8 deletions Doc/c-api/contextvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,24 @@ Context object management functions:
.. c:type:: PyContextEvent
Enumeration of possible context object watcher events:
- ``Py_CONTEXT_EVENT_ENTER``
- ``Py_CONTEXT_EVENT_EXIT``
- ``Py_CONTEXT_EVENT_ENTER``: A context has been entered, causing the
:term:`current context` to switch to it. The object passed to the watch
callback is the now-current :class:`contextvars.Context` object. Each
enter event will eventually have a corresponding exit event for the same
context object after any subsequently entered contexts have themselves been
exited.
- ``Py_CONTEXT_EVENT_EXIT``: A context is about to be exited, which will
cause the :term:`current context` to switch back to what it was before the
context was entered. The object passed to the watch callback is the
still-current :class:`contextvars.Context` object.
.. versionadded:: 3.14
.. c:type:: int (*PyContext_WatchCallback)(PyContextEvent event, PyContext* ctx)
.. c:type:: int (*PyContext_WatchCallback)(PyContextEvent event, PyObject *obj)
Type of a context object watcher callback function.
If *event* is ``Py_CONTEXT_EVENT_ENTER``, then the callback is invoked
after *ctx* has been set as the current context for the current thread.
Otherwise, the callback is invoked before the deactivation of *ctx* as the current context
and the restoration of the previous contex object for the current thread.
Context object watcher callback function. The object passed to the callback
is event-specific; see :c:type:`PyContextEvent` for details.
If the callback returns with an exception set, it must return ``-1``; this
exception will be printed as an unraisable exception using
Expand Down
26 changes: 13 additions & 13 deletions Doc/c-api/import.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ Importing Modules
such modules have no way to know that the module object is an unknown (and
probably damaged with respect to the module author's intents) state.
The module's :attr:`__spec__` and :attr:`__loader__` will be set, if
not set already, with the appropriate values. The spec's loader will
be set to the module's ``__loader__`` (if set) and to an instance of
:class:`~importlib.machinery.SourceFileLoader` otherwise.
The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be
set, if not set already, with the appropriate values. The spec's loader
will be set to the module's :attr:`!__loader__` (if set) and to an instance
of :class:`~importlib.machinery.SourceFileLoader` otherwise.
The module's :attr:`__file__` attribute will be set to the code object's
:attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also
be set.
The module's :attr:`~module.__file__` attribute will be set to the code
object's :attr:`~codeobject.co_filename`. If applicable,
:attr:`~module.__cached__` will also be set.
This function will reload the module if it was already imported. See
:c:func:`PyImport_ReloadModule` for the intended way to reload a module.
Expand All @@ -155,29 +155,29 @@ Importing Modules
:c:func:`PyImport_ExecCodeModuleWithPathnames`.
.. versionchanged:: 3.12
The setting of :attr:`__cached__` and :attr:`__loader__` is
deprecated. See :class:`~importlib.machinery.ModuleSpec` for
The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__`
is deprecated. See :class:`~importlib.machinery.ModuleSpec` for
alternatives.
.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute of
the module object is set to *pathname* if it is non-``NULL``.
Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__`
attribute of the module object is set to *pathname* if it is non-``NULL``.
See also :c:func:`PyImport_ExecCodeModuleWithPathnames`.
.. c:function:: PyObject* PyImport_ExecCodeModuleObject(PyObject *name, PyObject *co, PyObject *pathname, PyObject *cpathname)
Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__`
Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__`
attribute of the module object is set to *cpathname* if it is
non-``NULL``. Of the three functions, this is the preferred one to use.
.. versionadded:: 3.3
.. versionchanged:: 3.12
Setting :attr:`__cached__` is deprecated. See
Setting :attr:`~module.__cached__` is deprecated. See
:class:`~importlib.machinery.ModuleSpec` for alternatives.
Expand Down
22 changes: 12 additions & 10 deletions Doc/c-api/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ Module Objects
single: __package__ (module attribute)
single: __loader__ (module attribute)
Return a new module object with the :attr:`__name__` attribute set to *name*.
The module's :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, and
:attr:`__loader__` attributes are filled in (all but :attr:`__name__` are set
to ``None``); the caller is responsible for providing a :attr:`__file__`
attribute.
Return a new module object with :attr:`module.__name__` set to *name*.
The module's :attr:`!__name__`, :attr:`~module.__doc__`,
:attr:`~module.__package__` and :attr:`~module.__loader__` attributes are
filled in (all but :attr:`!__name__` are set to ``None``). The caller is
responsible for setting a :attr:`~module.__file__` attribute.
Return ``NULL`` with an exception set on error.
.. versionadded:: 3.3
.. versionchanged:: 3.4
:attr:`__package__` and :attr:`__loader__` are set to ``None``.
:attr:`~module.__package__` and :attr:`~module.__loader__` are now set to
``None``.
.. c:function:: PyObject* PyModule_New(const char *name)
Expand Down Expand Up @@ -77,8 +78,9 @@ Module Objects
single: __name__ (module attribute)
single: SystemError (built-in exception)
Return *module*'s :attr:`__name__` value. If the module does not provide one,
or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is returned.
Return *module*'s :attr:`~module.__name__` value. If the module does not
provide one, or if it is not a string, :exc:`SystemError` is raised and
``NULL`` is returned.
.. versionadded:: 3.3
Expand Down Expand Up @@ -108,8 +110,8 @@ Module Objects
single: SystemError (built-in exception)
Return the name of the file from which *module* was loaded using *module*'s
:attr:`__file__` attribute. If this is not defined, or if it is not a
unicode string, raise :exc:`SystemError` and return ``NULL``; otherwise return
:attr:`~module.__file__` attribute. If this is not defined, or if it is not a
string, raise :exc:`SystemError` and return ``NULL``; otherwise return
a reference to a Unicode object.
.. versionadded:: 3.2
Expand Down
2 changes: 2 additions & 0 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,8 @@ object.
Discard the internal Unicode buffer and destroy the writer instance.
If *writer* is ``NULL``, no operation is performed.
.. c:function:: int PyUnicodeWriter_WriteChar(PyUnicodeWriter *writer, Py_UCS4 ch)
Write the single Unicode character *ch* into *writer*.
Expand Down
32 changes: 25 additions & 7 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import sys
import time

import sphinx

sys.path.append(os.path.abspath('tools/extensions'))
sys.path.append(os.path.abspath('includes'))

Expand All @@ -21,6 +23,7 @@

extensions = [
'audit_events',
'availability',
'c_annotations',
'glossary_search',
'lexers',
Expand Down Expand Up @@ -61,7 +64,10 @@

# General substitutions.
project = 'Python'
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"
if sphinx.version_info[:2] >= (8, 1):
copyright = "2001-%Y, Python Software Foundation"
else:
copyright = f"2001-{time.strftime('%Y')}, Python Software Foundation"

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

# This 'Last updated on:' timestamp is inserted at the bottom of every page.
html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
html_last_updated_fmt = time.strftime(
'%b %d, %Y (%H:%M UTC)', time.gmtime(html_time)
)
html_last_updated_fmt = '%b %d, %Y (%H:%M UTC)'
if sphinx.version_info[:2] >= (8, 1):
html_last_updated_use_utc = True
else:
html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
html_last_updated_fmt = time.strftime(
html_last_updated_fmt, time.gmtime(html_time)
)

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

if sphinx.version_info[:2] < (8, 1):
# Sphinx 8.1 has in-built CVE and CWE roles.
extlinks |= {
"cve": (
"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s",
"CVE-%s",
),
"cwe": ("https://cwe.mitre.org/data/definitions/%s.html", "CWE-%s"),
}

# Options for c_annotations
# -------------------------

Expand Down
7 changes: 7 additions & 0 deletions Doc/deprecations/pending-removal-in-3.14.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Pending Removal in Python 3.14
------------------------------

* The import system:

* Setting :attr:`~module.__loader__` on a module while
failing to set :attr:`__spec__.loader <importlib.machinery.ModuleSpec.loader>`
is deprecated. In Python 3.14, :attr:`!__loader__` will cease to be set or
taken into consideration by the import system or the standard library.

* :mod:`argparse`: The *type*, *choices*, and *metavar* parameters
of :class:`!argparse.BooleanOptionalAction` are deprecated
and will be removed in 3.14.
Expand Down
15 changes: 12 additions & 3 deletions Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Pending Removal in Python 3.15
------------------------------

* The import system:

* Setting :attr:`~module.__cached__` on a module while
failing to set :attr:`__spec__.cached <importlib.machinery.ModuleSpec.cached>`
is deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or
take into consideration by the import system or standard library. (:gh:`97879`)

* Setting :attr:`~module.__package__` on a module while
failing to set :attr:`__spec__.parent <importlib.machinery.ModuleSpec.parent>`
is deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or
take into consideration by the import system or standard library. (:gh:`97879`)

* :mod:`ctypes`:

* The undocumented :func:`!ctypes.SetPointerType` function
Expand All @@ -17,9 +29,6 @@ Pending Removal in Python 3.15
* The :option:`!--cgi` flag to the :program:`python -m http.server`
command-line interface has been deprecated since Python 3.13.

* :mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or
taken into consideration by the import system (:gh:`97879`).

* :class:`locale`:

* The :func:`~locale.getdefaultlocale` function
Expand Down
Loading

0 comments on commit 214e500

Please sign in to comment.