[issue21485] remove unnecesary .flush() calls in the asyncio subprocess code example

akira report at bugs.python.org
Mon May 12 19:59:23 CEST 2014


New submission from akira:

The current code example contains [1]:

    print("Python failed with exit code %s:" % exitcode)
    sys.stdout.flush()
    sys.stdout.buffer.flush()
    sys.stdout.buffer.write(stdout)
    sys.stdout.buffer.flush()

that looks bizarre.

Either a comment should be added that explains why the `.flush()` calls
are necessary or they should be removed.

I've attached the documentation patch that removes the calls.

[1] http://hg.python.org/cpython/file/2af5a52b9b87/Doc/library/asyncio-subprocess.rst#l227

----------
assignee: docs at python
components: Documentation
files: docs-subprocess-remove-unnecessary-flush-from-code-example.patch
keywords: patch
messages: 218342
nosy: akira, docs at python
priority: normal
severity: normal
status: open
title: remove unnecesary .flush() calls in the asyncio subprocess code example
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35230/docs-subprocess-remove-unnecessary-flush-from-code-example.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21485>
_______________________________________


More information about the Python-bugs-list mailing list