Message181425
Compare this with the script in #14252:
p = Popen(['/bin/sleep', '1'])
time.sleep(1)
p.terminate()
print p.poll()
p.terminate()
Output is:
0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/subprocess.py", line 1269, in terminate
self.send_signal(signal.SIGTERM)
File "/usr/lib/python2.6/subprocess.py", line 1264, in send_signal
os.kill(self.pid, sig)
OSError: [Errno 3] No such process
The 0 return from poll() indicates that the subprocess ran to completion, rather than being terminated by the first terminate. So the first terminate does nothing, but the second terminate raises an exception. In http://bugs.python.org/issue14252#msg155396 :
"Raising an exception on terminate is a bug." |
|
Date |
User |
Action |
Args |
2013-02-05 09:54:59 | siona | set | recipients:
+ siona |
2013-02-05 09:54:59 | siona | set | messageid: <1360058099.4.0.320628892834.issue17131@psf.upfronthosting.co.za> |
2013-02-05 09:54:59 | siona | link | issue17131 messages |
2013-02-05 09:54:58 | siona | create | |
|