Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/c-api/iter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ There are two functions specifically for working with iterators.

- ``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*.
- ``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*.
- ``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``.
- ``PYGEN_ERROR`` if iterator has raised an exception. *presult* is set to ``NULL``.

.. versionadded:: 3.10
2 changes: 1 addition & 1 deletion Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ The :mod:`functools` module defines the following functions:

Note, type specificity applies only to the function's immediate arguments
rather than their contents. The scalar arguments, ``Decimal(42)`` and
``Fraction(42)`` are be treated as distinct calls with distinct results.
``Fraction(42)`` are treated as distinct calls with distinct results.
In contrast, the tuple arguments ``('answer', Decimal(42))`` and
``('answer', Fraction(42))`` are treated as equivalent.

Expand Down
74 changes: 37 additions & 37 deletions Doc/library/resource.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ platform.
.. data:: RLIMIT_CPU

The maximum amount of processor time (in seconds) that a process can use. If
this limit is exceeded, a :const:`SIGXCPU` signal is sent to the process. (See
this limit is exceeded, a :const:`~signal.SIGXCPU` signal is sent to the process. (See
the :mod:`signal` module documentation for information about how to catch this
signal and do something useful, e.g. flush open files to disk.)

Expand Down Expand Up @@ -363,47 +363,47 @@ These functions are used to retrieve resource usage information:
For backward compatibility, the return value is also accessible as a tuple of 16
elements.

The fields :attr:`ru_utime` and :attr:`ru_stime` of the return value are
The fields :attr:`!ru_utime` and :attr:`!ru_stime` of the return value are
floating-point values representing the amount of time spent executing in user
mode and the amount of time spent executing in system mode, respectively. The
remaining values are integers. Consult the :manpage:`getrusage(2)` man page for
detailed information about these values. A brief summary is presented here:

+--------+---------------------+---------------------------------------+
| Index | Field | Resource |
+========+=====================+=======================================+
| ``0`` | :attr:`ru_utime` | time in user mode (float seconds) |
+--------+---------------------+---------------------------------------+
| ``1`` | :attr:`ru_stime` | time in system mode (float seconds) |
+--------+---------------------+---------------------------------------+
| ``2`` | :attr:`ru_maxrss` | maximum resident set size |
+--------+---------------------+---------------------------------------+
| ``3`` | :attr:`ru_ixrss` | shared memory size |
+--------+---------------------+---------------------------------------+
| ``4`` | :attr:`ru_idrss` | unshared memory size |
+--------+---------------------+---------------------------------------+
| ``5`` | :attr:`ru_isrss` | unshared stack size |
+--------+---------------------+---------------------------------------+
| ``6`` | :attr:`ru_minflt` | page faults not requiring I/O |
+--------+---------------------+---------------------------------------+
| ``7`` | :attr:`ru_majflt` | page faults requiring I/O |
+--------+---------------------+---------------------------------------+
| ``8`` | :attr:`ru_nswap` | number of swap outs |
+--------+---------------------+---------------------------------------+
| ``9`` | :attr:`ru_inblock` | block input operations |
+--------+---------------------+---------------------------------------+
| ``10`` | :attr:`ru_oublock` | block output operations |
+--------+---------------------+---------------------------------------+
| ``11`` | :attr:`ru_msgsnd` | messages sent |
+--------+---------------------+---------------------------------------+
| ``12`` | :attr:`ru_msgrcv` | messages received |
+--------+---------------------+---------------------------------------+
| ``13`` | :attr:`ru_nsignals` | signals received |
+--------+---------------------+---------------------------------------+
| ``14`` | :attr:`ru_nvcsw` | voluntary context switches |
+--------+---------------------+---------------------------------------+
| ``15`` | :attr:`ru_nivcsw` | involuntary context switches |
+--------+---------------------+---------------------------------------+
+--------+----------------------+---------------------------------------+
| Index | Field | Resource |
+========+======================+=======================================+
| ``0`` | :attr:`!ru_utime` | time in user mode (float seconds) |
+--------+----------------------+---------------------------------------+
| ``1`` | :attr:`!ru_stime` | time in system mode (float seconds) |
+--------+----------------------+---------------------------------------+
| ``2`` | :attr:`!ru_maxrss` | maximum resident set size |
+--------+----------------------+---------------------------------------+
| ``3`` | :attr:`!ru_ixrss` | shared memory size |
+--------+----------------------+---------------------------------------+
| ``4`` | :attr:`!ru_idrss` | unshared memory size |
+--------+----------------------+---------------------------------------+
| ``5`` | :attr:`!ru_isrss` | unshared stack size |
+--------+----------------------+---------------------------------------+
| ``6`` | :attr:`!ru_minflt` | page faults not requiring I/O |
+--------+----------------------+---------------------------------------+
| ``7`` | :attr:`!ru_majflt` | page faults requiring I/O |
+--------+----------------------+---------------------------------------+
| ``8`` | :attr:`!ru_nswap` | number of swap outs |
+--------+----------------------+---------------------------------------+
| ``9`` | :attr:`!ru_inblock` | block input operations |
+--------+----------------------+---------------------------------------+
| ``10`` | :attr:`!ru_oublock` | block output operations |
+--------+----------------------+---------------------------------------+
| ``11`` | :attr:`!ru_msgsnd` | messages sent |
+--------+----------------------+---------------------------------------+
| ``12`` | :attr:`!ru_msgrcv` | messages received |
+--------+----------------------+---------------------------------------+
| ``13`` | :attr:`!ru_nsignals` | signals received |
+--------+----------------------+---------------------------------------+
| ``14`` | :attr:`!ru_nvcsw` | voluntary context switches |
+--------+----------------------+---------------------------------------+
| ``15`` | :attr:`!ru_nivcsw` | involuntary context switches |
+--------+----------------------+---------------------------------------+

This function will raise a :exc:`ValueError` if an invalid *who* parameter is
specified. It may also raise :exc:`error` exception in unusual circumstances.
Expand Down
6 changes: 6 additions & 0 deletions Doc/library/signal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,12 @@ The variables defined in the :mod:`signal` module are:

.. availability:: Unix.

.. data:: SIGXCPU

CPU time limit exceeded.

.. availability:: Unix.

.. data:: SIG*

All the signal numbers are defined symbolically. For example, the hangup signal
Expand Down
34 changes: 16 additions & 18 deletions Doc/library/zlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,20 @@ The available exception and functions in this module are:

.. versionadded:: 3.15

.. function:: compress(data, /, level=-1, wbits=MAX_WBITS)
.. function:: compress(data, /, level=Z_DEFAULT_COMPRESSION, wbits=MAX_WBITS)

Compresses the bytes in *data*, returning a bytes object containing compressed data.
*level* is an integer from ``0`` to ``9`` or ``-1`` controlling the level of compression;
``1`` (Z_BEST_SPEED) is fastest and produces the least compression, ``9`` (Z_BEST_COMPRESSION)
is slowest and produces the most. ``0`` (Z_NO_COMPRESSION) is no compression.
The default value is ``-1`` (Z_DEFAULT_COMPRESSION). Z_DEFAULT_COMPRESSION represents a default
compromise between speed and compression (currently equivalent to level 6).
See :const:`Z_BEST_SPEED` (``1``), :const:`Z_BEST_COMPRESSION` (``9``),
:const:`Z_NO_COMPRESSION` (``0``), and the default,
:const:`Z_DEFAULT_COMPRESSION` (``-1``) for more information about these values.

.. _compress-wbits:

The *wbits* argument controls the size of the history buffer (or the
"window size") used when compressing data, and whether a header and
trailer is included in the output. It can take several ranges of values,
defaulting to ``15`` (MAX_WBITS):
defaulting to ``15`` (:const:`MAX_WBITS`):

* +9 to +15: The base-two logarithm of the window size, which
therefore ranges between 512 and 32768. Larger values produce
Expand All @@ -94,17 +93,15 @@ The available exception and functions in this module are:
The *wbits* parameter is now available to set window bits and
compression type.

.. function:: compressobj(level=-1, method=DEFLATED, wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL, strategy=Z_DEFAULT_STRATEGY[, zdict])
.. function:: compressobj(level=Z_DEFAULT_COMPRESSION, method=DEFLATED, wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL, strategy=Z_DEFAULT_STRATEGY[, zdict])

Returns a compression object, to be used for compressing data streams that won't
fit into memory at once.

*level* is the compression level -- an integer from ``0`` to ``9`` or ``-1``.
A value of ``1`` (Z_BEST_SPEED) is fastest and produces the least compression,
while a value of ``9`` (Z_BEST_COMPRESSION) is slowest and produces the most.
``0`` (Z_NO_COMPRESSION) is no compression. The default value is ``-1`` (Z_DEFAULT_COMPRESSION).
Z_DEFAULT_COMPRESSION represents a default compromise between speed and compression
(currently equivalent to level 6).
See :const:`Z_BEST_SPEED` (``1``), :const:`Z_BEST_COMPRESSION` (``9``),
:const:`Z_NO_COMPRESSION` (``0``), and the default,
:const:`Z_DEFAULT_COMPRESSION` (``-1``) for more information about these values.

*method* is the compression algorithm. Currently, the only supported value is
:const:`DEFLATED`.
Expand All @@ -119,7 +116,7 @@ The available exception and functions in this module are:

*strategy* is used to tune the compression algorithm. Possible values are
:const:`Z_DEFAULT_STRATEGY`, :const:`Z_FILTERED`, :const:`Z_HUFFMAN_ONLY`,
:const:`Z_RLE` (zlib 1.2.0.1) and :const:`Z_FIXED` (zlib 1.2.2.2).
:const:`Z_RLE` and :const:`Z_FIXED`.

*zdict* is a predefined compression dictionary. This is a sequence of bytes
(such as a :class:`bytes` object) containing subsequences that are expected
Expand Down Expand Up @@ -247,7 +244,7 @@ Compression objects support the following methods:
All pending input is processed, and a bytes object containing the remaining compressed
output is returned. *mode* can be selected from the constants
:const:`Z_NO_FLUSH`, :const:`Z_PARTIAL_FLUSH`, :const:`Z_SYNC_FLUSH`,
:const:`Z_FULL_FLUSH`, :const:`Z_BLOCK` (zlib 1.2.3.4), or :const:`Z_FINISH`,
:const:`Z_FULL_FLUSH`, :const:`Z_BLOCK`, or :const:`Z_FINISH`,
defaulting to :const:`Z_FINISH`. Except :const:`Z_FINISH`, all constants
allow compressing further bytestrings of data, while :const:`Z_FINISH` finishes the
compressed stream and prevents compressing any more data. After calling :meth:`flush`
Expand Down Expand Up @@ -365,24 +362,25 @@ behavior:

.. data:: Z_NO_COMPRESSION

Compression level ``0``.
Compression level ``0``; no compression.

.. versionadded:: 3.6


.. data:: Z_BEST_SPEED

Compression level ``1``.
Compression level ``1``; fastest and produces the least compression.


.. data:: Z_BEST_COMPRESSION

Compression level ``9``.
Compression level ``9``; slowest and produces the most compression.


.. data:: Z_DEFAULT_COMPRESSION

Default compression level (``-1``).
Default compression level (``-1``); a compromise between speed and
compression. Currently equivalent to compression level ``6``.


.. data:: Z_DEFAULT_STRATEGY
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Doc/library/os.rst
Doc/library/pickletools.rst
Doc/library/profile.rst
Doc/library/pyexpat.rst
Doc/library/resource.rst
Doc/library/select.rst
Doc/library/socket.rst
Doc/library/ssl.rst
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix memory leak of ``PyConfig`` in subinterpreters.
6 changes: 3 additions & 3 deletions Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -17308,12 +17308,12 @@ os__supports_virtual_terminal_impl(PyObject *module)
/*[clinic input]
os._inputhook

Calls PyOS_CallInputHook droppong the GIL first
Calls PyOS_InputHook dropping the GIL first
[clinic start generated code]*/

static PyObject *
os__inputhook_impl(PyObject *module)
/*[clinic end generated code: output=525aca4ef3c6149f input=fc531701930d064f]*/
/*[clinic end generated code: output=525aca4ef3c6149f input=b5018fa1ec3aa440]*/
{
int result = 0;
if (PyOS_InputHook) {
Expand All @@ -17327,12 +17327,12 @@ os__inputhook_impl(PyObject *module)
/*[clinic input]
os._is_inputhook_installed

Checks if PyOS_CallInputHook is set
Checks if PyOS_InputHook is set
[clinic start generated code]*/

static PyObject *
os__is_inputhook_installed_impl(PyObject *module)
/*[clinic end generated code: output=3b3eab4f672c689a input=ff177c9938dd76d8]*/
/*[clinic end generated code: output=3b3eab4f672c689a input=757820f79f48820c]*/
{
return PyBool_FromLong(PyOS_InputHook != NULL);
}
Expand Down
2 changes: 2 additions & 0 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,8 @@ PyInterpreterState_Delete(PyInterpreterState *interp)

_PyObject_FiniState(interp);

PyConfig_Clear(&interp->config);

free_interpreter(interp);
}

Expand Down
Loading