Skip to content

Commit

Permalink
Merge branch 'main' into capi-PyErr_FormatUnraisable
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Oct 31, 2023
2 parents bda2510 + c42347d commit 38b5ba2
Show file tree
Hide file tree
Showing 73 changed files with 2,297 additions and 1,553 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Doc/c-api/stable.rst @encukou

**/*idlelib* @terryjreedy

**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra @AlexWaygood
**/*typing* @gvanrossum @JelleZijlstra @AlexWaygood

**/*ftplib @giampaolo
**/*shutil @giampaolo
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,29 +182,29 @@ jobs:
name: 'Windows'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-build-windows.yml
uses: ./.github/workflows/reusable-windows.yml

build_windows_free_threaded:
name: 'Windows (free-threaded)'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
uses: ./.github/workflows/reusable-build-windows.yml
uses: ./.github/workflows/reusable-windows.yml
with:
free-threaded: true

build_macos:
name: 'macOS'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-build-macos.yml
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}

build_macos_free_threaded:
name: 'macOS (free-threaded)'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
uses: ./.github/workflows/reusable-build-macos.yml
uses: ./.github/workflows/reusable-macos.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
free-threaded: true
Expand All @@ -213,7 +213,7 @@ jobs:
name: 'Ubuntu'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
uses: ./.github/workflows/reusable-build-ubuntu.yml
uses: ./.github/workflows/reusable-ubuntu.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
options: |
Expand All @@ -226,7 +226,7 @@ jobs:
name: 'Ubuntu (free-threaded)'
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
uses: ./.github/workflows/reusable-build-ubuntu.yml
uses: ./.github/workflows/reusable-ubuntu.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
options: |
Expand Down Expand Up @@ -500,11 +500,13 @@ jobs:
- check_source # Transitive dependency, needed to access `run_tests` value
- check-docs
- check_generated_files
- build_windows
- build_macos
- build_macos_free_threaded
- build_ubuntu
- build_ubuntu_free_threaded
- build_ubuntu_ssltests
- build_windows
- build_windows_free_threaded
- test_hypothesis
- build_asan
- cifuzz
Expand All @@ -517,10 +519,10 @@ jobs:
with:
allowed-failures: >-
build_macos,
build_macos_free_threaded,
build_ubuntu_free_threaded,
build_ubuntu_ssltests,
build_win32,
build_win_arm64,
build_windows_free_threaded,
cifuzz,
test_hypothesis,
allowed-skips: >-
Expand All @@ -535,13 +537,13 @@ jobs:
needs.check_source.outputs.run_tests != 'true'
&& '
check_generated_files,
build_win32,
build_win_amd64,
build_win_arm64,
build_macos,
build_macos_free_threaded,
build_ubuntu,
build_ubuntu_free_threaded,
build_ubuntu_ssltests,
build_windows,
build_windows_free_threaded,
build_asan,
'
|| ''
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions Doc/howto/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ Dataclass support
When inheriting from a :class:`~dataclasses.dataclass`,
the :meth:`~Enum.__repr__` omits the inherited class' name. For example::

>>> from dataclasses import dataclass, field
>>> @dataclass
... class CreatureDataMixin:
... size: str
Expand Down Expand Up @@ -527,7 +528,8 @@ It is possible to modify how enum members are pickled/unpickled by defining
:meth:`__reduce_ex__` in the enumeration class. The default method is by-value,
but enums with complicated values may want to use by-name::

>>> class MyEnum(Enum):
>>> import enum
>>> class MyEnum(enum.Enum):
... __reduce_ex__ = enum.pickle_by_enum_name

.. note::
Expand Down Expand Up @@ -770,7 +772,7 @@ be combined with them (but may lose :class:`IntFlag` membership::
>>> Perm.X | 4
<Perm.R|X: 5>

>>> Perm.X | 8
>>> Perm.X + 8
9

.. note::
Expand Down Expand Up @@ -1435,8 +1437,9 @@ alias::
... GRENE = 2
...
Traceback (most recent call last):
...
...
ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'
Error calling __set_name__ on '_proto_member' instance 'GRENE' in 'Color'

.. note::

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
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
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
2 changes: 2 additions & 0 deletions Doc/library/tty.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
The :mod:`tty` module defines functions for putting the tty into cbreak and raw
modes.

.. availability:: Unix.

Because it requires the :mod:`termios` module, it will work only on Unix.

The :mod:`tty` module defines the following functions:
Expand Down
4 changes: 3 additions & 1 deletion Doc/library/xml.etree.elementtree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,9 @@ Functions
*parser* is an optional parser instance. If not given, the standard
:class:`XMLParser` parser is used. *parser* must be a subclass of
:class:`XMLParser` and can only use the default :class:`TreeBuilder` as a
target. Returns an :term:`iterator` providing ``(event, elem)`` pairs.
target. Returns an :term:`iterator` providing ``(event, elem)`` pairs;
it has a ``root`` attribute that references the root element of the
resulting XML tree once *source* is fully read.

Note that while :func:`iterparse` builds the tree incrementally, it issues
blocking reads on *source* (or the file it names). As such, it's unsuitable
Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,9 @@ importlib.resources
* :func:`importlib.resources.as_file` now supports resource directories.
(Contributed by Jason R. Coombs in :gh:`97930`.)

* Rename first parameter of :func:`importlib.resources.files` to *anchor*.
(Contributed by Jason R. Coombs in :gh:`100598`.)

inspect
-------

Expand Down
33 changes: 18 additions & 15 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -604,21 +604,6 @@ although there is currently no date scheduled for their removal.
* ``EntryPoints`` tuple interface.
* Implicit ``None`` on return values.

* :mod:`importlib.resources`: First parameter to files is renamed to 'anchor'.
* :mod:`importlib.resources` deprecated methods:

* ``contents()``
* ``is_resource()``
* ``open_binary()``
* ``open_text()``
* ``path()``
* ``read_binary()``
* ``read_text()``

Use ``files()`` instead. Refer to `importlib-resources: Migrating from Legacy
<https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_
for migration advice.

* :mod:`mailbox`: Use of StringIO input and text mode is deprecated, use
BytesIO and binary mode instead.

Expand Down Expand Up @@ -831,6 +816,24 @@ configparser
and with a deprecation warning since Python 3.11.
(Contributed by Hugo van Kemenade in :gh:`104886`.)

importlib
---------

* Remove :mod:`importlib.resources` deprecated methods:

* ``contents()``
* ``is_resource()``
* ``open_binary()``
* ``open_text()``
* ``path()``
* ``read_binary()``
* ``read_text()``

Use :func:`importlib.resources.files()` instead. Refer to `importlib-resources: Migrating from Legacy
<https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_
for migration advice.
(Contributed by Jason R. Coombs in :gh:`106532`.)

locale
------

Expand Down
Loading

0 comments on commit 38b5ba2

Please sign in to comment.