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

py3k: child process don't inherit stdout / stderr on Windows #53026

Closed
vstinner opened this issue May 21, 2010 · 8 comments
Closed

py3k: child process don't inherit stdout / stderr on Windows #53026

vstinner opened this issue May 21, 2010 · 8 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-windows stdlib Python modules in the Lib dir

Comments

@vstinner
Copy link
Member

BPO 8780
Nosy @gpshead, @pitrou, @vstinner, @briancurtin
Files
  • subprocess_windows.patch
  • 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 = 'https://github.com/vstinner'
    closed_at = <Date 2010-05-21.20:40:56.201>
    created_at = <Date 2010-05-21.12:37:55.531>
    labels = ['interpreter-core', 'library', 'OS-windows']
    title = "py3k: child process don't inherit stdout / stderr on Windows"
    updated_at = <Date 2010-05-21.20:40:56.199>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2010-05-21.20:40:56.199>
    actor = 'vstinner'
    assignee = 'vstinner'
    closed = True
    closed_date = <Date 2010-05-21.20:40:56.201>
    closer = 'vstinner'
    components = ['Interpreter Core', 'Library (Lib)', 'Windows']
    creation = <Date 2010-05-21.12:37:55.531>
    creator = 'vstinner'
    dependencies = []
    files = ['17430']
    hgrepos = []
    issue_num = 8780
    keywords = ['patch']
    message_count = 8.0
    messages = ['106232', '106233', '106234', '106237', '106238', '106244', '106246', '106263']
    nosy_count = 4.0
    nosy_names = ['gregory.p.smith', 'pitrou', 'vstinner', 'brian.curtin']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue8780'
    versions = ['Python 3.2']

    @vstinner
    Copy link
    Member Author

    The following code works on 2.6, 2.7 (trunk), 3.1, but not on py3k.

    import subprocess, sys
    subprocess.call([sys.executable, '-c', 'print("Hello World!")'])

    On py3k, sys.stdout and sys.stderr are equal to... None.

    I hope that it's a problem with my setup.

    @vstinner vstinner added stdlib Python modules in the Lib dir interpreter-core (Objects, Python, Grammar, and Parser dirs) labels May 21, 2010
    @vstinner
    Copy link
    Member Author

    ("doesn't work" means that the example doesn't print anything)

    @pitrou
    Copy link
    Member

    pitrou commented May 21, 2010

    It's just under Windows, right?

    @vstinner
    Copy link
    Member Author

    It's just under Windows, right?

    It works on Linux. I suppose that the issue is specific to Windows.

    @vstinner vstinner changed the title py3k: child process don't inherit stdout / stdout py3k: child process don't inherit stdout / stdout on Windows May 21, 2010
    @vstinner
    Copy link
    Member Author

    Recent change of subprocess in py3k, I don't know if it's related: r78946.

    @vstinner
    Copy link
    Member Author

    Ok, it *is* a regression introduced by r78946. Attached patch fixes the issue and adds a regression test.

    Add also the author of r78946 to the nosy list :-)

    @briancurtin
    Copy link
    Member

    Looks fine to me.

    The first line of the test comment has "if" instead of "is" but you could fix that on checkin.

    @briancurtin briancurtin assigned vstinner and unassigned briancurtin May 21, 2010
    @vstinner
    Copy link
    Member Author

    Fixed by r81403 (py3k).

    Even if the issue is a regression specific to 3.x, I backported the new test in 3.1: r81408.

    @vstinner vstinner changed the title py3k: child process don't inherit stdout / stdout on Windows py3k: child process don't inherit stdout / stderr on Windows May 21, 2010
    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-windows stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants