This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: py3k: child process don't inherit stdout / stderr on Windows
Type: Stage:
Components: Interpreter Core, Library (Lib), Windows Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vstinner Nosy List: brian.curtin, gregory.p.smith, pitrou, vstinner
Priority: critical Keywords: patch

Created on 2010-05-21 12:37 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
subprocess_windows.patch vstinner, 2010-05-21 14:12
Messages (8)
msg106232 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-21 12:37
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.
msg106233 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-21 12:38
("doesn't work" means that the example doesn't print anything)
msg106234 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-05-21 12:40
It's just under Windows, right?
msg106237 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-21 13:20
> It's just under Windows, right?

It works on Linux. I suppose that the issue is specific to Windows.
msg106238 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-21 13:37
Recent change of subprocess in py3k, I don't know if it's related: r78946.
msg106244 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-21 14:12
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 :-)
msg106246 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-05-21 14:46
Looks fine to me.

The first line of the test comment has "if" instead of "is" but you could fix that on checkin.
msg106263 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-21 20:40
Fixed by r81403 (py3k).

Even if the issue is a regression specific to 3.x, I backported the new test in 3.1: r81408.
History
Date User Action Args
2022-04-11 14:57:01adminsetgithub: 53026
2010-05-21 20:40:56vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg106263

title: py3k: child process don't inherit stdout / stdout on Windows -> py3k: child process don't inherit stdout / stderr on Windows
2010-05-21 14:46:35brian.curtinsetassignee: brian.curtin -> vstinner
messages: + msg106246
2010-05-21 14:12:43vstinnersetfiles: + subprocess_windows.patch

nosy: + gregory.p.smith
messages: + msg106244

keywords: + patch
2010-05-21 13:37:34vstinnersetmessages: + msg106238
2010-05-21 13:20:08vstinnersetmessages: + msg106237
title: py3k: child process don't inherit stdout / stdout -> py3k: child process don't inherit stdout / stdout on Windows
2010-05-21 12:40:22pitrousetpriority: normal -> critical

nosy: + brian.curtin, pitrou
messages: + msg106234

assignee: brian.curtin
components: + Windows
2010-05-21 12:38:29vstinnersetmessages: + msg106233
2010-05-21 12:37:55vstinnercreate