diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -705,22 +705,30 @@ .. attribute:: Popen.stdin - If the *stdin* argument was :data:`PIPE`, this attribute is a :term:`file - object` that provides input to the child process. Otherwise, it is ``None``. - + If the *stdin* argument was :data:`PIPE`, this attribute is a + writeable stream object as returned by :meth:`io.open`. If the + *universal_newlines* argument was True, the stream is a character + stream, otherwise it is a byte stream. If the *stdin* argument was + not :data:`PIPE`, this attribute is ``None``. .. attribute:: Popen.stdout - If the *stdout* argument was :data:`PIPE`, this attribute is a :term:`file - object` that provides output from the child process. Otherwise, it is ``None``. - + If the *stdout* argument was :data:`PIPE`, this attribute is a + readable stream object as returned by :meth:`io.open`. Reading from + the stream provides output from the child process. If the + *universal_newlines* argument was True, the stream is a character + stream, otherwise it is a byte stream. If the *stdout* argument was + not :data:`PIPE`, this attribute is ``None``. + .. attribute:: Popen.stderr - If the *stderr* argument was :data:`PIPE`, this attribute is a :term:`file - object` that provides error output from the child process. Otherwise, it is - ``None``. - + If the *stderr* argument was :data:`PIPE`, this attribute is a + readable stream object as returned by :meth:`io.open`. Reading from + the stream provides output from the child process. If the + *universal_newlines* argument was True, the stream is a character + stream, otherwise it is a byte stream. If the *stderr* argument was + not :data:`PIPE`, this attribute is ``None``. .. attribute:: Popen.pid diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -220,6 +220,9 @@ - Issue #19286: Directories in ``package_data`` are no longer added to the filelist, preventing failure outlined in the ticket. +- Issue #17814: Improve documentation of stream objects that are + created by subprocess.Popen. Patch by Nikolaus Rath. + IDLE ----