Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unnecesary .flush() calls in the asyncio subprocess code example #65684

Closed
4kir4 mannequin opened this issue May 12, 2014 · 3 comments
Closed

remove unnecesary .flush() calls in the asyncio subprocess code example #65684

4kir4 mannequin opened this issue May 12, 2014 · 3 comments
Labels
docs Documentation in the Doc dir

Comments

@4kir4
Copy link
Mannequin

4kir4 mannequin commented May 12, 2014

BPO 21485
Nosy @gvanrossum, @pitrou, @vstinner, @giampaolo, @4kir4, @1st1
Files
  • docs-subprocess-remove-unnecessary-flush-from-code-example.patch: remove unnecessary flush() calls
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-05-12.21:26:08.559>
    created_at = <Date 2014-05-12.17:59:23.456>
    labels = ['docs']
    title = 'remove unnecesary .flush() calls in the asyncio subprocess code example'
    updated_at = <Date 2014-05-12.21:26:08.558>
    user = 'https://github.com/4kir4'

    bugs.python.org fields:

    activity = <Date 2014-05-12.21:26:08.558>
    actor = 'vstinner'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2014-05-12.21:26:08.559>
    closer = 'vstinner'
    components = ['Documentation']
    creation = <Date 2014-05-12.17:59:23.456>
    creator = 'akira'
    dependencies = []
    files = ['35230']
    hgrepos = []
    issue_num = 21485
    keywords = ['patch']
    message_count = 3.0
    messages = ['218342', '218366', '218367']
    nosy_count = 8.0
    nosy_names = ['gvanrossum', 'pitrou', 'vstinner', 'giampaolo.rodola', 'docs@python', 'akira', 'python-dev', 'yselivanov']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue21485'
    versions = ['Python 3.4', 'Python 3.5']

    @4kir4
    Copy link
    Mannequin Author

    4kir4 mannequin commented May 12, 2014

    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

    @4kir4 4kir4 mannequin assigned docspython May 12, 2014
    @4kir4 4kir4 mannequin added the docs Documentation in the Doc dir label May 12, 2014
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 12, 2014

    New changeset c0404f0da01a by Victor Stinner in branch '3.4':
    Issue bpo-21485: remove unnecesary .flush() calls in the asyncio subprocess code
    http://hg.python.org/cpython/rev/c0404f0da01a

    New changeset 3c26389d741c by Victor Stinner in branch 'default':
    (Merge 3.4) Issue bpo-21485: remove unnecesary .flush() calls in the asyncio
    http://hg.python.org/cpython/rev/3c26389d741c

    @vstinner
    Copy link
    Member

    I wrote the example and the first call to buffer.flush() is a mistake. Thanks for your patch, I applied it.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant