8000 Merge branch 'main' into disallow-thread-creation-and-fork-at-interp-… · python/cpython@ec66e17 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec66e17

Browse files
authored
Merge branch 'main' into disallow-thread-creation-and-fork-at-interp-exit
2 parents 0926f6f + 95f1b1f commit ec66e17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+642
-877
lines changed

Doc/library/ast.rst

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ Expressions
481481
Comparison operator tokens.
482482

483483

484-
.. class:: Call(func, args, keywords, starargs, kwargs)
484+
.. class:: Call(func, args, keywords)
485485

486486
A function call. ``func`` is the function, which will often be a
487487
:class:`Name` or :class:`Attribute` object. Of the arguments:
@@ -491,7 +491,7 @@ Expressions
491491
arguments passed by keyword.
492492

493493
When creating a ``Call`` node, ``args`` and ``keywords`` are required, but
494-
they can be empty lists. ``starargs`` and ``kwargs`` are optional.
494+
they can be empty lists.
495495

496496
.. doctest::
497497

@@ -1724,7 +1724,6 @@ Function and class definitions
17241724
body=[
17251725
FunctionDef(
17261726
name='f',
1727-
type_params=[],
17281727
args=arguments(
17291728
posonlyargs=[],
17301729
args=[
@@ -1749,7 +1748,8 @@ Function and class definitions
17491748
decorator_list=[
17501749
Name(id='decorator1', ctx=Load()),
17511750
Name(id='decorator2', ctx=Load())],
1752-
returns=Constant(value='return annotation'))],
1751+
returns=Constant(value='return annotation'),
1752+
type_params=[])],
17531753
type_ignores=[])
17541754

17551755

@@ -1820,7 +1820,7 @@ Function and class definitions
18201820
type_ignores=[])
18211821

18221822

1823-
.. class:: ClassDef(name, bases, keywords, starargs, kwargs, body, decorator_list)
1823+
.. class:: ClassDef(name, bases, keywords, body, decorator_list)
18241824

18251825
A class definition.
18261826

@@ -1829,9 +1829,6 @@ Function and class definitions
18291829
* ``keywords`` is a list of :class:`keyword` nodes, principally for 'metaclass'.
18301830
Other keywords will be passed to the metaclass, as per `PEP-3115
18311831
<https://peps.python.org/pep-3115/>`_.
1832-
* ``starargs`` and ``kwargs`` are each a single node, as in a function call.
1833-
starargs will be expanded to join the list of base classes, and kwargs will
1834-
be passed to the metaclass.
18351832
* ``body`` is a list of nodes representing the code within the class
18361833
definition.
18371834
* ``decorator_list`` is a list of nodes, as in :class:`FunctionDef`.
@@ -1848,7 +1845,6 @@ Function and class definitions
18481845
body=[
18491846
ClassDef(
18501847
name='Foo',
1851-
type_params=[],
18521848
bases=[
18531849
Name(id='base1', ctx=Load()),
18541850
Name(id='base2', ctx=Load())],
@@ -1860,7 +1856,8 @@ Function and class definitions
18601856
Pass()],
18611857
decorator_list=[
18621858
Name(id='decorator1', ctx=Load()),
1863-
Name(id='decorator2', ctx=Load())])],
1859+
Name(id='decorator2', ctx=Load())],
1860+
type_params=[])],
18641861
type_ignores=[])
18651862

18661863
Async and await
@@ -1887,7 +1884,6 @@ Async and await
18871884
body=[
18881885
AsyncFunctionDef(
18891886
name='f',
1890-
type_params=[],
18911887
args=arguments(
18921888
posonlyargs=[],
18931889
args=[],
@@ -1901,7 +1897,8 @@ Async and await
19011897
func=Name(id='other_func', ctx=Load()),
19021898
args=[],
19031899
keywords=[])))],
1904-
decorator_list=[])],
1900+
decorator_list=[],
1901+
type_params=[])],
19051902
type_ignores=[])
19061903

19071904

Doc/library/imghdr.rst

Lines changed: 0 additions & 86 deletions
This file was deleted.

Doc/library/superseded.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ backwards compatibility. They have been superseded by other modules.
1010

1111
.. toctree::
1212

13-
imghdr.rst
1413
optparse.rst

Doc/library/webbrowser.rst

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ will be used if graphical browsers are not available or an X11 display isn't
2020
available. If text-mode browsers are used, the calling process will block until
2121
the user exits the browser.
2222

23-
If the environment variable :envvar:`BROWSER` exists, it is interpreted as the
23+
If the environment variable :envvar:`!BROWSER` exists, it is interpreted as the
2424
:data:`os.pathsep`-separated list of browsers to try ahead of the platform
2525
defaults. When the value of a list part contains the string ``%s``, then it is
2626
interpreted as a literal browser command line to be used with the argument URL
@@ -97,7 +97,7 @@ The following functions are defined:
9797

9898
Setting *preferred* to ``True`` makes this browser a preferred result for
9999
a :func:`get` call with no argument. Otherwise, this entry point is only
100-
useful if you plan to either set the :envvar:`BROWSER` variable or call
100+
useful if you plan to either set the :envvar:`!BROWSER` variable or call
101101
:func:`get` with a nonempty argument matching the name of a handler you
102102
declare.
103103

@@ -111,49 +111,49 @@ for the controller classes, all defined in this module.
111111
+------------------------+-----------------------------------------+-------+
112112
| Type Name | Class Name | Notes |
113113
+========================+=========================================+=======+
114-
| ``'mozilla'`` | :class:`Mozilla('mozilla')` | |
114+
| ``'mozilla'`` | ``Mozilla('mozilla')`` | |
115115
+------------------------+-----------------------------------------+-------+
116-
| ``'firefox'`` | :class:`Mozilla('mozilla')` | |
116+
| ``'firefox'`` | ``Mozilla('mozilla')`` | |
117117
+------------------------+-----------------------------------------+-------+
118-
| ``'epiphany'`` | :class:`Epiphany('epiphany')` | |
118+
| ``'epiphany'`` | ``Epiphany('epiphany')`` | |
119119
+------------------------+-----------------------------------------+-------+
120-
| ``'kfmclient'`` | :class:`Konqueror()` | \(1) |
120+
| ``'kfmclient'`` | ``Konqueror()`` | \(1) |
121121
+------------------------+-----------------------------------------+-------+
122-
| ``'konqueror'`` | :class:`Konqueror()` | \(1) |
122+
| ``'konqueror'`` | ``Konqueror()`` | \(1) |
123123
+------------------------+-----------------------------------------+-------+
124-
| ``'kfm'`` | :class:`Konqueror()` | \(1) |
124+
| ``'kfm'`` | ``Konqueror()`` | \(1) |
125125
+------------------------+-----------------------------------------+-------+
126-
| ``'opera'`` | :class:`Opera()` | |
126+
| ``'opera'`` | ``Opera()`` | |
127127
+------------------------+-----------------------------------------+-------+
128-
| ``'links'`` | :class:`GenericBrowser('links')` | |
128+
| ``'links'`` | ``GenericBrowser('links')`` | |
129129
+------------------------+-----------------------------------------+-------+
130-
| ``'elinks'`` | :class:`Elinks('elinks')` | |
130+
| ``'elinks'`` | ``Elinks('elinks')`` | |
131131
+------------------------+-----------------------------------------+-------+
132-
| ``'lynx'`` | :class:`GenericBrowser('lynx')` | |
132+
| ``'lynx'`` | ``GenericBrowser('lynx')`` | |
133133
+------------------------+-----------------------------------------+-------+
134-
| ``'w3m'`` | :class:`GenericBrowser('w3m')` | |
134+
| ``'w3m'`` | ``GenericBrowser('w3m')`` | |
135135
+------------------------+-----------------------------------------+-------+
136-
| ``'windows-default'`` | :class:`WindowsDefault` | \(2) |
136+
| ``'windows-default'`` | ``WindowsDefault`` | \(2) |
137137
+------------------------+-----------------------------------------+-------+
138-
| ``'macosx'`` | :class:`MacOSXOSAScript('default')` | \(3) |
138+
| ``'macosx'`` | ``MacOSXOSAScript('default')`` | \(3) |
139139
+------------------------+-----------------------------------------+-------+
140-
| ``'safari'`` | :class:`MacOSXOSAScript('safari')` | \(3) |
140+
| ``'safari'`` | ``MacOSXOSAScript('safari')`` | \(3) |
141141
+------------------------+-----------------------------------------+-------+
142-
| ``'google-chrome'`` | :class:`Chrome('google-chrome')` | |
142+
| ``'google-chrome'`` | ``Chrome('google-chrome')`` | |
143143
+------------------------+-----------------------------------------+-------+
144-
| ``'chrome'`` | :class:`Chrome('chrome')` | |
144+
| ``'chrome'`` | ``Chrome('chrome')`` | |
145145
+------------------------+-----------------------------------------+-------+
146-
| ``'chromium'`` | :class:`Chromium('chromium')` | |
146+
| ``'chromium'`` | ``Chromium('chromium')`` | |
147147
+------------------------+-----------------------------------------+-------+
148-
| ``'chromium-browser'`` | :class:`Chromium('chromium-browser')` | |
148+
| ``'chromium-browser'`` | ``Chromium('chromium-browser')`` | |
149149
+------------------------+-----------------------------------------+-------+
150150

151151
Notes:
152152

153153
(1)
154154
"Konqueror" is the file manager for the KDE desktop environment for Unix, and
155155
only makes sense to use if KDE is running. Some way of reliably detecting KDE
156-
would be nice; the :envvar:`KDEDIR` variable is not sufficient. Note also that
156+
would be nice; the :envvar:`!KDEDIR` variable is not sufficient. Note also that
157157
the name "kfm" is used even when using the :program:`konqueror` command with KDE
158158
2 --- the implementation selects the best strategy for running Konqueror.
159159

@@ -163,6 +163,11 @@ Notes:
163163
(3)
164164
Only on macOS platform.
165165

166+
.. versionadded:: 3.2
167+
A new :class:`!MacOSXOSAScript` class has been added
168+
and is used on Mac instead of the previous :class:`!MacOSX` class.
169+
This adds support for opening browsers not currently set as the OS default.
170+
166171
.. versionadded:: 3.3
167172
Support for Chrome/Chromium has been added.
168173

@@ -171,9 +176,6 @@ Notes:
171176
Removed browsers include Grail, Mosaic, Netscape, Galeon,
172177
Skipstone, Iceape, and Firefox versions 35 and below.
173178

174-
.. deprecated-removed:: 3.11 3.13
175-
:class:`MacOSX` is deprecated, use :class:`MacOSXOSAScript` instead.
176-
177179
Here are some simple examples::
178180

179181
url = 'https://docs.python.org/'
@@ -222,4 +224,4 @@ module-level convenience functions:
222224
.. rubric:: Footnotes
223225

224226
.. [1] Executables named here without a full path will be searched in the
225-
directories given in the :envvar:`PATH` environment variable.
227+
directories given in the :envvar:`!PATH` environment variable.

Doc/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# Sphinx version is pinned so that new versions that introduce new warnings
77
# won't suddenly cause build failures. Updating the version is fine as long
88
# as no warnings are raised by doing so.
9-
sphinx==4.5.0
9+
# PR #104777: Sphinx 6.2 no longer uses imghdr, removed in Python 3.13.
10+
sphinx==6.2.0
1011

1112
blurb
1213

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ Doc/library/urllib.request.rst
229229
Doc/library/uuid.rst
230230
Doc/library/wave.rst
231231
Doc/library/weakref.rst
232-
Doc/library/webbrowser.rst
233232
Doc/library/winreg.rst
234233
Doc/library/winsound.rst
235234
Doc/library/wsgiref.rst

Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ Modules
17351735
+---------------------+---------------------+---------------------+---------------------+---------------------+
17361736
| :mod:`!audioop` | :mod:`!crypt` | :mod:`!nis` | :mod:`!sndhdr` | :mod:`!uu` |
17371737
+---------------------+---------------------+---------------------+---------------------+---------------------+
1738-
| :mod:`!cgi` | :mod:`imghdr` | :mod:`!nntplib` | :mod:`!spwd` | :mod:`!xdrlib` |
1738+
| :mod:`!cgi` | :mod:`!imghdr` | :mod:`!nntplib` | :mod:`!spwd` | :mod:`!xdrlib` |
17391739
+---------------------+---------------------+---------------------+---------------------+---------------------+
17401740
| :mod:`!cgitb` | :mod:`!mailcap` | :mod:`!ossaudiodev` | :mod:`!sunau` | |
17411741
+---------------------+---------------------+---------------------+---------------------+---------------------+

Doc/whatsnew/3.12.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ Modules (see :pep:`594`):
924924
* :mod:`!cgitb`
925925
* :mod:`!chunk`
926926
* :mod:`!crypt`
927-
* :mod:`imghdr`
927+
* :mod:`!imghdr`
928928
* :mod:`!mailcap`
929929
* :mod:`!msilib`
930930
* :mod:`!nis`

Doc/whatsnew/3.13.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ Removed
115115
are now removed. The items in those namespaces can be imported directly
116116
from :mod:`typing`. (Contributed by Sebastian Rittau in :gh:`92871`.)
117117

118+
* Remove the untested and undocumented :mod:`webbrowser` :class:`!MacOSX` class,
119+
deprecated in Python 3.11.
120+
Use the :class:`!MacOSXOSAScript` class (introduced in Python 3.2) instead.
121+
(Contributed by Hugo van Kemenade in :gh:`104804`.)
122+
118123
* Remove support for using :class:`pathlib.Path` objects as context managers.
119124
This functionality was deprecated and made a no-op in Python 3.9.
120125

@@ -244,6 +249,14 @@ Removed
244249
:class:`typing.TypedDict` types, deprecated in Python 3.11.
245250
(Contributed by Tomas Roun in :gh:`104786`.)
246251

252+
* :pep:`594`: Remove the :mod:`!imghdr` module, deprecated in Python 3.11:
253+
use the projects
254+
`filetype <https://pypi.org/project/filetype/>`_,
255+
`puremagic <https://pypi.org/project/puremagic/>`_,
256+
or `python-magic <https://pypi.org/project/python-magic/>`_ instead.
257+
(Contributed by Victor Stinner in :gh:`104773`.)
258+
259+
247260
Porting to Python 3.13
248261
======================
249262

Doc/whatsnew/3.5.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ Oberkirch in :issue:`21800`.)
12521252
imghdr
12531253
------
12541254

1255-
The :func:`~imghdr.what` function now recognizes the
1255+
The :func:`~!imghdr.what` function now recognizes the
12561256
`OpenEXR <https://www.openexr.com>`_ format
12571257
(contributed by Martin Vignali and Claudiu Popa in :issue:`20295`),
12581258
and the `WebP <https://en.wikipedia.org/wiki/WebP>`_ format

0 commit comments

Comments
 (0)
0