Skip to content

Commit 5df1d7d

Browse files
committed
gh-56229: Document flush expectation for stdout and stderr replacements
1 parent 8e88bb5 commit 5df1d7d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/library/sys.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,6 +2180,10 @@ always available. Unless explicitly noted otherwise, all variables are read-only
21802180
may be replaced with file-like objects like :class:`io.StringIO` which
21812181
do not support the :attr:`!buffer` attribute.
21822182

2183+
At interpreter shutdown, the ``stdout`` and ``stderr`` streams are
2184+
flushed, so objects used to replace them should provide a ``flush()``
2185+
method.
2186+
21832187

21842188
.. data:: __stdin__
21852189
__stdout__

0 commit comments

Comments
 (0)