From 4f3f8832de1b7cc9bebf65b0449cf4d2a1a13696 2010-09-02 19:46:35
From: Fernando Perez <Fernando.Perez@berkeley.edu>
Date: 2010-09-02 19:46:35
Subject: [PATCH] Fix bug with Popen call on windows.

close_fds can't be set to true when pipes are used.

---

diff --git a/IPython/utils/_process_common.py b/IPython/utils/_process_common.py
index 37ad198..47cbf0f 100644
--- a/IPython/utils/_process_common.py
+++ b/IPython/utils/_process_common.py
@@ -63,11 +63,12 @@ def process_handler(cmd, callback, stderr=subprocess.PIPE):
     """
     sys.stdout.flush()
     sys.stderr.flush()
+    close_fds = False if sys.platform=='win32' else True
     p = subprocess.Popen(cmd, shell=True,
                          stdin=subprocess.PIPE,
                          stdout=subprocess.PIPE,
                          stderr=stderr,
-                         close_fds=True)
+                         close_fds=close_fds)
 
     try:
         out = callback(p)