when you run a script using > commands.getstatusoutput() I was getting sh in the process list. Looks like the problem was because of >pipe.read() Following if the modification to the module commands.py which runs without the defunct'ing the shell. ============================================= def getstatusoutput( cmd ): """Return (status, output) of executing cmd in a shell.""" import os pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r', 0) try: lines = pipe.readline() finally: sts = pipe.close() if sts is None: sts = 0 if lines[-1:] == '\n'; lines = lines[:-1] return sts, lines
Logged In: YES user_id=1188172 I cannot reproduce this. Note that your patch cannot work anyway (using readline() instead of readlines()). The try-finally doesn't help either.