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

asyncio.subprocess's communicate(None) does not close stdin #83925

Closed
marmarek mannequin opened this issue Feb 24, 2020 · 2 comments
Closed

asyncio.subprocess's communicate(None) does not close stdin #83925

marmarek mannequin opened this issue Feb 24, 2020 · 2 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-asyncio

Comments

@marmarek
Copy link
Mannequin

marmarek mannequin commented Feb 24, 2020

BPO 39744
Nosy @asvetlov, @1st1, @marmarek
PRs
  • gh-83925: make asyncio.subprocess communicate similar to non-asyncio #18650
  • Files
  • commmunicate-test.py: Test script
  • 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 = None
    created_at = <Date 2020-02-24.22:09:41.104>
    labels = ['3.7', '3.8', '3.9', 'expert-asyncio']
    title = "asyncio.subprocess's communicate(None) does not close stdin"
    updated_at = <Date 2020-02-24.22:35:32.276>
    user = 'https://github.com/marmarek'

    bugs.python.org fields:

    activity = <Date 2020-02-24.22:35:32.276>
    actor = 'marmarek'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['asyncio']
    creation = <Date 2020-02-24.22:09:41.104>
    creator = 'marmarek'
    dependencies = []
    files = ['48910']
    hgrepos = []
    issue_num = 39744
    keywords = ['patch']
    message_count = 2.0
    messages = ['362605', '362606']
    nosy_count = 3.0
    nosy_names = ['asvetlov', 'yselivanov', 'marmarek']
    pr_nums = ['18650']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue39744'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @marmarek
    Copy link
    Mannequin Author

    marmarek mannequin commented Feb 24, 2020

    Standard subprocess's communicate() called with None input (or no argument at all closes process stdin. The asyncio variant does not.
    This leads to issue with various processes that wait for EOF on stdin before terminating.

    Test script attached.

    @marmarek marmarek mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-asyncio labels Feb 24, 2020
    @marmarek
    Copy link
    Mannequin Author

    marmarek mannequin commented Feb 24, 2020

    This is BTW similar to https://bugs.python.org/issue26848

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    gvanrossum pushed a commit that referenced this issue Apr 28, 2023
    …18650)
    
    subprocess's communicate(None) closes stdin of the child process, after
    sending no (extra) data. Make asyncio variant do the same.
    This fixes issues with processes that waits for EOF on stdin before
    continuing.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-asyncio
    Projects
    Status: Done
    Development

    No branches or pull requests

    1 participant