Skip to content

Commit 50fb576

Browse files
Deploy preview for PR 1231 🛫
1 parent 7f6805f commit 50fb576

587 files changed

Lines changed: 675 additions & 590 deletions

File tree

Some content is hidden

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

pr-preview/pr-1231/_sources/library/asyncio-eventloop.rst.txt

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,9 @@ Working with pipes
12741274
*protocol_factory* must be a callable returning an
12751275
:ref:`asyncio protocol <asyncio-protocol>` implementation.
12761276

1277-
*pipe* is a :term:`file-like object <file object>`.
1277+
*pipe* is a :term:`file-like object <file object>`. See
1278+
:ref:`Supported pipe objects <asyncio-pipe-objects>` for the objects
1279+
supported as *pipe*.
12781280

12791281
Return pair ``(transport, protocol)``, where *transport* supports
12801282
the :class:`ReadTransport` interface and *protocol* is an object
@@ -1291,7 +1293,9 @@ Working with pipes
12911293
*protocol_factory* must be a callable returning an
12921294
:ref:`asyncio protocol <asyncio-protocol>` implementation.
12931295

1294-
*pipe* is :term:`file-like object <file object>`.
1296+
*pipe* is a :term:`file-like object <file object>`. See
1297+
:ref:`Supported pipe objects <asyncio-pipe-objects>` for the objects
1298+
supported as *pipe*.
12951299

12961300
Return pair ``(transport, protocol)``, where *transport* supports
12971301
:class:`WriteTransport` interface and *protocol* is an object
@@ -1300,6 +1304,33 @@ Working with pipes
13001304
With :class:`SelectorEventLoop` event loop, the *pipe* is set to
13011305
non-blocking mode.
13021306

1307+
.. _asyncio-pipe-objects:
1308+
1309+
.. rubric:: Supported pipe objects
1310+
1311+
These methods only work with objects the operating system can poll for
1312+
readiness or perform overlapped I/O on. Regular files on disk are **not**
1313+
supported on any platform. There is no asynchronous file I/O in asyncio;
1314+
use :meth:`loop.run_in_executor` to read and write regular files without
1315+
blocking the event loop.
1316+
1317+
On Unix, with :class:`SelectorEventLoop`, *pipe* must wrap one of the
1318+
following:
1319+
1320+
* a pipe, such as an end of an :func:`os.pipe` pair or a FIFO created with
1321+
:func:`os.mkfifo`;
1322+
* a socket;
1323+
* a character device, such as a terminal.
1324+
1325+
On Windows, where only :class:`ProactorEventLoop` implements these methods,
1326+
*pipe* must wrap a handle opened for overlapped I/O (that is, created with the
1327+
``FILE_FLAG_OVERLAPPED`` flag), since the handle has to be associated with an
1328+
I/O completion port. Handles that were not opened for overlapped I/O are
1329+
rejected. In particular, the standard streams (:data:`sys.stdin`,
1330+
:data:`sys.stdout` and :data:`sys.stderr`), console handles, and the pipes
1331+
created by :func:`os.pipe` are **not** opened for overlapped I/O and therefore
1332+
cannot be used with these methods.
1333+
13031334
.. note::
13041335

13051336
:class:`SelectorEventLoop` does not support the above methods on

pr-preview/pr-1231/_sources/library/asyncio-platforms.rst.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ All Platforms
1919
* :meth:`loop.add_reader` and :meth:`loop.add_writer`
2020
cannot be used to monitor file I/O.
2121

22+
* :meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe`
23+
cannot be used with regular files. See :ref:`Supported pipe objects
24+
<asyncio-pipe-objects>` for the objects that are accepted on each
25+
platform.
26+
2227

2328
Windows
2429
=======
@@ -62,6 +67,10 @@ All event loops on Windows do not support the following methods:
6267
* The :meth:`loop.add_reader` and :meth:`loop.add_writer`
6368
methods are not supported.
6469

70+
* :meth:`loop.connect_read_pipe` and :meth:`loop.connect_write_pipe` only
71+
accept a handle opened for overlapped I/O.
72+
See :ref:`Supported pipe objects <asyncio-pipe-objects>` for which objects are supported.
73+
6574
The resolution of the monotonic clock on Windows is usually around 15.6
6675
milliseconds. The best resolution is 0.5 milliseconds. The resolution depends on the
6776
hardware (availability of `HPET

pr-preview/pr-1231/_sources/using/windows.rst.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ omitted in cases where the tag refers to an official release and starts with
164164
$> py -V:3-arm64 ...
165165
166166
Runtimes from other distributors may require the *company* to be included as
167-
well. This should be separated from the tag by a slash, and may be a prefix.
167+
well.
168+
It should be separated from the tag by a slash (either ``/`` or ``\``),
169+
and may be shortened to any prefix of its full value.
168170
Specifying the company is optional when it is ``PythonCore``, and specifying the
169171
tag is optional (but not the slash) when you want the latest release from a
170172
specific company.

pr-preview/pr-1231/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ <h3>導航</h3>
356356
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
357357
<br>
358358
<br>
359-
最後更新於 7月 14, 2026 (00:32 UTC)。
359+
最後更新於 7月 15, 2026 (00:30 UTC)。
360360

361361
<a href="/bugs.html">發現 bug</a>
362362

pr-preview/pr-1231/bugs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ <h3>導航</h3>
393393
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
394394
<br>
395395
<br>
396-
最後更新於 7月 14, 2026 (00:32 UTC)。
396+
最後更新於 7月 15, 2026 (00:30 UTC)。
397397

398398
<a href="/bugs.html">發現 bug</a>
399399

pr-preview/pr-1231/c-api/abstract.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ <h3>導航</h3>
365365
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
366366
<br>
367367
<br>
368-
最後更新於 7月 14, 2026 (00:32 UTC)。
368+
最後更新於 7月 15, 2026 (00:30 UTC)。
369369

370370
<a href="/bugs.html">發現 bug</a>
371371

pr-preview/pr-1231/c-api/allocation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ <h3>導航</h3>
577577
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
578578
<br>
579579
<br>
580-
最後更新於 7月 14, 2026 (00:32 UTC)。
580+
最後更新於 7月 15, 2026 (00:30 UTC)。
581581

582582
<a href="/bugs.html">發現 bug</a>
583583

pr-preview/pr-1231/c-api/apiabiversion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ <h3>導航</h3>
514514
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
515515
<br>
516516
<br>
517-
最後更新於 7月 14, 2026 (00:32 UTC)。
517+
最後更新於 7月 15, 2026 (00:30 UTC)。
518518

519519
<a href="/bugs.html">發現 bug</a>
520520

pr-preview/pr-1231/c-api/arg.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ <h3>導航</h3>
996996
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
997997
<br>
998998
<br>
999-
最後更新於 7月 14, 2026 (00:32 UTC)。
999+
最後更新於 7月 15, 2026 (00:30 UTC)。
10001000

10011001
<a href="/bugs.html">發現 bug</a>
10021002

pr-preview/pr-1231/c-api/bool.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ <h3>導航</h3>
376376
<a href="https://www.python.org/psf/donations/">敬請捐贈。</a>
377377
<br>
378378
<br>
379-
最後更新於 7月 14, 2026 (00:32 UTC)。
379+
最後更新於 7月 15, 2026 (00:30 UTC)。
380380

381381
<a href="/bugs.html">發現 bug</a>
382382

0 commit comments

Comments
 (0)