Skip to content

Documentation of asyncio.loop.subprocess_exec() mentions connect_write_pipe() in an incorrect context #91441

Closed
@tifv

Description

@tifv

In the documentation of asyncio.loop.subprocess_exec(), in the description of each of stdin, stdout, stderr arguments, there is an item (correspondingly):

     * a file-like object representing a pipe to be connected to the
       subprocess's standard [input/output/error] stream using
       :meth:`~loop.connect_write_pipe`

As far as I understand, only the stdin should be handled by connect_write_pipe(), and the other two are to be handled by connect_read_pipe(). This looks like a copy-paste error.

Also, the wording is misleading, in my opinion. It says that pipe is to be connected to the subprocess’s stdin using connect_write_pipe(). But this in fact conflates two different actions: one side of the pipe is connected to the process’s stdin (and this is done by asyncio+subprocess), while the other should be handled with connect_write_pipe() (and this you should do yourself it you want to make it accessible with asyncio).

Also, it says that a file-like object has to represent a pipe, but in fact I still can use a regular file object. So, some conditional wording should be used, in my opinion.

In fact, I would not even put this kind of clarification in the list… maybe a paragraph after the list of options? I don't know if removing it altogether would be ok.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions