Skip to content

Commit 1e75fe1

Browse files
[3.12] gh-115664: Fix ordering of more versionadded and versionchanged directives (GH-116298) (GH-116450)
(cherry picked from commit 808a776)
1 parent 0150595 commit 1e75fe1

21 files changed

+69
-93
lines changed

Doc/c-api/contextvars.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Context Variables Objects
66
-------------------------
77

88
.. _contextvarsobjects_pointertype_change:
9+
.. versionadded:: 3.7
10+
911
.. versionchanged:: 3.7.1
1012

1113
.. note::
@@ -24,8 +26,6 @@ Context Variables Objects
2426
See :issue:`34762` for more details.
2527

2628

27-
.. versionadded:: 3.7
28-
2929
This section details the public C API for the :mod:`contextvars` module.
3030

3131
.. c:type:: PyContext

Doc/c-api/import.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ Importing Modules
292292
293293
The module name, as an ASCII encoded string.
294294
295-
.. c: member:: PyObject* (*initfunc)(void)
295+
.. c:member:: PyObject* (*initfunc)(void)
296296
297297
Initialization function for a module built into the interpreter.
298298

Doc/c-api/init.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,14 +1822,14 @@ pointer and a void pointer argument.
18221822
function is generally **not** suitable for calling Python code from
18231823
arbitrary C threads. Instead, use the :ref:`PyGILState API<gilstate>`.
18241824
1825+
.. versionadded:: 3.1
1826+
18251827
.. versionchanged:: 3.9
18261828
If this function is called in a subinterpreter, the function *func* is
18271829
now scheduled to be called from the subinterpreter, rather than being
18281830
called from the main interpreter. Each subinterpreter now has its own
18291831
list of scheduled calls.
18301832
1831-
.. versionadded:: 3.1
1832-
18331833
.. _profiling:
18341834
18351835
Profiling and Tracing

Doc/c-api/refcounting.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ of Python objects.
2323
2424
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
2525
26-
.. versionchanged:: 3.11
27-
The parameter type is no longer :c:expr:`const PyObject*`.
28-
2926
.. versionchanged:: 3.10
3027
:c:func:`Py_REFCNT()` is changed to the inline static function.
3128
29+
.. versionchanged:: 3.11
30+
The parameter type is no longer :c:expr:`const PyObject*`.
31+
3232
3333
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
3434

Doc/library/asyncio-eventloop.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ Opening network connections
605605
The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*,
606606
*allow_broadcast*, and *sock* parameters were added.
607607

608+
.. versionchanged:: 3.8
609+
Added support for Windows.
610+
608611
.. versionchanged:: 3.8.1
609612
The *reuse_address* parameter is no longer supported, as using
610613
:ref:`socket.SO_REUSEADDR <socket-unix-constants>`
@@ -622,9 +625,6 @@ Opening network connections
622625
prevents processes with differing UIDs from assigning sockets to the same
623626
socket address.
624627

625-
.. versionchanged:: 3.8
626-
Added support for Windows.
627-
628628
.. versionchanged:: 3.11
629629
The *reuse_address* parameter, disabled since Python 3.8.1,
630630
3.7.6 and 3.6.10, has been entirely removed.

Doc/library/bz2.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ The :mod:`bz2` module contains:
156156
Support was added for *filename* being a :term:`file object` instead of an
157157
actual filename.
158158

159-
.. versionchanged:: 3.3
160159
The ``'a'`` (append) mode was added, along with support for reading
161160
multi-stream files.
162161

Doc/library/collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``.
343343
All of those tests treat missing elements as having zero counts so that
344344
``Counter(a=1) == Counter(a=1, b=0)`` returns true.
345345

346-
.. versionadded:: 3.10
346+
.. versionchanged:: 3.10
347347
Rich comparison operations were added.
348348

349349
.. versionchanged:: 3.10

Doc/library/faulthandler.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ Dumping the tracebacks after a timeout
118118

119119
This function is implemented using a watchdog thread.
120120

121-
.. versionchanged:: 3.7
122-
This function is now always available.
123-
124121
.. versionchanged:: 3.5
125122
Added support for passing file descriptor to this function.
126123

124+
.. versionchanged:: 3.7
125+
This function is now always available.
126+
127127
.. function:: cancel_dump_traceback_later()
128128

129129
Cancel the last call to :func:`dump_traceback_later`.

Doc/library/functools.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,9 @@ The :mod:`functools` module defines the following functions:
665665
on the wrapper function). :exc:`AttributeError` is still raised if the
666666
wrapper function itself is missing any attributes named in *updated*.
667667

668-
.. versionadded:: 3.2
669-
Automatic addition of the ``__wrapped__`` attribute.
670-
671-
.. versionadded:: 3.2
672-
Copying of the ``__annotations__`` attribute by default.
673-
674668
.. versionchanged:: 3.2
669+
The ``__wrapped__`` attribute is now automatically added.
670+
The ``__annotations__`` attribute is now copied by default.
675671
Missing attributes no longer trigger an :exc:`AttributeError`.
676672

677673
.. versionchanged:: 3.4

Doc/library/hashlib.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ accessible by name via :func:`new`. See :data:`algorithms_available`.
7777
SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`,
7878
:func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256`
7979
were added.
80-
81-
.. versionadded:: 3.6
8280
:func:`blake2b` and :func:`blake2s` were added.
8381

8482
.. _hashlib-usedforsecurity:

Doc/library/importlib.metadata.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ all the metadata in a JSON-compatible form per :PEP:`566`::
217217
The ``Description`` is now included in the metadata when presented
218218
through the payload. Line continuation characters have been removed.
219219

220-
.. versionadded:: 3.10
221220
The ``json`` attribute was added.
222221

223222

Doc/library/os.rst

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,6 @@ features:
25442544
.. versionchanged:: 3.8
25452545
Accepts a :term:`path-like object` and a bytes object on Windows.
25462546

2547-
.. versionchanged:: 3.8
25482547
Added support for directory junctions, and changed to return the
25492548
substitution path (which typically includes ``\\?\`` prefix) rather
25502549
than the optional "print name" field that was previously returned.
@@ -3045,21 +3044,21 @@ features:
30453044

30463045
Time of most recent access expressed in nanoseconds as an integer.
30473046

3048-
.. versionadded: 3.3
3047+
.. versionadded:: 3.3
30493048

30503049
.. attribute:: st_mtime_ns
30513050

30523051
Time of most recent content modification expressed in nanoseconds as an
30533052
integer.
30543053

3055-
.. versionadded: 3.3
3054+
.. versionadded:: 3.3
30563055

30573056
.. attribute:: st_ctime_ns
30583057

30593058
Time of most recent metadata change expressed in nanoseconds as an
30603059
integer.
30613060

3062-
.. versionadded: 3.3
3061+
.. versionadded:: 3.3
30633062

30643063
.. versionchanged:: 3.12
30653064
``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns``
@@ -3187,10 +3186,10 @@ features:
31873186
Windows now returns the file index as :attr:`st_ino` when
31883187
available.
31893188

3190-
.. versionadded:: 3.7
3189+
.. versionchanged:: 3.7
31913190
Added the :attr:`st_fstype` member to Solaris/derivatives.
31923191

3193-
.. versionadded:: 3.8
3192+
.. versionchanged:: 3.8
31943193
Added the :attr:`st_reparse_tag` member on Windows.
31953194

31963195
.. versionchanged:: 3.8
@@ -3204,16 +3203,13 @@ features:
32043203
platforms, but for now still contains creation time.
32053204
Use :attr:`st_birthtime` for the creation time.
32063205

3207-
.. versionchanged:: 3.12
32083206
On Windows, :attr:`st_ino` may now be up to 128 bits, depending
32093207
on the file system. Previously it would not be above 64 bits, and
32103208
larger file identifiers would be arbitrarily packed.
32113209

3212-
.. versionchanged:: 3.12
32133210
On Windows, :attr:`st_rdev` no longer returns a value. Previously
32143211
it would contain the same as :attr:`st_dev`, which was incorrect.
32153212

3216-
.. versionadded:: 3.12
32173213
Added the :attr:`st_birthtime` member on Windows.
32183214

32193215

@@ -4215,15 +4211,15 @@ written in Python, such as a mail server's external command delivery program.
42154211
On macOS the use of this function is unsafe when mixed with using
42164212
higher-level system APIs, and that includes using :mod:`urllib.request`.
42174213

4214+
.. versionchanged:: 3.8
4215+
Calling ``forkpty()`` in a subinterpreter is no longer supported
4216+
(:exc:`RuntimeError` is raised).
4217+
42184218
.. versionchanged:: 3.12
42194219
If Python is able to detect that your process has multiple
42204220
threads, this now raises a :exc:`DeprecationWarning`. See the
42214221
longer explanation on :func:`os.fork`.
42224222

4223-
.. versionchanged:: 3.8
4224-
Calling ``forkpty()`` in a subinterpreter is no longer supported
4225-
(:exc:`RuntimeError` is raised).
4226-
42274223
.. availability:: Unix, not Emscripten, not WASI.
42284224

42294225

@@ -5390,20 +5386,20 @@ Random numbers
53905386
easy-to-use interface to the random number generator provided by your
53915387
platform, please see :class:`random.SystemRandom`.
53925388

5393-
.. versionchanged:: 3.6.0
5394-
On Linux, ``getrandom()`` is now used in blocking mode to increase the
5395-
security.
5396-
5397-
.. versionchanged:: 3.5.2
5398-
On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool
5399-
is not initialized yet), fall back on reading ``/dev/urandom``.
5400-
54015389
.. versionchanged:: 3.5
54025390
On Linux 3.17 and newer, the ``getrandom()`` syscall is now used
54035391
when available. On OpenBSD 5.6 and newer, the C ``getentropy()``
54045392
function is now used. These functions avoid the usage of an internal file
54055393
descriptor.
54065394

5395+
.. versionchanged:: 3.5.2
5396+
On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool
5397+
is not initialized yet), fall back on reading ``/dev/urandom``.
5398+
5399+
.. versionchanged:: 3.6
5400+
On Linux, ``getrandom()`` is now used in blocking mode to increase the
5401+
security.
5402+
54075403
.. versionchanged:: 3.11
54085404
On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()``
54095405
which is deprecated.

Doc/library/pdb.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,15 @@ typed at the debugger prompt. This is particularly useful for aliases. If both
288288
files exist, the one in the home directory is read first and aliases defined there
289289
can be overridden by the local file.
290290

291-
.. versionchanged:: 3.11
292-
:file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was read
293-
with the system locale encoding.
294-
295291
.. versionchanged:: 3.2
296292
:file:`.pdbrc` can now contain commands that continue debugging, such as
297293
:pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no
298294
effect.
299295

296+
.. versionchanged:: 3.11
297+
:file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was read
298+
with the system locale encoding.
299+
300300

301301
.. pdbcommand:: h(elp) [command]
302302

Doc/library/stdtypes.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,8 +1491,7 @@ objects that compare equal might have different :attr:`~range.start`,
14911491
sequence of values they define (instead of comparing based on
14921492
object identity).
14931493

1494-
.. versionadded:: 3.3
1495-
The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step`
1494+
Added the :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step`
14961495
attributes.
14971496

14981497
.. seealso::

Doc/library/threading.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,12 @@ since it is impossible to detect the termination of alien threads.
360360
base class constructor (``Thread.__init__()``) before doing anything else to
361361
the thread.
362362

363+
.. versionchanged:: 3.3
364+
Added the *daemon* parameter.
365+
363366
.. versionchanged:: 3.10
364367
Use the *target* name if *name* argument is omitted.
365368

366-
.. versionchanged:: 3.3
367-
Added the *daemon* argument.
368-
369369
.. method:: start()
370370

371371
Start the thread's activity.

Doc/library/time.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,14 @@ Functions
381381
* Or use ``nanosleep()`` if available (resolution: 1 nanosecond);
382382
* Or use ``select()`` (resolution: 1 microsecond).
383383

384-
.. versionchanged:: 3.11
385-
On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now
386-
used if available. On Windows, a waitable timer is now used.
387-
388384
.. versionchanged:: 3.5
389385
The function now sleeps at least *secs* even if the sleep is interrupted
390386
by a signal, except if the signal handler raises an exception (see
391387
:pep:`475` for the rationale).
392388

389+
.. versionchanged:: 3.11
390+
On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now
391+
used if available. On Windows, a waitable timer is now used.
393392

394393
.. index::
395394
single: % (percent); datetime format

Doc/library/turtle.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ Turtle motion
598598
>>> turtle.pos()
599599
(20.00,30.00)
600600

601-
.. versionadded: 3.12
601+
.. versionadded:: 3.12
602602

603603

604604
.. function:: setx(x)

Doc/library/urllib.request.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,9 @@ The :mod:`urllib.request` module defines the following functions:
105105
.. versionchanged:: 3.2
106106
*cafile* and *capath* were added.
107107

108-
.. versionchanged:: 3.2
109108
HTTPS virtual hosts are now supported if possible (that is, if
110109
:const:`ssl.HAS_SNI` is true).
111110

112-
.. versionadded:: 3.2
113111
*data* can be an iterable object.
114112

115113
.. versionchanged:: 3.3

Doc/reference/lexical_analysis.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,6 @@ is not supported.
514514
The ``'rb'`` prefix of raw bytes literals has been added as a synonym
515515
of ``'br'``.
516516

517-
.. versionadded:: 3.3
518517
Support for the unicode legacy literal (``u'value'``) was reintroduced
519518
to simplify the maintenance of dual Python 2.x and 3.x codebases.
520519
See :pep:`414` for more information.

Doc/reference/simple_stmts.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,7 @@ and information about handling exceptions is in section :ref:`try`.
664664
.. versionchanged:: 3.3
665665
:const:`None` is now permitted as ``Y`` in ``raise X from Y``.
666666

667-
.. versionadded:: 3.3
668-
The :attr:`~BaseException.__suppress_context__` attribute to suppress
667+
Added the :attr:`~BaseException.__suppress_context__` attribute to suppress
669668
automatic display of the exception context.
670669

671670
.. versionchanged:: 3.11

0 commit comments

Comments
 (0)