Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into pythongh-86179
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Dec 12, 2023
2 parents 01b1f82 + 81a15ea commit d01aa34
Show file tree
Hide file tree
Showing 89 changed files with 6,099 additions and 2,590 deletions.
15 changes: 14 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -78,6 +78,11 @@ Python/traceback.c @iritkatriel
**/*importlib/resources/* @jaraco @warsaw @FFY00
**/importlib/metadata/* @jaraco @warsaw

# Subinterpreters
Lib/test/support/interpreters/** @ericsnowcurrently
Modules/_xx*interp*module.c @ericsnowcurrently
Lib/test/test_interpreters/** @ericsnowcurrently

# Dates and times
**/*datetime* @pganssle @abalkin
**/*str*time* @pganssle @abalkin
Expand Down Expand Up @@ -148,7 +153,15 @@ Doc/c-api/stable.rst @encukou
**/*itertools* @rhettinger
**/*collections* @rhettinger
**/*random* @rhettinger
**/*queue* @rhettinger
Doc/**/*queue* @rhettinger
PCbuild/**/*queue* @rhettinger
Modules/_queuemodule.c @rhettinger
Lib/*queue*.py @rhettinger
Lib/asyncio/*queue*.py @rhettinger
Lib/multiprocessing/*queue*.py @rhettinger
Lib/test/*queue*.py @rhettinger
Lib/test_asyncio/*queue*.py @rhettinger
Lib/test_multiprocessing/*queue*.py @rhettinger
**/*bisect* @rhettinger
**/*heapq* @rhettinger
**/*functools* @rhettinger
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.2
rev: v0.1.7
hooks:
- id: ruff
name: Run Ruff on Lib/test/
Expand All @@ -24,7 +24,7 @@ repos:
types_or: [c, inc, python, rst]

- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.8.1
rev: v0.9.1
hooks:
- id: sphinx-lint
args: [--enable=default-role]
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/function.rst
Expand Up @@ -35,7 +35,7 @@ There are a few functions specific to Python functions.
must be a dictionary with the global variables accessible to the function.
The function's docstring and name are retrieved from the code object.
:func:`~function.__module__`
:attr:`~function.__module__`
is retrieved from *globals*. The argument defaults, annotations and closure are
set to ``NULL``. :attr:`~function.__qualname__` is set to the same value as
the code object's :attr:`~codeobject.co_qualname` field.
Expand Down
17 changes: 7 additions & 10 deletions Doc/library/hmac.rst
Expand Up @@ -14,7 +14,7 @@
This module implements the HMAC algorithm as described by :rfc:`2104`.


.. function:: new(key, msg=None, digestmod='')
.. function:: new(key, msg=None, digestmod)

Return a new hmac object. *key* is a bytes or bytearray object giving the
secret key. If *msg* is present, the method call ``update(msg)`` is made.
Expand All @@ -27,10 +27,9 @@ This module implements the HMAC algorithm as described by :rfc:`2104`.
Parameter *msg* can be of any type supported by :mod:`hashlib`.
Parameter *digestmod* can be the name of a hash algorithm.

.. deprecated-removed:: 3.4 3.8
MD5 as implicit default digest for *digestmod* is deprecated.
The digestmod parameter is now required. Pass it as a keyword
argument to avoid awkwardness when you do not have an initial msg.
.. versionchanged:: 3.8
The *digestmod* argument is now required. Pass it as a keyword
argument to avoid awkwardness when you do not have an initial *msg*.


.. function:: digest(key, msg, digest)
Expand Down Expand Up @@ -114,11 +113,9 @@ A hash object has the following attributes:
.. versionadded:: 3.4


.. deprecated:: 3.9

The undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, and
``HMAC.outer`` are internal implementation details and will be removed in
Python 3.10.
.. versionchanged:: 3.10
Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``,
and ``HMAC.outer``.

This module also provides the following helper function:

Expand Down
8 changes: 4 additions & 4 deletions Doc/library/random.rst
Expand Up @@ -220,8 +220,8 @@ Functions for sequences
generated. For example, a sequence of length 2080 is the largest that
can fit within the period of the Mersenne Twister random number generator.

.. deprecated-removed:: 3.9 3.11
The optional parameter *random*.
.. versionchanged:: 3.11
Removed the optional parameter *random*.


.. function:: sample(population, k, *, counts=None)
Expand Down Expand Up @@ -407,9 +407,9 @@ Alternative Generator
Class that implements the default pseudo-random number generator used by the
:mod:`random` module.

.. deprecated-removed:: 3.9 3.11
.. versionchanged:: 3.11
Formerly the *seed* could be any hashable object. Now it is limited to:
:class:`NoneType`, :class:`int`, :class:`float`, :class:`str`,
``None``, :class:`int`, :class:`float`, :class:`str`,
:class:`bytes`, or :class:`bytearray`.

.. class:: SystemRandom([seed])
Expand Down
74 changes: 57 additions & 17 deletions Doc/library/syslog.rst
Expand Up @@ -15,7 +15,7 @@ facility.

This module wraps the system ``syslog`` family of routines. A pure Python
library that can speak to a syslog server is available in the
:mod:`logging.handlers` module as :class:`SysLogHandler`.
:mod:`logging.handlers` module as :class:`~logging.handlers.SysLogHandler`.

The module defines the following functions:

Expand Down Expand Up @@ -107,22 +107,62 @@ The module defines the following functions:

The module defines the following constants:

Priority levels (high to low):
:const:`LOG_EMERG`, :const:`LOG_ALERT`, :const:`LOG_CRIT`, :const:`LOG_ERR`,
:const:`LOG_WARNING`, :const:`LOG_NOTICE`, :const:`LOG_INFO`,
:const:`LOG_DEBUG`.

Facilities:
:const:`LOG_KERN`, :const:`LOG_USER`, :const:`LOG_MAIL`, :const:`LOG_DAEMON`,
:const:`LOG_AUTH`, :const:`LOG_LPR`, :const:`LOG_NEWS`, :const:`LOG_UUCP`,
:const:`LOG_CRON`, :const:`LOG_SYSLOG`, :const:`LOG_LOCAL0` to
:const:`LOG_LOCAL7`, and, if defined in ``<syslog.h>``,
:const:`LOG_AUTHPRIV`.

Log options:
:const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, and, if defined
in ``<syslog.h>``, :const:`LOG_ODELAY`, :const:`LOG_NOWAIT`, and
:const:`LOG_PERROR`.

.. data:: LOG_EMERG
LOG_ALERT
LOG_CRIT
LOG_ERR
LOG_WARNING
LOG_NOTICE
LOG_INFO
LOG_DEBUG

Priority levels (high to low).


.. data:: LOG_AUTH
LOG_AUTHPRIV
LOG_CRON
LOG_DAEMON
LOG_FTP
LOG_INSTALL
LOG_KERN
LOG_LAUNCHD
LOG_LPR
LOG_MAIL
LOG_NETINFO
LOG_NEWS
LOG_RAS
LOG_REMOTEAUTH
LOG_SYSLOG
LOG_USER
LOG_UUCP
LOG_LOCAL0
LOG_LOCAL1
LOG_LOCAL2
LOG_LOCAL3
LOG_LOCAL4
LOG_LOCAL5
LOG_LOCAL6
LOG_LOCAL7

Facilities, depending on availability in ``<syslog.h>`` for :const:`LOG_AUTHPRIV`,
:const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`,
:const:`LOG_INSTALL` and :const:`LOG_RAS`.

.. versionchanged:: 3.13
Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`,
:const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`.

.. data:: LOG_PID
LOG_CONS
LOG_NDELAY
LOG_ODELAY
LOG_NOWAIT
LOG_PERROR

Log options, depending on availability in ``<syslog.h>`` for
:const:`LOG_ODELAY`, :const:`LOG_NOWAIT` and :const:`LOG_PERROR`.


Examples
Expand Down
9 changes: 6 additions & 3 deletions Doc/reference/datamodel.rst
Expand Up @@ -601,7 +601,7 @@ Most of these attributes check the type of the assigned value:
or ``None`` if unavailable.

* - .. attribute:: function.__defaults__
- A :class:`tuple` containing default parameter values
- A :class:`tuple` containing default :term:`parameter` values
for those parameters that have defaults,
or ``None`` if no parameters have a default value.

Expand All @@ -614,19 +614,22 @@ Most of these attributes check the type of the assigned value:
See also: :attr:`__dict__ attributes <object.__dict__>`.

* - .. attribute:: function.__annotations__
- A :class:`dictionary <dict>` containing annotations of parameters.
- A :class:`dictionary <dict>` containing annotations of
:term:`parameters <parameter>`.
The keys of the dictionary are the parameter names,
and ``'return'`` for the return annotation, if provided.
See also: :ref:`annotations-howto`.

* - .. attribute:: function.__kwdefaults__
- A :class:`dictionary <dict>` containing defaults for keyword-only
parameters.
:term:`parameters <parameter>`.

* - .. attribute:: function.__type_params__
- A :class:`tuple` containing the :ref:`type parameters <type-params>` of
a :ref:`generic function <generic-functions>`.

.. versionadded:: 3.12

Function objects also support getting and setting arbitrary attributes, which
can be used, for example, to attach metadata to functions. Regular attribute
dot-notation is used to get and set such attributes.
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Expand Up @@ -91,7 +91,6 @@ Doc/library/ssl.rst
Doc/library/stdtypes.rst
Doc/library/string.rst
Doc/library/subprocess.rst
Doc/library/syslog.rst
Doc/library/tarfile.rst
Doc/library/termios.rst
Doc/library/test.rst
Expand Down
4 changes: 1 addition & 3 deletions Doc/using/cmdline.rst
Expand Up @@ -590,9 +590,7 @@ Miscellaneous options

.. versionadded:: 3.10
The ``-X warn_default_encoding`` option.

.. deprecated-removed:: 3.9 3.10
The ``-X oldparser`` option.
Removed the ``-X oldparser`` option.

.. versionadded:: 3.11
The ``-X no_debug_ranges`` option.
Expand Down
2 changes: 1 addition & 1 deletion Include/cpython/optimizer.h
Expand Up @@ -32,7 +32,7 @@ typedef struct {
typedef struct _PyExecutorObject {
PyObject_VAR_HEAD
/* WARNING: execute consumes a reference to self. This is necessary to allow executors to tail call into each other. */
struct _PyInterpreterFrame *(*execute)(struct _PyExecutorObject *self, struct _PyInterpreterFrame *frame, PyObject **stack_pointer);
_Py_CODEUNIT *(*execute)(struct _PyExecutorObject *self, struct _PyInterpreterFrame *frame, PyObject **stack_pointer);
_PyVMData vm_data; /* Used by the VM, but opaque to the optimizer */
/* Data needed by the executor goes here, but is opaque to the VM */
} _PyExecutorObject;
Expand Down
10 changes: 10 additions & 0 deletions Include/internal/pycore_crossinterp.h
Expand Up @@ -11,6 +11,13 @@ extern "C" {
#include "pycore_lock.h" // PyMutex
#include "pycore_pyerrors.h"

/**************/
/* exceptions */
/**************/

PyAPI_DATA(PyObject *) PyExc_InterpreterError;
PyAPI_DATA(PyObject *) PyExc_InterpreterNotFoundError;


/***************************/
/* cross-interpreter calls */
Expand Down Expand Up @@ -160,6 +167,9 @@ struct _xi_state {
extern PyStatus _PyXI_Init(PyInterpreterState *interp);
extern void _PyXI_Fini(PyInterpreterState *interp);

extern PyStatus _PyXI_InitTypes(PyInterpreterState *interp);
extern void _PyXI_FiniTypes(PyInterpreterState *interp);


/***************************/
/* short-term data sharing */
Expand Down
6 changes: 3 additions & 3 deletions Include/internal/pycore_interp.h
Expand Up @@ -250,9 +250,9 @@ _PyInterpreterState_SetFinalizing(PyInterpreterState *interp, PyThreadState *tst
// Export for the _xxinterpchannels module.
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_LookUpID(int64_t);

extern int _PyInterpreterState_IDInitref(PyInterpreterState *);
extern int _PyInterpreterState_IDIncref(PyInterpreterState *);
extern void _PyInterpreterState_IDDecref(PyInterpreterState *);
PyAPI_FUNC(int) _PyInterpreterState_IDInitref(PyInterpreterState *);
PyAPI_FUNC(int) _PyInterpreterState_IDIncref(PyInterpreterState *);
PyAPI_FUNC(void) _PyInterpreterState_IDDecref(PyInterpreterState *);

extern const PyConfig* _PyInterpreterState_GetConfig(PyInterpreterState *interp);

Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion Include/internal/pycore_pymem_init.h
Expand Up @@ -18,7 +18,19 @@ extern void * _PyMem_RawRealloc(void *, void *, size_t);
extern void _PyMem_RawFree(void *, void *);
#define PYRAW_ALLOC {NULL, _PyMem_RawMalloc, _PyMem_RawCalloc, _PyMem_RawRealloc, _PyMem_RawFree}

#if defined(WITH_PYMALLOC)
#ifdef Py_GIL_DISABLED
// Py_GIL_DISABLED requires mimalloc
extern void* _PyObject_MiMalloc(void *, size_t);
extern void* _PyObject_MiCalloc(void *, size_t, size_t);
extern void _PyObject_MiFree(void *, void *);
extern void* _PyObject_MiRealloc(void *, void *, size_t);
# define PYOBJ_ALLOC {NULL, _PyObject_MiMalloc, _PyObject_MiCalloc, _PyObject_MiRealloc, _PyObject_MiFree}
extern void* _PyMem_MiMalloc(void *, size_t);
extern void* _PyMem_MiCalloc(void *, size_t, size_t);
extern void _PyMem_MiFree(void *, void *);
extern void* _PyMem_MiRealloc(void *, void *, size_t);
# define PYMEM_ALLOC {NULL, _PyMem_MiMalloc, _PyMem_MiCalloc, _PyMem_MiRealloc, _PyMem_MiFree}
#elif defined(WITH_PYMALLOC)
extern void* _PyObject_Malloc(void *, size_t);
extern void* _PyObject_Calloc(void *, size_t, size_t);
extern void _PyObject_Free(void *, void *);
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_uop_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Include/internal/pycore_uops.h
Expand Up @@ -24,7 +24,7 @@ typedef struct {
_PyUOpInstruction trace[1];
} _PyUOpExecutorObject;

_PyInterpreterFrame *_PyUOpExecute(
_Py_CODEUNIT *_PyUOpExecute(
_PyExecutorObject *executor,
_PyInterpreterFrame *frame,
PyObject **stack_pointer);
Expand Down
2 changes: 1 addition & 1 deletion Include/opcode_ids.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Lib/hmac.py
Expand Up @@ -53,7 +53,7 @@ def __init__(self, key, msg=None, digestmod=''):
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)

if not digestmod:
raise TypeError("Missing required parameter 'digestmod'.")
raise TypeError("Missing required argument 'digestmod'.")

if _hashopenssl and isinstance(digestmod, (str, _functype)):
try:
Expand Down
14 changes: 13 additions & 1 deletion Lib/idlelib/NEWS.txt → Lib/idlelib/News3.txt
@@ -1,9 +1,21 @@
What's New in IDLE 3.13.0
(since 3.12.0)
Released on 2024-10-xx
=========================


gh-112939: Fix processing unsaved files when quitting IDLE on macOS.
Patch by Ronald Oussoren and Christopher Chavez.

gh-79871: Add docstrings to debugger.py. Fix two bugs in
test_debugger and expand coverage by 47%. Patch by Anthony Shaw.


What's New in IDLE 3.12.0
(since 3.11.0)
Released on 2023-10-02
=========================


gh-104719: Remove IDLE's modification of tokenize.tabsize and test
other uses of tokenize data and methods.

Expand Down

0 comments on commit d01aa34

Please sign in to comment.