diff --git a/Doc/library/io.rst b/Doc/library/io.rst --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -744,7 +744,8 @@ It inherits :class:`TextIOBase`. *encoding* gives the name of the encoding that the stream will be decoded or - encoded with. It defaults to :func:`locale.getpreferredencoding`. + encoded with. It defaults to + :func:`locale.getpreferredencoding() `. *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 @@ -205,12 +205,14 @@ 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() `. + All line endings will be converted to ``'\n'`` 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 + If *shell* is ``True``, the specified command will be executed through the shell. This can be useful if you are using Python primarily for the enhanced control flow it offers over most system shells and still want access to other shell features such as filename wildcards, shell pipes and