Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49398b8

Browse filesBrowse files
slatenygpshead
authored andcommitted
gh-47937: Note that Popen attributes are read-only (GH-93070)
* Note that Popen attributes aren't meant to be set by users by rewording the text about the attributes. * Also update some universal_newlines references to mention the modern text parameter name while in the area. (cherry picked from commit 027adf4) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
1 parent 25196d6 commit 49398b8
Copy full SHA for 49398b8

File tree

Expand file treeCollapse file tree

1 file changed

+12
-11
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-11
lines changed

‎Doc/library/subprocess.rst

Copy file name to clipboardExpand all lines: Doc/library/subprocess.rst
+12-11Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ functions.
456456
- :const:`0` means unbuffered (read and write are one
457457
system call and can return short)
458458
- :const:`1` means line buffered
459-
(only usable if ``universal_newlines=True`` i.e., in a text mode)
459+
(only usable if ``text=True`` or ``universal_newlines=True``)
460460
- any other positive value means use a buffer of approximately that
461461
size
462462
- negative bufsize (the default) means the system default of
@@ -841,7 +841,8 @@ Instances of the :class:`Popen` class have the following methods:
841841
On Windows :meth:`kill` is an alias for :meth:`terminate`.
842842

843843

844-
The following attributes are also available:
844+
The following attributes are also set by the class for you to access.
845+
Reassigning them to new values is unsupported:
845846

846847
.. attribute:: Popen.args
847848

@@ -854,29 +855,29 @@ The following attributes are also available:
854855

855856
If the *stdin* argument was :data:`PIPE`, this attribute is a writeable
856857
stream object as returned by :func:`open`. If the *encoding* or *errors*
857-
arguments were specified or the *universal_newlines* argument was ``True``,
858-
the stream is a text stream, otherwise it is a byte stream. If the *stdin*
859-
argument was not :data:`PIPE`, this attribute is ``None``.
858+
arguments were specified or the *text* or *universal_newlines* argument
859+
was ``True``, the stream is a text stream, otherwise it is a byte stream.
860+
If the *stdin* argument was not :data:`PIPE`, this attribute is ``None``.
860861

861862

862863
.. attribute:: Popen.stdout
863864

864865
If the *stdout* argument was :data:`PIPE`, this attribute is a readable
865866
stream object as returned by :func:`open`. Reading from the stream provides
866867
output from the child process. If the *encoding* or *errors* arguments were
867-
specified or the *universal_newlines* argument was ``True``, the stream is a
868-
text stream, otherwise it is a byte stream. If the *stdout* argument was not
869-
:data:`PIPE`, this attribute is ``None``.
868+
specified or the *text* or *universal_newlines* argument was ``True``, the
869+
stream is a text stream, otherwise it is a byte stream. If the *stdout*
870+
argument was not :data:`PIPE`, this attribute is ``None``.
870871

871872

872873
.. attribute:: Popen.stderr
873874

874875
If the *stderr* argument was :data:`PIPE`, this attribute is a readable
875876
stream object as returned by :func:`open`. Reading from the stream provides
876877
error output from the child process. If the *encoding* or *errors* arguments
877-
were specified or the *universal_newlines* argument was ``True``, the stream
878-
is a text stream, otherwise it is a byte stream. If the *stderr* argument was
879-
not :data:`PIPE`, this attribute is ``None``.
878+
were specified or the *text* or *universal_newlines* argument was ``True``, the
879+
stream is a text stream, otherwise it is a byte stream. If the *stderr* argument
880+
was not :data:`PIPE`, this attribute is ``None``.
880881

881882
.. warning::
882883

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.