Skip to content

Commit 31e687d

Browse files
authored
Merge branch 'main' into pending-deprecations
2 parents 2740105 + b739ec5 commit 31e687d

File tree

73 files changed

+2617
-1253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2617
-1253
lines changed

Doc/c-api/init.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ Cautions regarding runtime finalization
11311131
In the late stage of :term:`interpreter shutdown`, after attempting to wait for
11321132
non-daemon threads to exit (though this can be interrupted by
11331133
:class:`KeyboardInterrupt`) and running the :mod:`atexit` functions, the runtime
1134-
is marked as *finalizing*: :c:func:`_Py_IsFinalizing` and
1134+
is marked as *finalizing*: :c:func:`Py_IsFinalizing` and
11351135
:func:`sys.is_finalizing` return true. At this point, only the *finalization
11361136
thread* that initiated finalization (typically the main thread) is allowed to
11371137
acquire the :term:`GIL`.

Doc/deprecations/pending-removal-in-3.16.rst

+8
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ Pending removal in Python 3.16
6767
and scheduled for removal in Python 3.16. Define handlers with the *stream*
6868
argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)
6969

70+
* :mod:`mimetypes`:
71+
72+
* Valid extensions start with a '.' or are empty for
73+
:meth:`mimetypes.MimeTypes.add_type`.
74+
Undotted extensions are deprecated and will
75+
raise a :exc:`ValueError` in Python 3.16.
76+
(Contributed by Hugo van Kemenade in :gh:`75223`.)
77+
7078
* :mod:`shutil`:
7179

7280
* The :class:`!ExecError` exception

Doc/library/decimal.rst

+21-12
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,14 @@ function to temporarily change the active context.
10311031
.. versionchanged:: 3.11
10321032
:meth:`localcontext` now supports setting context attributes through the use of keyword arguments.
10331033

1034+
.. function:: IEEEContext(bits)
1035+
1036+
Return a context object initialized to the proper values for one of the
1037+
IEEE interchange formats. The argument must be a multiple of 32 and less
1038+
than :const:`IEEE_CONTEXT_MAX_BITS`.
1039+
1040+
.. versionadded:: next
1041+
10341042
New contexts can also be created using the :class:`Context` constructor
10351043
described below. In addition, the module provides three pre-made contexts:
10361044

@@ -1552,18 +1560,19 @@ Constants
15521560
The constants in this section are only relevant for the C module. They
15531561
are also included in the pure Python version for compatibility.
15541562

1555-
+---------------------+---------------------+-------------------------------+
1556-
| | 32-bit | 64-bit |
1557-
+=====================+=====================+===============================+
1558-
| .. data:: MAX_PREC | ``425000000`` | ``999999999999999999`` |
1559-
+---------------------+---------------------+-------------------------------+
1560-
| .. data:: MAX_EMAX | ``425000000`` | ``999999999999999999`` |
1561-
+---------------------+---------------------+-------------------------------+
1562-
| .. data:: MIN_EMIN | ``-425000000`` | ``-999999999999999999`` |
1563-
+---------------------+---------------------+-------------------------------+
1564-
| .. data:: MIN_ETINY | ``-849999999`` | ``-1999999999999999997`` |
1565-
+---------------------+---------------------+-------------------------------+
1566-
1563+
+---------------------------------+---------------------+-------------------------------+
1564+
| | 32-bit | 64-bit |
1565+
+=================================+=====================+===============================+
1566+
| .. data:: MAX_PREC | ``425000000`` | ``999999999999999999`` |
1567+
+---------------------------------+---------------------+-------------------------------+
1568+
| .. data:: MAX_EMAX | ``425000000`` | ``999999999999999999`` |
1569+
+---------------------------------+---------------------+-------------------------------+
1570+
| .. data:: MIN_EMIN | ``-425000000`` | ``-999999999999999999`` |
1571+
+---------------------------------+---------------------+-------------------------------+
1572+
| .. data:: MIN_ETINY | ``-849999999`` | ``-1999999999999999997`` |
1573+
+---------------------------------+---------------------+-------------------------------+
1574+
| .. data:: IEEE_CONTEXT_MAX_BITS | ``256`` | ``512`` |
1575+
+---------------------------------+---------------------+-------------------------------+
15671576

15681577
.. data:: HAVE_THREADS
15691578

Doc/library/exceptions.rst

+4
Original file line numberDiff line numberDiff line change
@@ -428,13 +428,17 @@ The following exceptions are the exceptions that are usually raised.
428428
:exc:`PythonFinalizationError` during the Python finalization:
429429

430430
* Creating a new Python thread.
431+
* :meth:`Joining <threading.Thread.join>` a running daemon thread.
431432
* :func:`os.fork`.
432433

433434
See also the :func:`sys.is_finalizing` function.
434435

435436
.. versionadded:: 3.13
436437
Previously, a plain :exc:`RuntimeError` was raised.
437438

439+
.. versionchanged:: next
440+
441+
:meth:`threading.Thread.join` can now raise this exception.
438442

439443
.. exception:: RecursionError
440444

Doc/library/mimetypes.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,18 @@ than one MIME-type database; it provides an interface similar to the one of the
301301

302302
.. method:: MimeTypes.add_type(type, ext, strict=True)
303303

304-
Add a mapping from the MIME type *type* to the extension *ext*. When the
304+
Add a mapping from the MIME type *type* to the extension *ext*.
305+
Valid extensions start with a '.' or are empty. When the
305306
extension is already known, the new type will replace the old one. When the type
306307
is already known the extension will be added to the list of known extensions.
307308

308309
When *strict* is ``True`` (the default), the mapping will be added to the
309310
official MIME types, otherwise to the non-standard ones.
310311

312+
.. deprecated-removed:: 3.14 3.16
313+
Invalid, undotted extensions will raise a
314+
:exc:`ValueError` in Python 3.16.
315+
311316

312317
.. _mimetypes-cli:
313318

Doc/library/sysconfig.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,10 @@ Other functions
429429
Return the path of :file:`Makefile`.
430430

431431
.. _sysconfig-cli:
432+
.. _using-sysconfig-as-a-script:
432433

433-
Using :mod:`sysconfig` as a script
434-
----------------------------------
434+
Command-line usage
435+
------------------
435436

436437
You can use :mod:`sysconfig` as a script with Python's *-m* option:
437438

Doc/library/threading.rst

+8
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,14 @@ since it is impossible to detect the termination of alien threads.
448448
an error to :meth:`~Thread.join` a thread before it has been started
449449
and attempts to do so raise the same exception.
450450

451+
If an attempt is made to join a running daemonic thread in in late stages
452+
of :term:`Python finalization <interpreter shutdown>` :meth:`!join`
453+
raises a :exc:`PythonFinalizationError`.
454+
455+
.. versionchanged:: next
456+
457+
May raise :exc:`PythonFinalizationError`.
458+
451459
.. attribute:: name
452460

453461
A string used for identification purposes only. It has no semantics.

0 commit comments

Comments
 (0)