Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-118331-wr-no-mem
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Apr 29, 2024
2 parents 15c85d4 + 444ac0b commit 728a297
Show file tree
Hide file tree
Showing 58 changed files with 950 additions and 512 deletions.
2 changes: 1 addition & 1 deletion Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Printing and clearing
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_WriteUnraisable(obj)`` is roughly equivalent to
``PyErr_FormatUnraisable("Exception ignored in: %R", obj)``.
If *format* is ``NULL``, only the traceback is printed.
Expand Down
2 changes: 1 addition & 1 deletion Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
Py_VISIT(Py_TYPE(self));

It is only needed since Python 3.9. To support Python 3.8 and older, this
line must be conditionnal::
line must be conditional::

#if PY_VERSION_HEX >= 0x03090000
Py_VISIT(Py_TYPE(self));
Expand Down
2 changes: 1 addition & 1 deletion Doc/howto/timerfd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ descriptors to wait until the file descriptor is ready for reading:
# In 1.5 seconds, 1st timer, 2nd timer and 3rd timer fires at once.
#
# If a timer file descriptor is signaled more than once since
# the last os.read() call, os.read() returns the nubmer of signaled
# the last os.read() call, os.read() returns the number of signaled
# as host order of class bytes.
print(f"Signaled events={events}")
for fd, event in events:
Expand Down
16 changes: 9 additions & 7 deletions Doc/library/faulthandler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@

This module contains functions to dump Python tracebacks explicitly, on a fault,
after a timeout, or on a user signal. Call :func:`faulthandler.enable` to
install fault handlers for the :const:`SIGSEGV`, :const:`SIGFPE`,
:const:`SIGABRT`, :const:`SIGBUS`, and :const:`SIGILL` signals. You can also
install fault handlers for the :const:`~signal.SIGSEGV`,
:const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`, and
:const:`~signal.SIGILL` signals. You can also
enable them at startup by setting the :envvar:`PYTHONFAULTHANDLER` environment
variable or by using the :option:`-X` ``faulthandler`` command line option.

The fault handler is compatible with system fault handlers like Apport or the
Windows fault handler. The module uses an alternative stack for signal handlers
if the :c:func:`sigaltstack` function is available. This allows it to dump the
if the :c:func:`!sigaltstack` function is available. This allows it to dump the
traceback even on a stack overflow.

The fault handler is called on catastrophic cases and therefore can only use
Expand Down Expand Up @@ -70,8 +71,9 @@ Fault handler state

.. function:: enable(file=sys.stderr, all_threads=True)

Enable the fault handler: install handlers for the :const:`SIGSEGV`,
:const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL`
Enable the fault handler: install handlers for the :const:`~signal.SIGSEGV`,
:const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`
and :const:`~signal.SIGILL`
signals to dump the Python traceback. If *all_threads* is ``True``,
produce tracebacks for every running thread. Otherwise, dump only the current
thread.
Expand Down Expand Up @@ -106,8 +108,8 @@ Dumping the tracebacks after a timeout

Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or
every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, call
:c:func:`_exit` with status=1 after dumping the tracebacks. (Note
:c:func:`_exit` exits the process immediately, which means it doesn't do any
:c:func:`!_exit` with status=1 after dumping the tracebacks. (Note
:c:func:`!_exit` exits the process immediately, which means it doesn't do any
cleanup like flushing file buffers.) If the function is called twice, the new
call replaces previous parameters and resets the timeout. The timer has a
sub-second resolution.
Expand Down
16 changes: 16 additions & 0 deletions Doc/library/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,22 @@ The :mod:`subprocess` module exposes the following constants.
Specifies that the :attr:`STARTUPINFO.wShowWindow` attribute contains
additional information.

.. data:: STARTF_FORCEONFEEDBACK

A :attr:`STARTUPINFO.dwFlags` parameter to specify that the
*Working in Background* mouse cursor will be displayed while a
process is launching. This is the default behavior for GUI
processes.

.. versionadded:: 3.13

.. data:: STARTF_FORCEOFFFEEDBACK

A :attr:`STARTUPINFO.dwFlags` parameter to specify that the mouse
cursor will not be changed when launching a process.

.. versionadded:: 3.13

.. data:: CREATE_NEW_CONSOLE

The new process has a new console, instead of inheriting its parent's
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Doc/library/email.errors.rst
Doc/library/email.parser.rst
Doc/library/email.policy.rst
Doc/library/exceptions.rst
Doc/library/faulthandler.rst
Doc/library/functools.rst
Doc/library/http.cookiejar.rst
Doc/library/http.server.rst
Expand Down
13 changes: 13 additions & 0 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,17 @@ Options for third-party dependencies
C compiler and linker flags for ``libffi``, used by :mod:`ctypes` module,
overriding ``pkg-config``.

.. option:: LIBMPDEC_CFLAGS
.. option:: LIBMPDEC_LIBS

C compiler and linker flags for ``libmpdec``, used by :mod:`decimal` module,
overriding ``pkg-config``.

.. note::

These environment variables have no effect unless
:option:`--with-system-libmpdec` is specified.

.. option:: LIBLZMA_CFLAGS
.. option:: LIBLZMA_LIBS

Expand Down Expand Up @@ -798,6 +809,8 @@ Libraries options

.. versionadded:: 3.3

.. seealso:: :option:`LIBMPDEC_CFLAGS` and :option:`LIBMPDEC_LIBS`.

.. option:: --with-readline=readline|editline

Designate a backend library for the :mod:`readline` module.
Expand Down
74 changes: 37 additions & 37 deletions Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ was expecting an indentation, including the location of the statement:
AttributeErrors
~~~~~~~~~~~~~~~
When printing :exc:`AttributeError`, :c:func:`PyErr_Display` will offer
When printing :exc:`AttributeError`, :c:func:`!PyErr_Display` will offer
suggestions of similar attribute names in the object that the exception was
raised from:
Expand All @@ -366,14 +366,14 @@ raised from:
(Contributed by Pablo Galindo in :issue:`38530`.)
.. warning::
Notice this won't work if :c:func:`PyErr_Display` is not called to display the error
Notice this won't work if :c:func:`!PyErr_Display` is not called to display the error
which can happen if some other custom error display function is used. This is a common
scenario in some REPLs like IPython.
NameErrors
~~~~~~~~~~
When printing :exc:`NameError` raised by the interpreter, :c:func:`PyErr_Display`
When printing :exc:`NameError` raised by the interpreter, :c:func:`!PyErr_Display`
will offer suggestions of similar variable names in the function that the exception
was raised from:
Expand All @@ -388,7 +388,7 @@ was raised from:
(Contributed by Pablo Galindo in :issue:`38530`.)
.. warning::
Notice this won't work if :c:func:`PyErr_Display` is not called to display the error,
Notice this won't work if :c:func:`!PyErr_Display` is not called to display the error,
which can happen if some other custom error display function is used. This is a common
scenario in some REPLs like IPython.
Expand Down Expand Up @@ -690,7 +690,7 @@ are in :pep:`635`, and a longer tutorial is in :pep:`636`.
Optional ``EncodingWarning`` and ``encoding="locale"`` option
-------------------------------------------------------------
The default encoding of :class:`TextIOWrapper` and :func:`open` is
The default encoding of :class:`~io.TextIOWrapper` and :func:`open` is
platform and locale dependent. Since UTF-8 is used on most Unix
platforms, omitting ``encoding`` option when opening UTF-8 files
(e.g. JSON, YAML, TOML, Markdown) is a very common bug. For example::
Expand Down Expand Up @@ -785,7 +785,7 @@ especially when forward references or invalid types were involved. Compare::
StrCache = 'Cache[str]' # a type alias
LOG_PREFIX = 'LOG[DEBUG]' # a module constant
Now the :mod:`typing` module has a special value :data:`TypeAlias`
Now the :mod:`typing` module has a special value :data:`~typing.TypeAlias`
which lets you declare type aliases more explicitly::
StrCache: TypeAlias = 'Cache[str]' # a type alias
Expand All @@ -798,10 +798,10 @@ See :pep:`613` for more details.
PEP 647: User-Defined Type Guards
---------------------------------
:data:`TypeGuard` has been added to the :mod:`typing` module to annotate
:data:`~typing.TypeGuard` has been added to the :mod:`typing` module to annotate
type guard functions and improve information provided to static type checkers
during type narrowing. For more information, please see :data:`TypeGuard`\ 's
documentation, and :pep:`647`.
during type narrowing. For more information, please see
:data:`~typing.TypeGuard`\ 's documentation, and :pep:`647`.
(Contributed by Ken Jin and Guido van Rossum in :issue:`43766`.
PEP written by Eric Traut.)
Expand Down Expand Up @@ -972,8 +972,8 @@ and objects representing asynchronously released resources.
Add asynchronous context manager support to :func:`contextlib.nullcontext`.
(Contributed by Tom Gringauz in :issue:`41543`.)
Add :class:`AsyncContextDecorator`, for supporting usage of async context managers
as decorators.
Add :class:`~contextlib.AsyncContextDecorator`, for supporting usage of async
context managers as decorators.
curses
------
Expand Down Expand Up @@ -1089,8 +1089,8 @@ encodings
enum
----
:class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and
:func:`__str__` now returns ``member_name``. Stdlib enums available as
:class:`~enum.Enum` :func:`~object.__repr__` now returns ``enum_name.member_name`` and
:func:`~object.__str__` now returns ``member_name``. Stdlib enums available as
module constants have a :func:`repr` of ``module_name.member_name``.
(Contributed by Ethan Furman in :issue:`40066`.)
Expand All @@ -1104,7 +1104,7 @@ Add *encoding* and *errors* parameters in :func:`fileinput.input` and
:class:`fileinput.FileInput`.
(Contributed by Inada Naoki in :issue:`43712`.)
:func:`fileinput.hook_compressed` now returns :class:`TextIOWrapper` object
:func:`fileinput.hook_compressed` now returns :class:`~io.TextIOWrapper` object
when *mode* is "r" and file is compressed, like uncompressed files.
(Contributed by Inada Naoki in :issue:`5758`.)
Expand Down Expand Up @@ -1202,12 +1202,12 @@ Feature parity with ``importlib_metadata`` 4.6
:ref:`importlib.metadata entry points <entry-points>`
now provide a nicer experience
for selecting entry points by group and name through a new
:class:`importlib.metadata.EntryPoints` class. See the Compatibility
:ref:`importlib.metadata.EntryPoints <entry-points>` class. See the Compatibility
Note in the docs for more info on the deprecation and usage.
Added :func:`importlib.metadata.packages_distributions` for resolving
top-level Python modules and packages to their
:class:`importlib.metadata.Distribution`.
Added :ref:`importlib.metadata.packages_distributions() <package-distributions>`
for resolving top-level Python modules and packages to their
:ref:`importlib.metadata.Distribution <distributions>`.
inspect
-------
Expand All @@ -1224,7 +1224,7 @@ best practice for accessing the annotations dict defined on any Python object;
for more information on best practices for working with annotations, please see
:ref:`annotations-howto`.
Relatedly, :func:`inspect.signature`,
:func:`inspect.Signature.from_callable`, and :func:`inspect.Signature.from_function`
:func:`inspect.Signature.from_callable`, and :func:`!inspect.Signature.from_function`
now call :func:`inspect.get_annotations` to retrieve annotations. This means
:func:`inspect.signature` and :func:`inspect.Signature.from_callable` can
also now un-stringize stringized annotations.
Expand Down Expand Up @@ -1484,9 +1484,9 @@ is a :class:`typing.TypedDict`.
Subclasses of ``typing.Protocol`` which only have data variables declared
will now raise a ``TypeError`` when checked with ``isinstance`` unless they
are decorated with :func:`runtime_checkable`. Previously, these checks
are decorated with :func:`~typing.runtime_checkable`. Previously, these checks
passed silently. Users should decorate their
subclasses with the :func:`runtime_checkable` decorator
subclasses with the :func:`!runtime_checkable` decorator
if they want runtime protocols.
(Contributed by Yurii Karabas in :issue:`38908`.)
Expand Down Expand Up @@ -1595,8 +1595,8 @@ Optimizations
:func:`map`, :func:`filter`, :func:`reversed`, :func:`bool` and :func:`float`.
(Contributed by Donghee Na and Jeroen Demeyer in :issue:`43575`, :issue:`43287`, :issue:`41922`, :issue:`41873` and :issue:`41870`.)
* :class:`BZ2File` performance is improved by removing internal ``RLock``.
This makes :class:`BZ2File` thread unsafe in the face of multiple simultaneous
* :class:`~bz2.BZ2File` performance is improved by removing internal ``RLock``.
This makes :class:`!BZ2File` thread unsafe in the face of multiple simultaneous
readers or writers, just like its equivalent classes in :mod:`gzip` and
:mod:`lzma` have always been. (Contributed by Inada Naoki in :issue:`43785`.)
Expand All @@ -1620,7 +1620,7 @@ Deprecated
cleaning up old import semantics that were kept for Python 2.7
compatibility. Specifically,
:meth:`!find_loader`/:meth:`!find_module`
(superseded by :meth:`~importlib.abc.Finder.find_spec`),
(superseded by :meth:`~importlib.abc.MetaPathFinder.find_spec`),
:meth:`~importlib.abc.Loader.load_module`
(superseded by :meth:`~importlib.abc.Loader.exec_module`),
:meth:`!module_repr` (which the import system
Expand All @@ -1647,7 +1647,7 @@ Deprecated
:meth:`~importlib.abc.Loader.exec_module` instead.
(Contributed by Brett Cannon in :issue:`26131`.)
* :meth:`zimport.zipimporter.load_module` has been deprecated in
* :meth:`!zimport.zipimporter.load_module` has been deprecated in
preference for :meth:`~zipimport.zipimporter.exec_module`.
(Contributed by Brett Cannon in :issue:`26131`.)
Expand Down Expand Up @@ -1759,23 +1759,23 @@ Deprecated
* The following :mod:`ssl` features have been deprecated since Python 3.6,
Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:
* :data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl.OP_NO_TLSv1`,
:data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and
:data:`~ssl.OP_NO_TLSv1_3` are replaced by
:attr:`sslSSLContext.minimum_version` and
:attr:`sslSSLContext.maximum_version`.
* :data:`!OP_NO_SSLv2`, :data:`!OP_NO_SSLv3`, :data:`!OP_NO_TLSv1`,
:data:`!OP_NO_TLSv1_1`, :data:`!OP_NO_TLSv1_2`, and
:data:`!OP_NO_TLSv1_3` are replaced by
:attr:`~ssl.SSLContext.minimum_version` and
:attr:`~ssl.SSLContext.maximum_version`.
* :data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`,
:data:`~ssl.PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`,
:data:`~ssl.PROTOCOL_TLSv1_1`, :data:`~ssl.PROTOCOL_TLSv1_2`, and
:const:`~ssl.PROTOCOL_TLS` are deprecated in favor of
* :data:`!PROTOCOL_SSLv2`, :data:`!PROTOCOL_SSLv3`,
:data:`!PROTOCOL_SSLv23`, :data:`!PROTOCOL_TLSv1`,
:data:`!PROTOCOL_TLSv1_1`, :data:`!PROTOCOL_TLSv1_2`, and
:const:`!PROTOCOL_TLS` are deprecated in favor of
:const:`~ssl.PROTOCOL_TLS_CLIENT` and :const:`~ssl.PROTOCOL_TLS_SERVER`
* :func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`
* :func:`!wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`
* :func:`~ssl.match_hostname`
* :func:`!match_hostname`
* :func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`
* :func:`!RAND_pseudo_bytes`, :func:`!RAND_egd`
* NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and
:meth:`ssl.SSLContext.set_npn_protocols` are replaced by ALPN.
Expand Down
4 changes: 3 additions & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ Other Language Changes
(Contributed by Pedro Sousa Lacerda in :gh:`66449`.)

* :ref:`annotation scope <annotation-scopes>` within class scopes can now
contain lambdas. (Contributed by Jelle Zijlstra in :gh:`109118`.)
contain lambdas and comprehensions. Comprehensions that are located within
class scopes are not inlined into their parent scope. (Contributed by
Jelle Zijlstra in :gh:`109118` and :gh:`118160`.)


New Modules
Expand Down
6 changes: 3 additions & 3 deletions Doc/whatsnew/3.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,8 @@ include:
* The new :func:`asyncio.current_task` function returns the currently running
:class:`~asyncio.Task` instance, and the new :func:`asyncio.all_tasks`
function returns a set of all existing ``Task`` instances in a given loop.
The :meth:`Task.current_task() <asyncio.Task.current_task>` and
:meth:`Task.all_tasks() <asyncio.Task.all_tasks>` methods have been deprecated.
The :meth:`!Task.current_task` and
:meth:`!Task.all_tasks` methods have been deprecated.
(Contributed by Andrew Svetlov in :issue:`32250`.)

* The new *provisional* :class:`~asyncio.BufferedProtocol` class allows
Expand Down Expand Up @@ -1969,7 +1969,7 @@ asynchronous context manager must be used in order to acquire and release
the synchronization resource.
(Contributed by Andrew Svetlov in :issue:`32253`.)

The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks`
The :meth:`!asyncio.Task.current_task` and :meth:`!asyncio.Task.all_tasks`
methods have been deprecated.
(Contributed by Andrew Svetlov in :issue:`32250`.)

Expand Down
Loading

0 comments on commit 728a297

Please sign in to comment.