fabric/fabric — pull request #1188 by tolbkni (2014-09-02 09:31:09+00:00)
Title: Close fds before the child process is executed

All file descriptors except 0, 1 and 2 are closed before the child process is executed. (Unix only)

I call `fabric.api.local` function to start service in my python application, which open a port to accept HTTP connections, then stop the application, the opened port will be attached to the service! I cannot run my python application again, since the port is already used.

The default value of the executable parameter of the `subprocess.Popen` function is `None`, so we don't need the condition `if shell is not None:`