Skip to content

Commit 7ace308

Browse files
authored
Merge branch '3.13' into 313_test__interpchannels_leak
2 parents 61b5939 + 15f92e6 commit 7ace308

35 files changed

+307
-65
lines changed

Doc/bugs.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ If you find a bug in this documentation or would like to propose an improvement,
1919
please submit a bug report on the :ref:`issue tracker <using-the-tracker>`. If you
2020
have a suggestion on how to fix it, include that as well.
2121

22+
.. only:: translation
23+
24+
If the bug or suggested improvement concerns the translation of this
25+
documentation, submit the report to the
26+
`translation’s repository <TRANSLATION_REPO_>`_ instead.
27+
2228
You can also open a discussion item on our
2329
`Documentation Discourse forum <https://discuss.python.org/c/documentation/26>`_.
2430

Doc/c-api/arg.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ There are three ways strings and buffers can be converted to C:
160160
``w*`` (read-write :term:`bytes-like object`) [Py_buffer]
161161
This format accepts any object which implements the read-write buffer
162162
interface. It fills a :c:type:`Py_buffer` structure provided by the caller.
163-
The buffer may contain embedded null bytes. The caller have to call
163+
The buffer may contain embedded null bytes. The caller has to call
164164
:c:func:`PyBuffer_Release` when it is done with the buffer.
165165

166166
``es`` (:class:`str`) [const char \*encoding, char \*\*buffer]

Doc/c-api/capsule.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Refer to :ref:`using-capsules` for more information on using these objects.
1515
.. c:type:: PyCapsule
1616
1717
This subtype of :c:type:`PyObject` represents an opaque value, useful for C
18-
extension modules who need to pass an opaque value (as a :c:expr:`void*`
18+
extension modules which need to pass an opaque value (as a :c:expr:`void*`
1919
pointer) through Python code to other C code. It is often used to make a C
2020
function pointer defined in one module available to other modules, so the
2121
regular import mechanism can be used to access C APIs defined in dynamically

Doc/c-api/code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ may change without deprecation warnings.
285285
286286
.. c:function:: Py_ssize_t PyUnstable_Eval_RequestCodeExtraIndex(freefunc free)
287287
288-
Return a new an opaque index value used to adding data to code objects.
288+
Return a new opaque index value used to adding data to code objects.
289289
290290
You generally call this function once (per interpreter) and use the result
291291
with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate

Doc/c-api/codec.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Codec registry and support functions
77
88
Register a new codec search function.
99
10-
As side effect, this tries to load the :mod:`!encodings` package, if not yet
10+
As a side effect, this tries to load the :mod:`!encodings` package, if not yet
1111
done, to make sure that it is always first in the list of search functions.
1212
1313
.. c:function:: int PyCodec_Unregister(PyObject *search_function)

Doc/c-api/module.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ Module Objects
102102
Return a pointer to the :c:type:`PyModuleDef` struct from which the module was
103103
created, or ``NULL`` if the module wasn't created from a definition.
104104
105+
On error, return ``NULL`` with an exception set.
106+
Use :c:func:`PyErr_Occurred` to tell this case apart from a mising
107+
:c:type:`!PyModuleDef`.
108+
105109
106110
.. c:function:: PyObject* PyModule_GetFilenameObject(PyObject *module)
107111

Doc/conf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,25 @@
445445
# https://github.com/sphinx-doc/sphinx/issues/12359
446446
epub_use_index = False
447447

448+
# translation tag
449+
# ---------------
450+
451+
language_code = None
452+
for arg in sys.argv:
453+
if arg.startswith('language='):
454+
language_code = arg.split('=', 1)[1]
455+
456+
if language_code:
457+
tags.add('translation') # noqa: F821
458+
459+
rst_epilog += f"""\
460+
.. _TRANSLATION_REPO: https://github.com/python/python-docs-{language_code.replace("_", "-").lower()}
461+
""" # noqa: F821
462+
else:
463+
rst_epilog += """\
464+
.. _TRANSLATION_REPO: https://github.com/python
465+
"""
466+
448467
# Options for the coverage checker
449468
# --------------------------------
450469

Doc/faq/general.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ How do I get documentation on Python?
186186
-------------------------------------
187187

188188
The standard documentation for the current stable version of Python is available
189-
at https://docs.python.org/3/. PDF, plain text, and downloadable HTML versions are
189+
at https://docs.python.org/3/. EPUB, plain text, and downloadable HTML versions are
190190
also available at https://docs.python.org/3/download.html.
191191

192192
The documentation is written in reStructuredText and processed by `the Sphinx

Doc/library/xmlrpc.client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ Convenience Functions
524524

525525
.. function:: dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=False)
526526

527-
Convert *params* into an XML-RPC request. or into a response if *methodresponse*
527+
Convert *params* into an XML-RPC request, or into a response if *methodresponse*
528528
is true. *params* can be either a tuple of arguments or an instance of the
529529
:exc:`Fault` exception class. If *methodresponse* is true, only a single value
530530
can be returned, meaning that *params* must be of length 1. *encoding*, if

Doc/library/zlib.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,20 @@ The available exception and functions in this module are:
4444
.. versionchanged:: 3.0
4545
The result is always unsigned.
4646

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

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

5655
.. _compress-wbits:
5756

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

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

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

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

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

9794
*method* is the compression algorithm. Currently, the only supported value is
9895
:const:`DEFLATED`.
@@ -107,7 +104,7 @@ The available exception and functions in this module are:
107104

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

112109
*zdict* is a predefined compression dictionary. This is a sequence of bytes
113110
(such as a :class:`bytes` object) containing subsequences that are expected
@@ -221,7 +218,7 @@ Compression objects support the following methods:
221218
All pending input is processed, and a bytes object containing the remaining compressed
222219
output is returned. *mode* can be selected from the constants
223220
:const:`Z_NO_FLUSH`, :const:`Z_PARTIAL_FLUSH`, :const:`Z_SYNC_FLUSH`,
224-
:const:`Z_FULL_FLUSH`, :const:`Z_BLOCK` (zlib 1.2.3.4), or :const:`Z_FINISH`,
221+
:const:`Z_FULL_FLUSH`, :const:`Z_BLOCK`, or :const:`Z_FINISH`,
225222
defaulting to :const:`Z_FINISH`. Except :const:`Z_FINISH`, all constants
226223
allow compressing further bytestrings of data, while :const:`Z_FINISH` finishes the
227224
compressed stream and prevents compressing any more data. After calling :meth:`flush`
@@ -339,24 +336,25 @@ behavior:
339336

340337
.. data:: Z_NO_COMPRESSION
341338

342-
Compression level ``0``.
339+
Compression level ``0``; no compression.
343340

344341
.. versionadded:: 3.6
345342

346343

347344
.. data:: Z_BEST_SPEED
348345

349-
Compression level ``1``.
346+
Compression level ``1``; fastest and produces the least compression.
350347

351348

352349
.. data:: Z_BEST_COMPRESSION
353350

354-
Compression level ``9``.
351+
Compression level ``9``; slowest and produces the most compression.
355352

356353

357354
.. data:: Z_DEFAULT_COMPRESSION
358355

359-
Default compression level (``-1``).
356+
Default compression level (``-1``); a compromise between speed and
357+
compression. Currently equivalent to compression level ``6``.
360358

361359

362360
.. data:: Z_DEFAULT_STRATEGY

0 commit comments

Comments
 (0)