[Patches] [ python-Patches-1669481 ] subprocess: Support close_fds on Win32

SourceForge.net noreply at sourceforge.net
Mon Feb 26 22:47:16 CET 2007


Patches item #1669481, was opened at 2007-02-26 21:47
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1669481&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.6
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jon Foster (jongfoster)
Assigned to: Nobody/Anonymous (nobody)
Summary: subprocess: Support close_fds on Win32

Initial Comment:
There is an existing close_fds parameter to the subprocess.Popen() constructor that prevents FDs being copied to the child process on UNIX.  This patch makes that parameter also work on Windows (with a caveat).

Setting this parameter on Windows was explicitly prohibited by the code, because it prevents redirecting stdin/stdout/stderr.  However, the check is too restrictive; it is perfectly reasonable to set this flag if you are not redirecting anything.  That is what this patch does.

The behaviour is unchanged if you are on Windows, set this flag, and simultaneously try to redirect stdin/stdout/stderr: the call will fail with an exception.

This patch is against Python SVN trunk.

Kind regards,

Jon Foster


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1669481&group_id=5470


More information about the Patches mailing list