add 'output.stdout', '.stdin', and '.stderr' options

(#1621, #2152, #2529)

Allow setting custom input/output encodings and options
without having to rely on Python's defaults.
This commit is contained in:
Mike Fährmann
2023-02-26 14:56:19 +01:00
parent a70a3e5da6
commit e480a93337
3 changed files with 62 additions and 11 deletions

View File

@@ -3808,6 +3808,42 @@ Description
* ``{3}`` is percent of bytes downloaded to total bytes
output.stdout & .stdin & .stderr
--------------------------------
Type
* ``string``
* ``object``
Example
.. code:: json
"utf-8"
.. code:: json
{
"encoding": "utf-8",
"errors": "replace",
"line_buffering": true
}
Description
`Reconfigure <https://docs.python.org/3/library/io.html#io.TextIOWrapper.reconfigure>`__
a `standard stream <https://docs.python.org/3/library/sys.html#sys.stdin>`__.
Possible options are
* ``encoding``
* ``errors``
* ``newline``
* ``line_buffering``
* ``write_through``
When this option is specified as a simple ``string``,
it is interpreted as ``{"encoding": "<string-value>", "errors": "replace"}``
Note: ``errors`` always defaults to ``"replace"``
output.shorten
--------------
Type