Author astrand
Date 2007-01-29.20:54:28
SpamBayes Score
Marked as misclassified
>If one calls Popen with stdin = stdout = stderr = None,
>the caller's std descriptors are inherited on *x, but
>not on Windows, 

This is a correct observation. However, the current implementation is not necessarily wrong. This could instead be seen as a consequence of the different environments. The subprocess documentation states that "With None, no redirection will occur". So, it becomes an interpretation of what this really mean. Since the "default" behaviour on UNIX is to inherit and the default behaviour on Windows is to attach the standard handles to (an often newly created) console window, one could argue that this fits fairly good with the description "no redirection will occur". 

If we would change this, so that the parents handles are always inherited, then how would you specify that you want to attach the standard handles to the new console window? 

For best flexibility, the API should allow both cases: Both inherit all handles from the parent as well as attaching all standard handles to the new console window. As you point out, the current API allows this. So why change this?

One thing that's clearly an bug is the second part of the documentation:

"With None, no redirection will occur; the child's file handles will be inherited from the

This is currently only true on UNIX. If we should keep the current behaviour, at least the comment needs to be fixed. 
Date User Action Args
2007-08-23 14:32:39adminlinkissue1227748 messages
2007-08-23 14:32:39admincreate