Message99352
When a sub-process is spawned from Python (e.g. subprocess.Popen, os.system, etc.), the execution semantics are altered by the Python interpreter as it ignores SIGPIPE which gets inherited by all children.
This causes hung processes, CPU spins and various other altered execution semantics for all sub-processes spawned from Python.
The following example will end up spinning the CPU at 100% whereas the expected behaviour is that it would print a single line of random numbers and exit.
<pre>
python -c 'import subprocess; p = subprocess.Popen("hexdump /dev/urandom | head -n 1", shell=True); print "a %s %s" % (p.communicate());'
</pre> |
|
Date |
User |
Action |
Args |
2010-02-15 01:29:52 | tholzer | set | recipients:
+ tholzer |
2010-02-15 01:29:51 | tholzer | set | messageid: <1266197391.52.0.804629810588.issue7933@psf.upfronthosting.co.za> |
2010-02-15 01:28:51 | tholzer | link | issue7933 messages |
2010-02-15 01:28:49 | tholzer | create | |
|