Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Nov 4, 2023
2 parents 2e87e8b + 9573d14 commit 18552d1
Show file tree
Hide file tree
Showing 321 changed files with 25,008 additions and 33,801 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ jobs:
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
with:
allowed-failures: >-
build_macos,
build_macos_free_threaded,
build_ubuntu_free_threaded,
build_ubuntu_ssltests,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/new-bugs-announce-notifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 14
node-version: 20
- run: npm install mailgun.js form-data
- name: Send notification
uses: actions/github-script@v6
Expand Down
1 change: 1 addition & 0 deletions Doc/c-api/bytes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ called with a non-bytes parameter.
Return the null-terminated contents of the object *obj*
through the output variables *buffer* and *length*.
Returns ``0`` on success.
If *length* is ``NULL``, the bytes object
may not contain embedded null bytes;
Expand Down
13 changes: 13 additions & 0 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,26 @@ Printing and clearing
Use :func:`sys.unraisablehook`.
.. c:function:: void PyErr_FormatUnraisable(const char *format, ...)
Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent
parameters help format the warning message; they have the same meaning and
values as in :c:func:`PyUnicode_FromFormat`.
``PyErr_WriteUnraisable(obj)`` is roughtly equivalent to
``PyErr_FormatUnraisable("Exception ignored in: %R, obj)``.
If *format* is ``NULL``, only the traceback is printed.
.. versionadded:: 3.13
.. c:function:: void PyErr_DisplayException(PyObject *exc)
Print the standard traceback display of ``exc`` to ``sys.stderr``, including
chained exceptions and notes.
.. versionadded:: 3.12
Raising exceptions
==================
Expand Down
4 changes: 4 additions & 0 deletions Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,10 @@ it can be updated:
>>> Movie('Star Wars').director
'J.J. Abrams'

.. testcleanup::

conn.close()


Pure Python Equivalents
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 5 additions & 3 deletions Doc/library/difflib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
expressed in the ISO 8601 format. If not specified, the
strings default to blanks.

>>> import sys
>>> from difflib import *
>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
>>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py', tofile='after.py'))
>>> sys.stdout.writelines(context_diff(s1, s2, fromfile='before.py',
... tofile='after.py'))
*** before.py
--- after.py
***************
Expand Down Expand Up @@ -294,13 +297,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
For inputs that do not have trailing newlines, set the *lineterm* argument to
``""`` so that the output will be uniformly newline free.

The context diff format normally has a header for filenames and modification
The unified diff format normally has a header for filenames and modification
times. Any or all of these may be specified using strings for *fromfile*,
*tofile*, *fromfiledate*, and *tofiledate*. The modification times are normally
expressed in the ISO 8601 format. If not specified, the
strings default to blanks.


>>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n']
>>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n']
>>> sys.stdout.writelines(unified_diff(s1, s2, fromfile='before.py', tofile='after.py'))
Expand Down
14 changes: 12 additions & 2 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,9 @@ iterations of the loop.
.. versionchanged:: 3.12
oparg set to be the exception block depth, for efficient closing of generators.

.. versionchanged:: 3.13
oparg is ``1`` if this instruction is part of a yield-from or await, and ``0``
otherwise.

.. opcode:: SETUP_ANNOTATIONS

Expand Down Expand Up @@ -1625,20 +1628,27 @@ iterations of the loop.
success (``True``) or failure (``False``).


.. opcode:: RESUME (where)
.. opcode:: RESUME (context)

A no-op. Performs internal tracing, debugging and optimization checks.

The ``where`` operand marks where the ``RESUME`` occurs:
The ``context`` oparand consists of two parts. The lowest two bits
indicate where the ``RESUME`` occurs:

* ``0`` The start of a function, which is neither a generator, coroutine
nor an async generator
* ``1`` After a ``yield`` expression
* ``2`` After a ``yield from`` expression
* ``3`` After an ``await`` expression

The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0``
otherwise.

.. versionadded:: 3.11

.. versionchanged:: 3.13
The oparg value changed to include information about except-depth


.. opcode:: RETURN_GENERATOR

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/fcntl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. For a
complete description of these calls, see :manpage:`fcntl(2)` and
:manpage:`ioctl(2)` Unix manual pages.

.. include:: ../includes/wasm-notavail.rst
.. availability:: Unix, not Emscripten, not WASI.

All functions in this module take a file descriptor *fd* as their first
argument. This can be an integer file descriptor, such as returned by
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/grp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
This module provides access to the Unix group database. It is available on all
Unix versions.

.. include:: ../includes/wasm-notavail.rst
.. availability:: Unix, not Emscripten, not WASI.

Group database entries are reported as a tuple-like object, whose attributes
correspond to the members of the ``group`` structure (Attribute field below, see
Expand Down
4 changes: 1 addition & 3 deletions Doc/library/logging.handlers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,7 @@ supports sending logging messages to a remote or local Unix syslog.
to the other end. This method is called during handler initialization,
but it's not regarded as an error if the other end isn't listening at
this point - the method will be called again when emitting an event, if
but it's not regarded as an error if the other end isn't listening yet
--- the method will be called again when emitting an event,
if there is no socket at that point.
there is no socket at that point.

.. versionadded:: 3.11

Expand Down
2 changes: 2 additions & 0 deletions Doc/library/posix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly disguised Unix
interface).

.. availability:: Unix.

.. index:: pair: module; os

**Do not import this module directly.** Instead, import the module :mod:`os`,
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/pty.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ The :mod:`pty` module defines operations for handling the pseudo-terminal
concept: starting another process and being able to write to and read from its
controlling terminal programmatically.

.. availability:: Unix.

Pseudo-terminal handling is highly platform dependent. This code is mainly
tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX
platforms but it's not been thoroughly tested).
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/pwd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
This module provides access to the Unix user account and password database. It
is available on all Unix versions.

.. include:: ../includes/wasm-notavail.rst
.. availability:: Unix, not Emscripten, not WASI.

Password database entries are reported as a tuple-like object, whose attributes
correspond to the members of the ``passwd`` structure (Attribute field below,
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/resource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
This module provides basic mechanisms for measuring and controlling system
resources utilized by a program.

.. include:: ../includes/wasm-notavail.rst
.. availability:: Unix, not Emscripten, not WASI.

Symbolic constants are used to specify particular system resources and to
request usage information about either the current process or its children.
Expand Down
20 changes: 17 additions & 3 deletions Doc/library/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ always available.

Call ``func(*args)``, while tracing is enabled. The tracing state is saved,
and restored afterwards. This is intended to be called from a debugger from
a checkpoint, to recursively debug some other code.
a checkpoint, to recursively debug or profile some other code.

Tracing is suspended while calling a tracing function set by
:func:`settrace` or :func:`setprofile` to avoid infinite recursion.
:func:`!call_tracing` enables explicit recursion of the tracing function.


.. data:: copyright
Expand Down Expand Up @@ -1473,13 +1477,16 @@ always available.
its return value is not used, so it can simply return ``None``. Error in the profile
function will cause itself unset.

.. note::
The same tracing mechanism is used for :func:`!setprofile` as :func:`settrace`.
To trace calls with :func:`!setprofile` inside a tracing function
(e.g. in a debugger breakpoint), see :func:`call_tracing`.

Profile functions should have three arguments: *frame*, *event*, and
*arg*. *frame* is the current stack frame. *event* is a string: ``'call'``,
``'return'``, ``'c_call'``, ``'c_return'``, or ``'c_exception'``. *arg* depends
on the event type.

.. audit-event:: sys.setprofile "" sys.setprofile

The events have the following meaning:

``'call'``
Expand All @@ -1501,6 +1508,9 @@ always available.
``'c_exception'``
A C function has raised an exception. *arg* is the C function object.

.. audit-event:: sys.setprofile "" sys.setprofile


.. function:: setrecursionlimit(limit)

Set the maximum depth of the Python interpreter stack to *limit*. This limit
Expand Down Expand Up @@ -1560,6 +1570,10 @@ always available.
If there is any error occurred in the trace function, it will be unset, just
like ``settrace(None)`` is called.

.. note::
Tracing is disabled while calling the trace function (e.g. a function set by
:func:`!settrace`). For recursive tracing see :func:`call_tracing`.

The events have the following meaning:

``'call'``
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/syslog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ This module provides an interface to the Unix ``syslog`` library routines.
Refer to the Unix manual pages for a detailed description of the ``syslog``
facility.

.. availability:: Unix, not Emscripten, not WASI.

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`.

.. include:: ../includes/wasm-notavail.rst

The module defines the following functions:


Expand Down
14 changes: 7 additions & 7 deletions Doc/library/tempfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,13 @@ Here are some examples of typical usage of the :mod:`tempfile` module::

# create a temporary file using a context manager
# close the file, use the name to open the file again
>>> with tempfile.TemporaryFile(delete_on_close=False) as fp:
... fp.write(b'Hello world!')
... fp.close()
# the file is closed, but not removed
# open the file again by using its name
... with open(fp.name) as f
... f.read()
>>> with tempfile.NamedTemporaryFile(delete_on_close=False) as fp:
... fp.write(b'Hello world!')
... fp.close()
... # the file is closed, but not removed
... # open the file again by using its name
... with open(fp.name, mode='rb') as f:
... f.read()
b'Hello world!'
>>>
# file is now removed
Expand Down
2 changes: 2 additions & 0 deletions Doc/library/termios.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ complete description of these calls, see :manpage:`termios(3)` Unix manual
page. It is only available for those Unix versions that support POSIX
*termios* style tty I/O control configured during installation.

.. availability:: Unix.

All functions in this module take a file descriptor *fd* as their first
argument. This can be an integer file descriptor, such as returned by
``sys.stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself.
Expand Down
Loading

0 comments on commit 18552d1

Please sign in to comment.