Skip to content

Commit 46a84b1

Browse files
authored
Merge branch 'main' into fix-issue-gh-105802
2 parents a614ff1 + 1aec064 commit 46a84b1

Some content is hidden

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

41 files changed

+328
-159
lines changed

.github/workflows/jit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
jit:
1919
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
2020
runs-on: ${{ matrix.runner }}
21+
timeout-minutes: 60
2122
strategy:
2223
fail-fast: false
2324
matrix:

Doc/howto/logging.rst

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ custom handlers) are the following configuration methods:
520520

521521
* The :meth:`~Handler.setLevel` method, just as in logger objects, specifies the
522522
lowest severity that will be dispatched to the appropriate destination. Why
523-
are there two :func:`setLevel` methods? The level set in the logger
523+
are there two :meth:`~Handler.setLevel` methods? The level set in the logger
524524
determines which severity of messages it will pass to its handlers. The level
525525
set in each handler determines which messages that handler will send on.
526526

@@ -774,29 +774,29 @@ What happens if no configuration is provided
774774

775775
If no logging configuration is provided, it is possible to have a situation
776776
where a logging event needs to be output, but no handlers can be found to
777-
output the event. The behaviour of the logging package in these
778-
circumstances is dependent on the Python version.
777+
output the event.
779778

780-
For versions of Python prior to 3.2, the behaviour is as follows:
779+
The event is output using a 'handler of last resort', stored in
780+
:data:`lastResort`. This internal handler is not associated with any
781+
logger, and acts like a :class:`~logging.StreamHandler` which writes the
782+
event description message to the current value of ``sys.stderr`` (therefore
783+
respecting any redirections which may be in effect). No formatting is
784+
done on the message - just the bare event description message is printed.
785+
The handler's level is set to ``WARNING``, so all events at this and
786+
greater severities will be output.
781787

782-
* If *logging.raiseExceptions* is ``False`` (production mode), the event is
783-
silently dropped.
788+
.. versionchanged:: 3.2
784789

785-
* If *logging.raiseExceptions* is ``True`` (development mode), a message
786-
'No handlers could be found for logger X.Y.Z' is printed once.
790+
For versions of Python prior to 3.2, the behaviour is as follows:
787791

788-
In Python 3.2 and later, the behaviour is as follows:
792+
* If :data:`raiseExceptions` is ``False`` (production mode), the event is
793+
silently dropped.
789794

790-
* The event is output using a 'handler of last resort', stored in
791-
``logging.lastResort``. This internal handler is not associated with any
792-
logger, and acts like a :class:`~logging.StreamHandler` which writes the
793-
event description message to the current value of ``sys.stderr`` (therefore
794-
respecting any redirections which may be in effect). No formatting is
795-
done on the message - just the bare event description message is printed.
796-
The handler's level is set to ``WARNING``, so all events at this and
797-
greater severities will be output.
795+
* If :data:`raiseExceptions` is ``True`` (development mode), a message
796+
'No handlers could be found for logger X.Y.Z' is printed once.
798797

799-
To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to ``None``.
798+
To obtain the pre-3.2 behaviour,
799+
:data:`lastResort` can be set to ``None``.
800800

801801
.. _library-config:
802802

@@ -998,7 +998,7 @@ Logged messages are formatted for presentation through instances of the
998998
use with the % operator and a dictionary.
999999

10001000
For formatting multiple messages in a batch, instances of
1001-
:class:`~handlers.BufferingFormatter` can be used. In addition to the format
1001+
:class:`BufferingFormatter` can be used. In addition to the format
10021002
string (which is applied to each message in the batch), there is provision for
10031003
header and trailer format strings.
10041004

@@ -1034,7 +1034,8 @@ checks to see if a module-level variable, :data:`raiseExceptions`, is set. If
10341034
set, a traceback is printed to :data:`sys.stderr`. If not set, the exception is
10351035
swallowed.
10361036

1037-
.. note:: The default value of :data:`raiseExceptions` is ``True``. This is
1037+
.. note::
1038+
The default value of :data:`raiseExceptions` is ``True``. This is
10381039
because during development, you typically want to be notified of any
10391040
exceptions that occur. It's advised that you set :data:`raiseExceptions` to
10401041
``False`` for production usage.
@@ -1072,7 +1073,7 @@ You can write code like this::
10721073
expensive_func2())
10731074

10741075
so that if the logger's threshold is set above ``DEBUG``, the calls to
1075-
:func:`expensive_func1` and :func:`expensive_func2` are never made.
1076+
``expensive_func1`` and ``expensive_func2`` are never made.
10761077

10771078
.. note:: In some cases, :meth:`~Logger.isEnabledFor` can itself be more
10781079
expensive than you'd like (e.g. for deeply nested loggers where an explicit

Doc/library/datetime.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,15 @@ Other constructors, all class methods:
536536
.. classmethod:: date.fromisoformat(date_string)
537537

538538
Return a :class:`date` corresponding to a *date_string* given in any valid
539-
ISO 8601 format, except ordinal dates (e.g. ``YYYY-DDD``)::
539+
ISO 8601 format, with the following exceptions:
540+
541+
1. Reduced precision dates are not currently supported (``YYYY-MM``,
542+
``YYYY``).
543+
2. Extended date representations are not currently supported
544+
(``±YYYYYY-MM-DD``).
545+
3. Ordinal dates are not currently supported (``YYYY-OOO``).
546+
547+
Examples::
540548

541549
>>> from datetime import date
542550
>>> date.fromisoformat('2019-12-04')
@@ -1017,8 +1025,12 @@ Other constructors, all class methods:
10171025

10181026
1. Time zone offsets may have fractional seconds.
10191027
2. The ``T`` separator may be replaced by any single unicode character.
1020-
3. Ordinal dates are not currently supported.
1021-
4. Fractional hours and minutes are not supported.
1028+
3. Fractional hours and minutes are not supported.
1029+
4. Reduced precision dates are not currently supported (``YYYY-MM``,
1030+
``YYYY``).
1031+
5. Extended date representations are not currently supported
1032+
(``±YYYYYY-MM-DD``).
1033+
6. Ordinal dates are not currently supported (``YYYY-OOO``).
10221034

10231035
Examples::
10241036

Doc/library/gzip.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The module defines the following items:
6161

6262
.. exception:: BadGzipFile
6363

64-
An exception raised for invalid gzip files. It inherits :exc:`OSError`.
64+
An exception raised for invalid gzip files. It inherits from :exc:`OSError`.
6565
:exc:`EOFError` and :exc:`zlib.error` can also be raised for invalid gzip
6666
files.
6767

@@ -287,4 +287,3 @@ Command line options
287287
.. option:: -h, --help
288288

289289
Show the help message.
290-

Doc/library/io.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ I/O Base Classes
466466

467467
.. class:: RawIOBase
468468

469-
Base class for raw binary streams. It inherits :class:`IOBase`.
469+
Base class for raw binary streams. It inherits from :class:`IOBase`.
470470

471471
Raw binary streams typically provide low-level access to an underlying OS
472472
device or API, and do not try to encapsulate it in high-level primitives
@@ -519,7 +519,7 @@ I/O Base Classes
519519
.. class:: BufferedIOBase
520520

521521
Base class for binary streams that support some kind of buffering.
522-
It inherits :class:`IOBase`.
522+
It inherits from :class:`IOBase`.
523523

524524
The main difference with :class:`RawIOBase` is that methods :meth:`read`,
525525
:meth:`readinto` and :meth:`write` will try (respectively) to read as much
@@ -633,7 +633,7 @@ Raw File I/O
633633
.. class:: FileIO(name, mode='r', closefd=True, opener=None)
634634

635635
A raw binary stream representing an OS-level file containing bytes data. It
636-
inherits :class:`RawIOBase`.
636+
inherits from :class:`RawIOBase`.
637637

638638
The *name* can be one of two things:
639639

@@ -696,7 +696,7 @@ than raw I/O does.
696696

697697
.. class:: BytesIO(initial_bytes=b'')
698698

699-
A binary stream using an in-memory bytes buffer. It inherits
699+
A binary stream using an in-memory bytes buffer. It inherits from
700700
:class:`BufferedIOBase`. The buffer is discarded when the
701701
:meth:`~IOBase.close` method is called.
702702

@@ -745,7 +745,7 @@ than raw I/O does.
745745
.. class:: BufferedReader(raw, buffer_size=DEFAULT_BUFFER_SIZE)
746746

747747
A buffered binary stream providing higher-level access to a readable, non
748-
seekable :class:`RawIOBase` raw binary stream. It inherits
748+
seekable :class:`RawIOBase` raw binary stream. It inherits from
749749
:class:`BufferedIOBase`.
750750

751751
When reading data from this object, a larger amount of data may be
@@ -783,7 +783,7 @@ than raw I/O does.
783783
.. class:: BufferedWriter(raw, buffer_size=DEFAULT_BUFFER_SIZE)
784784

785785
A buffered binary stream providing higher-level access to a writeable, non
786-
seekable :class:`RawIOBase` raw binary stream. It inherits
786+
seekable :class:`RawIOBase` raw binary stream. It inherits from
787787
:class:`BufferedIOBase`.
788788

789789
When writing to this object, data is normally placed into an internal
@@ -818,7 +818,7 @@ than raw I/O does.
818818
.. class:: BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE)
819819

820820
A buffered binary stream providing higher-level access to a seekable
821-
:class:`RawIOBase` raw binary stream. It inherits :class:`BufferedReader`
821+
:class:`RawIOBase` raw binary stream. It inherits from :class:`BufferedReader`
822822
and :class:`BufferedWriter`.
823823

824824
The constructor creates a reader and writer for a seekable raw stream, given
@@ -834,7 +834,7 @@ than raw I/O does.
834834

835835
A buffered binary stream providing higher-level access to two non seekable
836836
:class:`RawIOBase` raw binary streams---one readable, the other writeable.
837-
It inherits :class:`BufferedIOBase`.
837+
It inherits from :class:`BufferedIOBase`.
838838

839839
*reader* and *writer* are :class:`RawIOBase` objects that are readable and
840840
writeable respectively. If the *buffer_size* is omitted it defaults to
@@ -857,7 +857,7 @@ Text I/O
857857
.. class:: TextIOBase
858858

859859
Base class for text streams. This class provides a character and line based
860-
interface to stream I/O. It inherits :class:`IOBase`.
860+
interface to stream I/O. It inherits from :class:`IOBase`.
861861

862862
:class:`TextIOBase` provides or overrides these data attributes and
863863
methods in addition to those from :class:`IOBase`:
@@ -946,7 +946,7 @@ Text I/O
946946
line_buffering=False, write_through=False)
947947

948948
A buffered text stream providing higher-level access to a
949-
:class:`BufferedIOBase` buffered binary stream. It inherits
949+
:class:`BufferedIOBase` buffered binary stream. It inherits from
950950
:class:`TextIOBase`.
951951

952952
*encoding* gives the name of the encoding that the stream will be decoded or
@@ -1073,7 +1073,7 @@ Text I/O
10731073

10741074
.. class:: StringIO(initial_value='', newline='\n')
10751075

1076-
A text stream using an in-memory text buffer. It inherits
1076+
A text stream using an in-memory text buffer. It inherits from
10771077
:class:`TextIOBase`.
10781078

10791079
The text buffer is discarded when the :meth:`~IOBase.close` method is
@@ -1124,7 +1124,7 @@ Text I/O
11241124
.. class:: IncrementalNewlineDecoder
11251125

11261126
A helper codec that decodes newlines for :term:`universal newlines` mode.
1127-
It inherits :class:`codecs.IncrementalDecoder`.
1127+
It inherits from :class:`codecs.IncrementalDecoder`.
11281128

11291129

11301130
Performance

Doc/library/logging.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,12 @@ subclasses. However, the :meth:`!__init__` method in subclasses needs to call
531531

532532
This method should be called from handlers when an exception is encountered
533533
during an :meth:`emit` call. If the module-level attribute
534-
``raiseExceptions`` is ``False``, exceptions get silently ignored. This is
534+
:data:`raiseExceptions` is ``False``, exceptions get silently ignored. This is
535535
what is mostly wanted for a logging system - most users will not care about
536536
errors in the logging system, they are more interested in application
537537
errors. You could, however, replace this with a custom handler if you wish.
538538
The specified record is the one which was being processed when the exception
539-
occurred. (The default value of ``raiseExceptions`` is ``True``, as that is
539+
occurred. (The default value of :data:`raiseExceptions` is ``True``, as that is
540540
more useful during development).
541541

542542

@@ -1494,6 +1494,18 @@ Module-Level Attributes
14941494

14951495
.. versionadded:: 3.2
14961496

1497+
.. attribute:: raiseExceptions
1498+
1499+
Used to see if exceptions during handling should be propagated.
1500+
1501+
Default: ``True``.
1502+
1503+
If :data:`raiseExceptions` is ``False``,
1504+
exceptions get silently ignored. This is what is mostly wanted
1505+
for a logging system - most users will not care about errors in
1506+
the logging system, they are more interested in application errors.
1507+
1508+
14971509
Integration with the warnings module
14981510
------------------------------------
14991511

Doc/library/multiprocessing.shared_memory.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ processes, a :class:`~multiprocessing.managers.BaseManager` subclass,
2323
:class:`~multiprocessing.managers.SharedMemoryManager`, is also provided in the
2424
:mod:`multiprocessing.managers` module.
2525

26-
In this module, shared memory refers to "System V style" shared memory blocks
26+
In this module, shared memory refers to "POSIX style" shared memory blocks
2727
(though is not necessarily implemented explicitly as such) and does not refer
2828
to "distributed shared memory". This style of shared memory permits distinct
2929
processes to potentially read and write to a common (or shared) region of

Doc/library/pickle.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,21 +272,21 @@ The :mod:`pickle` module defines three exceptions:
272272

273273
.. exception:: PickleError
274274

275-
Common base class for the other pickling exceptions. It inherits
275+
Common base class for the other pickling exceptions. It inherits from
276276
:exc:`Exception`.
277277

278278
.. exception:: PicklingError
279279

280280
Error raised when an unpicklable object is encountered by :class:`Pickler`.
281-
It inherits :exc:`PickleError`.
281+
It inherits from :exc:`PickleError`.
282282

283283
Refer to :ref:`pickle-picklable` to learn what kinds of objects can be
284284
pickled.
285285

286286
.. exception:: UnpicklingError
287287

288288
Error raised when there is a problem unpickling an object, such as a data
289-
corruption or a security violation. It inherits :exc:`PickleError`.
289+
corruption or a security violation. It inherits from :exc:`PickleError`.
290290

291291
Note that other exceptions may also be raised during unpickling, including
292292
(but not necessarily limited to) AttributeError, EOFError, ImportError, and

Doc/library/symtable.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Examining Symbol Tables
9797

9898
.. class:: Function
9999

100-
A namespace for a function or method. This class inherits
100+
A namespace for a function or method. This class inherits from
101101
:class:`SymbolTable`.
102102

103103
.. method:: get_parameters()
@@ -123,7 +123,7 @@ Examining Symbol Tables
123123

124124
.. class:: Class
125125

126-
A namespace of a class. This class inherits :class:`SymbolTable`.
126+
A namespace of a class. This class inherits from :class:`SymbolTable`.
127127

128128
.. method:: get_methods()
129129

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Doc/extending/extending.rst
1818
Doc/glossary.rst
1919
Doc/howto/descriptor.rst
2020
Doc/howto/enum.rst
21-
Doc/howto/logging.rst
2221
Doc/library/ast.rst
2322
Doc/library/asyncio-extending.rst
2423
Doc/library/asyncio-policy.rst

0 commit comments

Comments
 (0)