Skip to content

Commit 40fb443

Browse files
authored
Merge branch 'main' into wasi-refactor
2 parents 565ca7d + dc12d19 commit 40fb443

Some content is hidden

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

58 files changed

+2299
-1185
lines changed

.github/CODEOWNERS

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -260,33 +260,33 @@ Include/pyhash.h @gpshead @picnixz
260260
Python/pyhash.c @gpshead @picnixz
261261

262262
# The import system (including importlib)
263-
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
264-
Python/import.c @brettcannon @ericsnowcurrently @ncoghlan @warsaw @kumaraditya303
263+
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw @FFY00
264+
Python/import.c @brettcannon @ericsnowcurrently @ncoghlan @warsaw @FFY00 @kumaraditya303
265265
**/*freeze* @ericsnowcurrently
266266
**/*frozen* @ericsnowcurrently
267267
**/*modsupport* @ericsnowcurrently
268-
**/*modulefinder* @ericsnowcurrently
268+
**/*modulefinder* @ericsnowcurrently @FFY00
269269
**/*moduleobject* @ericsnowcurrently
270270
**/*multiphase* @ericsnowcurrently
271-
**/*pkgutil* @ericsnowcurrently
271+
**/*pkgutil* @ericsnowcurrently @FFY00
272272
**/*pythonrun* @ericsnowcurrently
273-
**/*runpy* @ericsnowcurrently
273+
**/*runpy* @ericsnowcurrently @FFY00
274274
**/*singlephase* @ericsnowcurrently
275275
Doc/c-api/module.rst @ericsnowcurrently
276276
Lib/test/test_module/ @ericsnowcurrently
277-
Python/dynload_*.c @ericsnowcurrently
277+
Python/dynload_*.c @ericsnowcurrently @FFY00
278278

279279
# Initialisation
280-
**/*initconfig* @ericsnowcurrently
281-
**/*pathconfig* @ericsnowcurrently
282-
**/*preconfig* @ericsnowcurrently
280+
**/*initconfig* @ericsnowcurrently @FFY00
281+
**/*pathconfig* @ericsnowcurrently @FFY00
282+
**/*preconfig* @ericsnowcurrently @FFY00
283283
Doc/library/sys_path_init.rst @FFY00
284284
Doc/c-api/init_config.rst @FFY00
285285

286286
# Interpreter main program
287-
Modules/main.c @ericsnowcurrently
288-
Programs/_bootstrap_python.c @ericsnowcurrently
289-
Programs/python.c @ericsnowcurrently
287+
Modules/main.c @ericsnowcurrently @FFY00
288+
Programs/_bootstrap_python.c @ericsnowcurrently @FFY00
289+
Programs/python.c @ericsnowcurrently @FFY00
290290

291291
# JIT
292292
.github/workflows/jit.yml @savannahostrowski
@@ -316,8 +316,8 @@ Tools/peg_generator/ @pablogsal @lysnikolaou
316316

317317
# Runtime state/lifecycle
318318
**/*gil* @ericsnowcurrently
319-
**/*pylifecycle* @ericsnowcurrently @ZeroIntensity
320-
**/*pystate* @ericsnowcurrently @ZeroIntensity
319+
**/*pylifecycle* @ericsnowcurrently @ZeroIntensity @FFY00
320+
**/*pystate* @ericsnowcurrently @ZeroIntensity @FFY00
321321
Include/internal/pycore_*_init.h @ericsnowcurrently
322322
Include/internal/pycore_*_state.h @ericsnowcurrently
323323
Include/internal/pycore_atexit.h @ericsnowcurrently
@@ -505,13 +505,13 @@ Lib/idlelib/ @terryjreedy
505505
Lib/turtledemo/ @terryjreedy
506506

507507
# importlib.metadata
508-
Doc/library/importlib.metadata.rst @jaraco @warsaw
509-
Lib/importlib/metadata/ @jaraco @warsaw
510-
Lib/test/test_importlib/metadata/ @jaraco @warsaw
508+
Doc/library/importlib.metadata.rst @jaraco @warsaw @FFY00
509+
Lib/importlib/metadata/ @jaraco @warsaw @FFY00
510+
Lib/test/test_importlib/metadata/ @jaraco @warsaw @FFY00
511511

512512
# importlib.resources
513-
Doc/library/importlib.resources.abc.rst @jaraco @warsaw
514-
Doc/library/importlib.resources.rst @jaraco @warsaw
513+
Doc/library/importlib.resources.abc.rst @jaraco @warsaw @FFY00
514+
Doc/library/importlib.resources.rst @jaraco @warsaw @FFY00
515515
Lib/importlib/resources/ @jaraco @warsaw @FFY00
516516
Lib/test/test_importlib/resources/ @jaraco @warsaw @FFY00
517517

Doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ build:
5858
@if [ -f ../Misc/NEWS ] ; then \
5959
echo "Using existing Misc/NEWS file"; \
6060
cp ../Misc/NEWS build/NEWS; \
61-
elif $(BLURB) help >/dev/null 2>&1 && $(SPHINXBUILD) --version >/dev/null 2>&1; then \
61+
elif $(BLURB) --version && $(SPHINXBUILD) --version ; then \
6262
if [ -d ../Misc/NEWS.d ]; then \
6363
echo "Building NEWS from Misc/NEWS.d with blurb"; \
6464
$(BLURB) merge -f build/NEWS; \

Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343

4444
# Skip if downstream redistributors haven't installed them
4545
_OPTIONAL_EXTENSIONS = (
46+
'linklint.ext',
4647
'notfound.extension',
4748
'sphinxext.opengraph',
4849
)

Doc/library/argparse.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,9 @@ By default, :mod:`!argparse` automatically handles the internal naming and
739739
display names of arguments, simplifying the process without requiring
740740
additional configuration.
741741
As such, you do not need to specify the dest_ and metavar_ parameters.
742-
The dest_ parameter defaults to the argument name with underscores ``_``
743-
replacing hyphens ``-`` . The metavar_ parameter defaults to the
744-
upper-cased name. For example::
742+
For optional arguments, the dest_ parameter defaults to the argument name, with
743+
underscores ``_`` replacing hyphens ``-``. The metavar_ parameter defaults to
744+
the upper-cased name. For example::
745745

746746
>>> parser = argparse.ArgumentParser(prog='PROG')
747747
>>> parser.add_argument('--foo-bar')

Doc/library/contextlib.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Functions and classes provided:
2121
.. class:: AbstractContextManager
2222

2323
An :term:`abstract base class` for classes that implement
24-
:meth:`object.__enter__` and :meth:`object.__exit__`. A default
25-
implementation for :meth:`object.__enter__` is provided which returns
26-
``self`` while :meth:`object.__exit__` is an abstract method which by default
24+
:meth:`~object.__enter__` and :meth:`~object.__exit__`. A default
25+
implementation for :meth:`~object.__enter__` is provided which returns
26+
``self`` while :meth:`~object.__exit__` is an abstract method which by default
2727
returns ``None``. See also the definition of :ref:`typecontextmanager`.
2828

2929
.. versionadded:: 3.6
@@ -32,9 +32,9 @@ Functions and classes provided:
3232
.. class:: AbstractAsyncContextManager
3333

3434
An :term:`abstract base class` for classes that implement
35-
:meth:`object.__aenter__` and :meth:`object.__aexit__`. A default
36-
implementation for :meth:`object.__aenter__` is provided which returns
37-
``self`` while :meth:`object.__aexit__` is an abstract method which by default
35+
:meth:`~object.__aenter__` and :meth:`~object.__aexit__`. A default
36+
implementation for :meth:`~object.__aenter__` is provided which returns
37+
``self`` while :meth:`~object.__aexit__` is an abstract method which by default
3838
returns ``None``. See also the definition of
3939
:ref:`async-context-managers`.
4040

@@ -228,7 +228,7 @@ Functions and classes provided:
228228

229229
.. function:: nullcontext(enter_result=None)
230230

231-
Return a context manager that returns *enter_result* from ``__enter__``, but
231+
Return a context manager that returns *enter_result* from :meth:`~object.__enter__`, but
232232
otherwise does nothing. It is intended to be used as a stand-in for an
233233
optional context manager, for example::
234234

@@ -335,7 +335,7 @@ Functions and classes provided:
335335
For example, the output of :func:`help` normally is sent to *sys.stdout*.
336336
You can capture that output in a string by redirecting the output to an
337337
:class:`io.StringIO` object. The replacement stream is returned from the
338-
``__enter__`` method and so is available as the target of the
338+
:meth:`~object.__enter__` method and so is available as the target of the
339339
:keyword:`with` statement::
340340

341341
with redirect_stdout(io.StringIO()) as f:
@@ -396,7 +396,8 @@ Functions and classes provided:
396396
A base class that enables a context manager to also be used as a decorator.
397397

398398
Context managers inheriting from ``ContextDecorator`` have to implement
399-
``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional
399+
:meth:`~object.__enter__` and :meth:`~object.__exit__` as normal.
400+
``__exit__`` retains its optional
400401
exception handling even when used as a decorator.
401402

402403
``ContextDecorator`` is used by :func:`contextmanager`, so you get this
@@ -710,9 +711,9 @@ context management protocol.
710711
Catching exceptions from ``__enter__`` methods
711712
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
712713

713-
It is occasionally desirable to catch exceptions from an ``__enter__``
714+
It is occasionally desirable to catch exceptions from an :meth:`~object.__enter__`
714715
method implementation, *without* inadvertently catching exceptions from
715-
the :keyword:`with` statement body or the context manager's ``__exit__``
716+
the :keyword:`with` statement body or the context manager's :meth:`~object.__exit__`
716717
method. By using :class:`ExitStack` the steps in the context management
717718
protocol can be separated slightly in order to allow this::
718719

Doc/library/os.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,6 +2409,10 @@ features:
24092409
.. versionchanged:: 3.6
24102410
Accepts a :term:`path-like object`.
24112411

2412+
.. versionchanged:: next
2413+
``os.listdir(-1)`` now fails with ``OSError(errno.EBADF)`` rather than
2414+
listing the current directory.
2415+
24122416

24132417
.. function:: listdrives()
24142418

@@ -2939,6 +2943,10 @@ features:
29392943
.. versionchanged:: 3.7
29402944
Added support for :ref:`file descriptors <path_fd>` on Unix.
29412945

2946+
.. versionchanged:: next
2947+
``os.scandir(-1)`` now fails with ``OSError(errno.EBADF)`` rather than
2948+
listing the current directory.
2949+
29422950

29432951
.. class:: DirEntry
29442952

@@ -4574,6 +4582,10 @@ These functions are all available on Linux only.
45744582
.. versionchanged:: 3.6
45754583
Accepts a :term:`path-like object`.
45764584

4585+
.. versionchanged:: next
4586+
``os.listxattr(-1)`` now fails with ``OSError(errno.EBADF)`` rather than
4587+
listing extended attributes of the current directory.
4588+
45774589

45784590
.. function:: removexattr(path, attribute, *, follow_symlinks=True)
45794591

Doc/library/stdtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4536,7 +4536,7 @@ copying.
45364536
types such as :class:`bytes` and :class:`bytearray`, an element is a single
45374537
byte, but other types such as :class:`array.array` may have bigger elements.
45384538

4539-
``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which
4539+
``len(view)`` is equal to the length of :meth:`~memoryview.tolist`, which
45404540
is the nested list representation of the view. If ``view.ndim = 1``,
45414541
this is equal to the number of elements in the view.
45424542

Doc/library/wave.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,21 @@ Wave_write Objects
181181
Set the number of channels.
182182

183183

184+
.. method:: getnchannels()
185+
186+
Return the number of channels.
187+
188+
184189
.. method:: setsampwidth(n)
185190

186191
Set the sample width to *n* bytes.
187192

188193

194+
.. method:: getsampwidth()
195+
196+
Return the sample width in bytes.
197+
198+
189199
.. method:: setframerate(n)
190200

191201
Set the frame rate to *n*.
@@ -195,26 +205,53 @@ Wave_write Objects
195205
integer.
196206

197207

208+
.. method:: getframerate()
209+
210+
Return the frame rate.
211+
212+
198213
.. method:: setnframes(n)
199214

200215
Set the number of frames to *n*. This will be changed later if the number
201216
of frames actually written is different (this update attempt will
202217
raise an error if the output stream is not seekable).
203218

204219

220+
.. method:: getnframes()
221+
222+
Return the number of audio frames written so far.
223+
224+
205225
.. method:: setcomptype(type, name)
206226

207227
Set the compression type and description. At the moment, only compression type
208228
``NONE`` is supported, meaning no compression.
209229

210230

231+
.. method:: getcomptype()
232+
233+
Return the compression type (``'NONE'``).
234+
235+
236+
.. method:: getcompname()
237+
238+
Return the human-readable compression type name.
239+
240+
211241
.. method:: setparams(tuple)
212242

213243
The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, comptype,
214244
compname)``, with values valid for the ``set*()`` methods. Sets all
215245
parameters.
216246

217247

248+
.. method:: getparams()
249+
250+
Return a :func:`~collections.namedtuple`
251+
``(nchannels, sampwidth, framerate, nframes, comptype, compname)``
252+
containing the current output parameters.
253+
254+
218255
.. method:: tell()
219256

220257
Return current position in the file, with the same disclaimer for the

Doc/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ sphinx-notfound-page~=1.0.0
1818
# to install that as well.
1919
python-docs-theme>=2023.3.1,!=2023.7
2020

21+
linklint
22+
2123
-c constraints.txt

Doc/using/cmdline.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,13 @@ Miscellaneous options
687687

688688
.. versionadded:: 3.14
689689

690+
* :samp:`-X pathconfig_warnings={0,1}` if true (``1``) then
691+
:ref:`sys-path-init` is allowed to log warnings into stderr.
692+
If false (``0``) suppress these warnings. Set to true by default.
693+
See also :envvar:`PYTHON_PATHCONFIG_WARNINGS`.
694+
695+
.. versionadded:: next
696+
690697
* :samp:`-X tlbc={0,1}` enables (1, the default) or disables (0) thread-local
691698
bytecode in builds configured with :option:`--disable-gil`. When disabled,
692699
this also disables the specializing interpreter. See also
@@ -1354,6 +1361,14 @@ conflict.
13541361

13551362
.. versionadded:: 3.14
13561363

1364+
.. envvar:: PYTHON_PATHCONFIG_WARNINGS
1365+
1366+
If true (``1``) then :ref:`sys-path-init` is allowed to log warnings into
1367+
stderr. If false (``0``) suppress these warnings. Set to true by default.
1368+
See also :option:`-X pathconfig_warnings<-X>`.
1369+
1370+
.. versionadded:: next
1371+
13571372
.. envvar:: PYTHON_JIT
13581373

13591374
On builds where experimental just-in-time compilation is available, this

0 commit comments

Comments
 (0)