Skip to content

Commit da8bdb8

Browse files
Merge branch 'main' into gh-127154
2 parents 65b8c46 + 307c633 commit da8bdb8

22 files changed

+108
-123
lines changed

Doc/c-api/init.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,7 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
24702470
24712471
{
24722472
PyCriticalSection2 _py_cs2;
2473-
PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))
2473+
PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))
24742474
24752475
In the default build, this macro expands to ``{``.
24762476
@@ -2482,7 +2482,7 @@ code triggered by the finalizer blocks and calls :c:func:`PyEval_SaveThread`.
24822482
24832483
In the free-threaded build, this macro expands to::
24842484
2485-
PyCriticalSection_End2(&_py_cs2);
2485+
PyCriticalSection2_End(&_py_cs2);
24862486
}
24872487
24882488
In the default build, this macro expands to ``}``.

Doc/library/argparse.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,11 +1926,10 @@ Argument groups
19261926
Note that any arguments not in your user-defined groups will end up back
19271927
in the usual "positional arguments" and "optional arguments" sections.
19281928

1929-
.. versionchanged:: 3.11
1930-
Calling :meth:`add_argument_group` on an argument group is deprecated.
1931-
This feature was never supported and does not always work correctly.
1932-
The function exists on the API by accident through inheritance and
1933-
will be removed in the future.
1929+
.. deprecated-removed:: 3.11 3.14
1930+
Calling :meth:`add_argument_group` on an argument group now raises an
1931+
exception. This nesting was never supported, often failed to work
1932+
correctly, and was unintentionally exposed through inheritance.
19341933

19351934
.. deprecated:: 3.14
19361935
Passing prefix_chars_ to :meth:`add_argument_group`
@@ -1993,11 +1992,11 @@ Mutual exclusion
19931992
--foo FOO foo help
19941993
--bar BAR bar help
19951994

1996-
.. versionchanged:: 3.11
1997-
Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group`
1998-
on a mutually exclusive group is deprecated. These features were never
1999-
supported and do not always work correctly. The functions exist on the
2000-
API by accident through inheritance and will be removed in the future.
1995+
.. deprecated-removed:: 3.11 3.14
1996+
Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group`
1997+
on a mutually exclusive group now raises an exception. This nesting was
1998+
never supported, often failed to work correctly, and was unintentionally
1999+
exposed through inheritance.
20012000

20022001

20032002
Parser defaults

Doc/library/urllib.request.rst

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,15 @@ The :mod:`urllib.request` module defines the following functions:
148148

149149
.. function:: pathname2url(path)
150150

151-
Convert the pathname *path* from the local syntax for a path to the form used in
152-
the path component of a URL. This does not produce a complete URL. The return
153-
value will already be quoted using the :func:`~urllib.parse.quote` function.
151+
Convert the given local path to a ``file:`` URL. This function uses
152+
:func:`~urllib.parse.quote` function to encode the path. For historical
153+
reasons, the return value omits the ``file:`` scheme prefix. This example
154+
shows the function being used on Windows::
155+
156+
>>> from urllib.request import pathname2url
157+
>>> path = 'C:\\Program Files'
158+
>>> 'file:' + pathname2url(path)
159+
'file:///C:/Program%20Files'
154160

155161
.. versionchanged:: 3.14
156162
Windows drive letters are no longer converted to uppercase.
@@ -161,11 +167,17 @@ The :mod:`urllib.request` module defines the following functions:
161167
found in any position other than the second character.
162168

163169

164-
.. function:: url2pathname(path)
170+
.. function:: url2pathname(url)
171+
172+
Convert the given ``file:`` URL to a local path. This function uses
173+
:func:`~urllib.parse.unquote` to decode the URL. For historical reasons,
174+
the given value *must* omit the ``file:`` scheme prefix. This example shows
175+
the function being used on Windows::
165176

166-
Convert the path component *path* from a percent-encoded URL to the local syntax for a
167-
path. This does not accept a complete URL. This function uses
168-
:func:`~urllib.parse.unquote` to decode *path*.
177+
>>> from urllib.request import url2pathname
178+
>>> url = 'file:///C:/Program%20Files'
179+
>>> url2pathname(url.removeprefix('file:'))
180+
'C:\\Program Files'
169181

170182
.. versionchanged:: 3.14
171183
Windows drive letters are no longer converted to uppercase.

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ Replaced opcodes
16701670
| | | for each direction |
16711671
| | | |
16721672
+------------------------------------+------------------------------------+-----------------------------------------+
1673-
| | :opcode:`!SETUP_WITH` | :opcode:`BEFORE_WITH` | :keyword:`with` block setup |
1673+
| | :opcode:`!SETUP_WITH` | :opcode:`!BEFORE_WITH` | :keyword:`with` block setup |
16741674
| | :opcode:`!SETUP_ASYNC_WITH` | | |
16751675
+------------------------------------+------------------------------------+-----------------------------------------+
16761676

Doc/whatsnew/3.14.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,14 @@ argparse
641641
of :class:`!argparse.BooleanOptionalAction`.
642642
They were deprecated since 3.12.
643643

644+
* Calling :meth:`~argparse.ArgumentParser.add_argument_group` on an argument
645+
group, and calling :meth:`~argparse.ArgumentParser.add_argument_group` or
646+
:meth:`~argparse.ArgumentParser.add_mutually_exclusive_group` on a mutually
647+
exclusive group now raise exceptions. This nesting was never supported,
648+
often failed to work correctly, and was unintentionally exposed through
649+
inheritance. This functionality has been deprecated since Python 3.11.
650+
(Contributed by Savannah Ostrowski in :gh:`127186`.)
651+
644652
ast
645653
---
646654

Doc/whatsnew/3.4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ Other Improvements
19791979
now works correctly (previously it silently returned the first python
19801980
module in the file). (Contributed by Václav Šmilauer in :issue:`16421`.)
19811981

1982-
* A new opcode, :opcode:`LOAD_CLASSDEREF`, has been added to fix a bug in the
1982+
* A new opcode, :opcode:`!LOAD_CLASSDEREF`, has been added to fix a bug in the
19831983
loading of free variables in class bodies that could be triggered by certain
19841984
uses of :ref:`__prepare__ <prepare>`. (Contributed by Benjamin Peterson in
19851985
:issue:`17853`.)

Doc/whatsnew/3.6.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,27 +2366,27 @@ There have been several major changes to the :term:`bytecode` in Python 3.6.
23662366
(Contributed by Demur Rumed with input and reviews from
23672367
Serhiy Storchaka and Victor Stinner in :issue:`26647` and :issue:`28050`.)
23682368

2369-
* The new :opcode:`FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part
2369+
* The new :opcode:`!FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part
23702370
of the :ref:`formatted string literal <whatsnew36-pep498>` implementation.
23712371
(Contributed by Eric Smith in :issue:`25483` and
23722372
Serhiy Storchaka in :issue:`27078`.)
23732373

2374-
* The new :opcode:`BUILD_CONST_KEY_MAP` opcode to optimize the creation
2374+
* The new :opcode:`!BUILD_CONST_KEY_MAP` opcode to optimize the creation
23752375
of dictionaries with constant keys.
23762376
(Contributed by Serhiy Storchaka in :issue:`27140`.)
23772377

23782378
* The function call opcodes have been heavily reworked for better performance
23792379
and simpler implementation.
2380-
The :opcode:`MAKE_FUNCTION`, :opcode:`CALL_FUNCTION`,
2381-
:opcode:`CALL_FUNCTION_KW` and :opcode:`BUILD_MAP_UNPACK_WITH_CALL` opcodes
2380+
The :opcode:`MAKE_FUNCTION`, :opcode:`!CALL_FUNCTION`,
2381+
:opcode:`!CALL_FUNCTION_KW` and :opcode:`!BUILD_MAP_UNPACK_WITH_CALL` opcodes
23822382
have been modified, the new :opcode:`CALL_FUNCTION_EX` and
2383-
:opcode:`BUILD_TUPLE_UNPACK_WITH_CALL` have been added, and
2383+
:opcode:`!BUILD_TUPLE_UNPACK_WITH_CALL` have been added, and
23842384
``CALL_FUNCTION_VAR``, ``CALL_FUNCTION_VAR_KW`` and ``MAKE_CLOSURE`` opcodes
23852385
have been removed.
23862386
(Contributed by Demur Rumed in :issue:`27095`, and Serhiy Storchaka in
23872387
:issue:`27213`, :issue:`28257`.)
23882388

2389-
* The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`STORE_ANNOTATION` opcodes
2389+
* The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`!STORE_ANNOTATION` opcodes
23902390
have been added to support the new :term:`variable annotation` syntax.
23912391
(Contributed by Ivan Levkivskyi in :issue:`27985`.)
23922392

Doc/whatsnew/3.7.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,10 +2476,10 @@ avoiding possible problems use new functions :c:func:`PySlice_Unpack` and
24762476
CPython bytecode changes
24772477
------------------------
24782478

2479-
There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`CALL_METHOD`.
2479+
There are two new opcodes: :opcode:`LOAD_METHOD` and :opcode:`!CALL_METHOD`.
24802480
(Contributed by Yury Selivanov and INADA Naoki in :issue:`26110`.)
24812481

2482-
The :opcode:`STORE_ANNOTATION` opcode has been removed.
2482+
The :opcode:`!STORE_ANNOTATION` opcode has been removed.
24832483
(Contributed by Mark Shannon in :issue:`32550`.)
24842484

24852485

Doc/whatsnew/3.8.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,11 +2152,11 @@ CPython bytecode changes
21522152
cleaning-up code for :keyword:`break`, :keyword:`continue` and
21532153
:keyword:`return`.
21542154

2155-
Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`,
2156-
:opcode:`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes
2157-
:opcode:`ROT_FOUR`, :opcode:`BEGIN_FINALLY`, :opcode:`CALL_FINALLY` and
2158-
:opcode:`POP_FINALLY`. Changed the behavior of :opcode:`END_FINALLY`
2159-
and :opcode:`WITH_CLEANUP_START`.
2155+
Removed opcodes :opcode:`!BREAK_LOOP`, :opcode:`!CONTINUE_LOOP`,
2156+
:opcode:`!SETUP_LOOP` and :opcode:`!SETUP_EXCEPT`. Added new opcodes
2157+
:opcode:`!ROT_FOUR`, :opcode:`!BEGIN_FINALLY`, :opcode:`!CALL_FINALLY` and
2158+
:opcode:`!POP_FINALLY`. Changed the behavior of :opcode:`!END_FINALLY`
2159+
and :opcode:`!WITH_CLEANUP_START`.
21602160

21612161
(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in
21622162
:issue:`17611`.)

Doc/whatsnew/3.9.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ Changes in the C API
12031203
CPython bytecode changes
12041204
------------------------
12051205

1206-
* The :opcode:`LOAD_ASSERTION_ERROR` opcode was added for handling the
1206+
* The :opcode:`!LOAD_ASSERTION_ERROR` opcode was added for handling the
12071207
:keyword:`assert` statement. Previously, the assert statement would not work
12081208
correctly if the :exc:`AssertionError` exception was being shadowed.
12091209
(Contributed by Zackery Spytz in :issue:`34880`.)

0 commit comments

Comments
 (0)