On Friday 26 December 2008 04:05:43 Roy Smith wrote: > In article <mailman.6204.1230258299.3487.python-l...@python.org>, > > Rick van Hattem <r...@youtellme.com> wrote: > > Recently I've started building a program that spawns new processes when > > requested via http, since the http interface doesn't need to be fancy > > I've just used the BaseHTTPServer module for this, but... it seems I'm > > running into a little problem. When spawning a new process (which forks > > itself into a daemon, but isn't too relevant in this case) the listening > > socket is copied to the new process. > > The standard solution to this problem is to close all descriptors after > forking and before doing the exec. You can tell subprocess.Popen() to do > this by call it with "close_fds=True".
Thank you very much, I completely forgot about the close_fds argument. That will fix the problem nicely :) -- http://mail.python.org/mailman/listinfo/python-list