Skip to content

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

Closed

Description

@4kir4
mannequin
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']

    Activity

    1. 4kir4 commented on May 12, 2014

      4kir4mannequin
      MannequinAuthor

      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

    2. added
      docs
      on May 12, 2014
    3. python-dev commented on May 12, 2014

      python-devmannequin
      Mannequin

      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

    4. vstinner commented on May 12, 2014

      @vstinner
      Member

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

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      docs

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions