Python POpen - works on Win, OE/Linux but not OSX
#1
The following code:

Code:
if constants.SYSTEM=="Windows":
          output, result = subprocess.Popen(exe, creationflags=0x08000000, stdout = subprocess.PIPE, stderr = subprocess.PIPE, shell=False).communicate()
        else:
          output, result = subprocess.Popen(exe, shell=False, stdout = subprocess.PIPE, stderr= subprocess.PIPE).communicate()

...where 'exe' is a list containing the appropriate squeezeslave binary and arguments, works fine on Windows, Ubuntu, and Openelec.

It fails with
IOError: No Child Processes

...on OSX.

However, this code, later, works:

Code:
if constants.SYSTEM=="Windows":
              slaveProcess = subprocess.Popen(exe, creationflags=0x08000000, shell=False)
            else:
              slaveProcess = subprocess.Popen(exe, shell=False)

I am not an expert on (anything, including...) Python/Process Spawning - is there a better platform friendly way to do this (spawn a process and grad stdout from it)? I have found some odd stuff in Python in this area (e.g. os.system("chmod +X") works but os.chmod(file) does not!)
Sorry, no help w/out a *full debug log*
Reply
#2
Bump - any Mac people have any ideas about this??
Sorry, no help w/out a *full debug log*
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Python POpen - works on Win, OE/Linux but not OSX00