Skip to content

Commit

Permalink
Merge branch 'main' into security/multiprocessing-forkserver-authkey
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Nov 13, 2024
2 parents a53c01f + 2e39d77 commit db29006
Show file tree
Hide file tree
Showing 172 changed files with 2,205 additions and 571 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
# Check for changes in regenerated files
if test -n "$changes"; then
echo "Generated files not up to date."
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
echo "Perhaps you forgot to run make regen-configure ;)"
echo "configure files must be regenerated with a specific version of autoconf."
echo "$changes"
echo ""
Expand Down
33 changes: 33 additions & 0 deletions Doc/c-api/long.rst
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,39 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
.. versionadded:: 3.14
.. c:function:: int PyLong_IsPositive(PyObject *obj)
Check if the integer object *obj* is positive (``obj > 0``).
If *obj* is an instance of :c:type:`PyLongObject` or its subtype,
return ``1`` when it's positive and ``0`` otherwise. Else set an
exception and return ``-1``.
.. versionadded:: next
.. c:function:: int PyLong_IsNegative(PyObject *obj)
Check if the integer object *obj* is negative (``obj < 0``).
If *obj* is an instance of :c:type:`PyLongObject` or its subtype,
return ``1`` when it's negative and ``0`` otherwise. Else set an
exception and return ``-1``.
.. versionadded:: next
.. c:function:: int PyLong_IsZero(PyObject *obj)
Check if the integer object *obj* is zero.
If *obj* is an instance of :c:type:`PyLongObject` or its subtype,
return ``1`` when it's zero and ``0`` otherwise. Else set an
exception and return ``-1``.
.. versionadded:: next
.. c:function:: PyObject* PyLong_GetInfo(void)
On success, return a read only :term:`named tuple`, that holds
Expand Down
5 changes: 1 addition & 4 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@

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

# We look for the Include/patchlevel.h file in the current Python source tree
# and replace the values accordingly.
Expand Down
2 changes: 1 addition & 1 deletion Doc/copyright.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Copyright

Python and this documentation is:

Copyright © 2001-2024 Python Software Foundation. All rights reserved.
Copyright © 2001 Python Software Foundation. All rights reserved.

Copyright © 2000 BeOpen.com. All rights reserved.

Expand Down
15 changes: 15 additions & 0 deletions Doc/library/aifc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:mod:`!aifc` --- Read and write AIFF and AIFC files
===================================================

.. module:: aifc
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

The last version of Python that provided the :mod:`!aifc` module was
`Python 3.12 <https://docs.python.org/3.12/library/aifc.html>`_.
17 changes: 17 additions & 0 deletions Doc/library/asynchat.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:mod:`!asynchat` --- Asynchronous socket command/response handler
=================================================================

.. module:: asynchat
:synopsis: Removed in 3.12.
:deprecated:

.. deprecated-removed:: 3.6 3.12

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.12 <whatsnew312-removed>` after
being deprecated in Python 3.6. The removal was decided in :pep:`594`.

Applications should use the :mod:`asyncio` module instead.

The last version of Python that provided the :mod:`!asynchat` module was
`Python 3.11 <https://docs.python.org/3.11/library/asynchat.html>`_.
2 changes: 1 addition & 1 deletion Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ By default asyncio is configured to use :class:`EventLoop`.
.. seealso::

`MSDN documentation on I/O Completion Ports
<https://docs.microsoft.com/en-ca/windows/desktop/FileIO/i-o-completion-ports>`_.
<https://learn.microsoft.com/windows/win32/fileio/i-o-completion-ports>`_.

.. class:: EventLoop

Expand Down
17 changes: 17 additions & 0 deletions Doc/library/asyncore.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:mod:`!asyncore` --- Asynchronous socket handler
================================================

.. module:: asyncore
:synopsis: Removed in 3.12.
:deprecated:

.. deprecated-removed:: 3.6 3.12

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.12 <whatsnew312-removed>` after
being deprecated in Python 3.6. The removal was decided in :pep:`594`.

Applications should use the :mod:`asyncio` module instead.

The last version of Python that provided the :mod:`!asyncore` module was
`Python 3.11 <https://docs.python.org/3.11/library/asyncore.html>`_.
15 changes: 15 additions & 0 deletions Doc/library/audioop.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:mod:`!audioop` --- Manipulate raw audio data
=============================================

.. module:: audioop
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

The last version of Python that provided the :mod:`!audioop` module was
`Python 3.12 <https://docs.python.org/3.12/library/audioop.html>`_.
19 changes: 19 additions & 0 deletions Doc/library/cgi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
:mod:`!cgi` --- Common Gateway Interface support
================================================

.. module:: cgi
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`.
This is a copy of the cgi module, no longer maintained or supported by the core
Python team.

The last version of Python that provided the :mod:`!cgi` module was
`Python 3.12 <https://docs.python.org/3.12/library/cgi.html>`_.
19 changes: 19 additions & 0 deletions Doc/library/cgitb.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
:mod:`!cgitb` --- Traceback manager for CGI scripts
===================================================

.. module:: cgitb
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`.
This is a copy of the cgi module, no longer maintained or supported by the core
Python team.

The last version of Python that provided the :mod:`!cgitb` module was
`Python 3.12 <https://docs.python.org/3.12/library/cgitb.html>`_.
15 changes: 15 additions & 0 deletions Doc/library/chunk.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:mod:`!chunk` --- Read IFF chunked data
=======================================

.. module:: chunk
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

The last version of Python that provided the :mod:`!chunk` module was
`Python 3.12 <https://docs.python.org/3.12/library/chunk.html>`_.
20 changes: 20 additions & 0 deletions Doc/library/crypt.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
:mod:`!crypt` --- Function to check Unix passwords
==================================================

.. module:: crypt
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

Applications can use the :mod:`hashlib` module from the standard library.
Other possible replacements are third-party libraries from PyPI:
:pypi:`legacycrypt`, :pypi:`bcrypt`, :pypi:`argon2-cffi`, or :pypi:`passlib`.
These are not supported or maintained by the Python core team.

The last version of Python that provided the :mod:`!crypt` module was
`Python 3.12 <https://docs.python.org/3.12/library/crypt.html>`_.
17 changes: 17 additions & 0 deletions Doc/library/distutils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
:mod:`!distutils` --- Building and installing Python modules
============================================================

.. module:: distutils
:synopsis: Removed in 3.12.
:deprecated:

.. deprecated-removed:: 3.10 3.12

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.12 <whatsnew312-removed-distutils>` after
being deprecated in Python 3.10. The removal was decided in :pep:`632`,
which has `migration advice
<https://peps.python.org/pep-0632/#migration-advice>`_.

The last version of Python that provided the :mod:`!distutils` module was
`Python 3.11 <https://docs.python.org/3.11/library/distutils.html>`_.
7 changes: 5 additions & 2 deletions Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ The :mod:`functools` module defines the following functions:
.. versionadded:: 3.4


.. function:: reduce(function, iterable[, initial], /)
.. function:: reduce(function, iterable, /[, initial])

Apply *function* of two arguments cumulatively to the items of *iterable*, from
left to right, so as to reduce the iterable to a single value. For example,
Expand All @@ -468,7 +468,7 @@ The :mod:`functools` module defines the following functions:

initial_missing = object()

def reduce(function, iterable, initial=initial_missing, /):
def reduce(function, iterable, /, initial=initial_missing):
it = iter(iterable)
if initial is initial_missing:
value = next(it)
Expand All @@ -481,6 +481,9 @@ The :mod:`functools` module defines the following functions:
See :func:`itertools.accumulate` for an iterator that yields all intermediate
values.

.. versionchanged:: next
*initial* is now supported as a keyword argument.

.. decorator:: singledispatch

Transform a function into a :term:`single-dispatch <single
Expand Down
26 changes: 23 additions & 3 deletions Doc/library/getopt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ exception:
be parsed, without the leading reference to the running program. Typically, this
means ``sys.argv[1:]``. *shortopts* is the string of option letters that the
script wants to recognize, with options that require an argument followed by a
colon (``':'``; i.e., the same format that Unix :c:func:`!getopt` uses).
colon (``':'``) and options that accept an optional argument followed by
two colons (``'::'``); i.e., the same format that Unix :c:func:`!getopt` uses.

.. note::

Expand All @@ -49,8 +50,10 @@ exception:
*longopts*, if specified, must be a list of strings with the names of the
long options which should be supported. The leading ``'--'`` characters
should not be included in the option name. Long options which require an
argument should be followed by an equal sign (``'='``). Optional arguments
are not supported. To accept only long options, *shortopts* should be an
argument should be followed by an equal sign (``'='``).
Long options which accept an optional argument should be followed by
an equal sign and question mark (``'=?'``).
To accept only long options, *shortopts* should be an
empty string. Long options on the command line can be recognized so long as
they provide a prefix of the option name that matches exactly one of the
accepted options. For example, if *longopts* is ``['foo', 'frob']``, the
Expand All @@ -67,6 +70,9 @@ exception:
options occur in the list in the same order in which they were found, thus
allowing multiple occurrences. Long and short options may be mixed.

.. versionchanged:: 3.14
Optional arguments are supported.


.. function:: gnu_getopt(args, shortopts, longopts=[])

Expand Down Expand Up @@ -124,6 +130,20 @@ Using long option names is equally easy:
>>> args
['a1', 'a2']

Optional arguments should be specified explicitly:

.. doctest::

>>> s = '-Con -C --color=off --color a1 a2'
>>> args = s.split()
>>> args
['-Con', '-C', '--color=off', '--color', 'a1', 'a2']
>>> optlist, args = getopt.getopt(args, 'C::', ['color=?'])
>>> optlist
[('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')]
>>> args
['a1', 'a2']

In a script, typical usage is something like this:

.. testcode::
Expand Down
19 changes: 19 additions & 0 deletions Doc/library/imghdr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
:mod:`!imghdr` --- Determine the type of an image
=================================================

.. module:: imghdr
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

Possible replacements are third-party libraries from PyPI:
:pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`.
These are not supported or maintained by the Python core team.

The last version of Python that provided the :mod:`!imghdr` module was
`Python 3.12 <https://docs.python.org/3.12/library/imghdr.html>`_.
18 changes: 18 additions & 0 deletions Doc/library/imp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:mod:`!imp` --- Access the import internals
===========================================

.. module:: imp
:synopsis: Removed in 3.12.
:deprecated:

.. deprecated-removed:: 3.4 3.12

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.12 <whatsnew312-removed-imp>` after
being deprecated in Python 3.4.

The :ref:`removal notice <whatsnew312-removed-imp>` includes guidance for
migrating code from :mod:`!imp` to :mod:`importlib`.

The last version of Python that provided the :mod:`!imp` module was
`Python 3.11 <https://docs.python.org/3.11/library/imp.html>`_.
1 change: 1 addition & 0 deletions Doc/library/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,5 @@ the `Python Package Index <https://pypi.org>`_.
unix.rst
cmdline.rst
superseded.rst
removed.rst
security_warnings.rst
15 changes: 15 additions & 0 deletions Doc/library/mailcap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:mod:`!mailcap` --- Mailcap file handling
=========================================

.. module:: mailcap
:synopsis: Removed in 3.13.
:deprecated:

.. deprecated-removed:: 3.11 3.13

This module is no longer part of the Python standard library.
It was :ref:`removed in Python 3.13 <whatsnew313-pep594>` after
being deprecated in Python 3.11. The removal was decided in :pep:`594`.

The last version of Python that provided the :mod:`!mailcap` module was
`Python 3.12 <https://docs.python.org/3.12/library/mailcap.html>`_.
Loading

0 comments on commit db29006

Please sign in to comment.