@@ -1263,7 +1263,9 @@ Working with pipes
12631263 *protocol_factory * must be a callable returning an
12641264 :ref: `asyncio protocol <asyncio-protocol >` implementation.
12651265
1266- *pipe * is a :term: `file-like object <file object> `.
1266+ *pipe * is a :term: `file-like object <file object> `. See
1267+ :ref: `Supported pipe objects <asyncio-pipe-objects >` for the objects
1268+ supported as *pipe *.
12671269
12681270 Return pair ``(transport, protocol) ``, where *transport * supports
12691271 the :class: `ReadTransport ` interface and *protocol * is an object
@@ -1280,7 +1282,9 @@ Working with pipes
12801282 *protocol_factory * must be a callable returning an
12811283 :ref: `asyncio protocol <asyncio-protocol >` implementation.
12821284
1283- *pipe * is :term: `file-like object <file object> `.
1285+ *pipe * is a :term: `file-like object <file object> `. See
1286+ :ref: `Supported pipe objects <asyncio-pipe-objects >` for the objects
1287+ supported as *pipe *.
12841288
12851289 Return pair ``(transport, protocol) ``, where *transport * supports
12861290 :class: `WriteTransport ` interface and *protocol * is an object
@@ -1289,6 +1293,33 @@ Working with pipes
12891293 With :class: `SelectorEventLoop ` event loop, the *pipe * is set to
12901294 non-blocking mode.
12911295
1296+ .. _asyncio-pipe-objects :
1297+
1298+ .. rubric :: Supported pipe objects
1299+
1300+ These methods only work with objects the operating system can poll for
1301+ readiness or perform overlapped I/O on. Regular files on disk are **not **
1302+ supported on any platform. There is no asynchronous file I/O in asyncio;
1303+ use :meth: `loop.run_in_executor ` to read and write regular files without
1304+ blocking the event loop.
1305+
1306+ On Unix, with :class: `SelectorEventLoop `, *pipe * must wrap one of the
1307+ following:
1308+
1309+ * a pipe, such as an end of an :func: `os.pipe ` pair or a FIFO created with
1310+ :func: `os.mkfifo `;
1311+ * a socket;
1312+ * a character device, such as a terminal.
1313+
1314+ On Windows, where only :class: `ProactorEventLoop ` implements these methods,
1315+ *pipe * must wrap a handle opened for overlapped I/O (that is, created with the
1316+ ``FILE_FLAG_OVERLAPPED `` flag), since the handle has to be associated with an
1317+ I/O completion port. Handles that were not opened for overlapped I/O are
1318+ rejected. In particular, the standard streams (:data: `sys.stdin `,
1319+ :data: `sys.stdout ` and :data: `sys.stderr `), console handles, and the pipes
1320+ created by :func: `os.pipe ` are **not ** opened for overlapped I/O and therefore
1321+ cannot be used with these methods.
1322+
12921323.. note ::
12931324
12941325 :class: `SelectorEventLoop ` does not support the above methods on
0 commit comments