@@ -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
0 commit comments