diff --git a/Doc/library/io.rst b/Doc/library/io.rst --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -754,7 +754,8 @@ It inherits :class:`TextIOBase`. *encoding* gives the name of the encoding that the stream will be decoded or - encoded with. It defaults to ``locale.getpreferredencoding(False)``. + encoded with. It defaults to + :func:`locale.getpreferredencoding(False) `. *errors* is an optional string that specifies how encoding and decoding errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -238,10 +238,12 @@ process should be captured into the same file handle as for *stdout*. When *stdout* or *stderr* are pipes and *universal_newlines* is - :const:`True` then the output data is assumed to be encoded as UTF-8 and - will automatically be decoded to text. All line endings will be converted - to ``'\n'`` as described for the universal newlines ``'U'`` mode argument - to :func:`open`. + ``True``, the output data will be decoded to text automatically + using the encoding returned by + :func:`locale.getpreferredencoding(False) `. + All line endings will be converted to the system default using + universal newlines mode as described for the :class:`io.TextIOWrapper` + class when the *newline* argument to its constructor is ``None``. If *shell* is :const:`True`, the specified command will be executed through the shell. This can be useful if you are using Python primarily for the