Message155174
| Author |
pitrou |
| Recipients |
loewis, neologix, pitrou |
| Date |
2012年03月08日.20:21:24 |
| SpamBayes Score |
1.1752932e-08 |
| Marked as misclassified |
No |
| Message-id |
<1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Compare:
$ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['cat']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())"
-2
with:
$ ./python -c "import subprocess, signal, time; p = subprocess.Popen(['python', '-c', 'input()']); time.sleep(1); p.send_signal(signal.SIGINT); print(p.wait())"
Traceback (most recent call last):
File "<string>", line 1, in <module>
KeyboardInterrupt
1
Python's behaviour apparently breaks a common assumption towards Unix processes (see bug reported at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652926). A solution would be to add a signal number attribute to KeyboardInterrupt, and use that value when computing the process exit code. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年03月08日 20:21:25 | pitrou | set | recipients:
+ pitrou, loewis, neologix |
| 2012年03月08日 20:21:25 | pitrou | set | messageid: <1331238085.62.0.936420173713.issue14229@psf.upfronthosting.co.za> |
| 2012年03月08日 20:21:24 | pitrou | link | issue14229 messages |
| 2012年03月08日 20:21:24 | pitrou | create |
|