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.

Title: subprocess on Windows: extra windows
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: astrand, reowen
Priority: normal Keywords:

Created on 2004-10-29 21:49 by reowen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg22947 - (view) Author: Russell Owen (reowen) Date: 2004-10-29 21:49
My understanding was that was supposed to be 
backwards compatible with at least Python 2.3 if not 2.2. Wanting 
subprocess and backwards compatibility, I grabbed the 
from 2.4b1, changed the import if so that win32api was used (since I 
had no _subprocess library!) and found several problems, of which 
this is is the mildes:

when using subprocess.Popen on Windows I get one or more windows 
called C:\WINNT\system32\CMD.EXE popping up. Sometimes they 
stick around, other times they are only around for a short time. Note 
that I don't see this probem using os.popen3 (on the 
other hand, os.popen3 has inferior error handling).

The following code is one example:
from subprocess import *
Popen("ds9 -title foo", shell=True, cwd="C:\\Program Files\\ds9\\")
msg22948 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2004-10-31 07:09
Logged In: YES 

Which Windows version are you using?
msg22949 - (view) Author: Russell Owen (reowen) Date: 2004-11-03 19:02
Logged In: YES 

I am using Windows 2000 Professional.
msg22950 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2004-11-07 14:33
Logged In: YES 

This happens because cmd.exe/ opens a window by
default. To get rid of this, we need to pass SW_HIDE to

I've fixed this in revision 1.8 of and
revision 1.3 of When using shell=True,
SW_HIDE is now default. 
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 41105
2004-10-29 21:49:37reowencreate