mitsuhiko/werkzeug — Issue #144: Properly handle negative subprocess.call return values
Author: izibi
Created: 2011-12-17 22:24:50+00:00
State: open

Werkzeug simply passes the return value of `subprocess.call` to `sys.exit` in the `run_with_reloader` and `run_with_reloader` functions in `werkzeug.serving` but `subprocess.call` returns a negative value if the child was terminated by signal [0]. For example if the child segfaults, you get this:

$ python
Python 2.7.2 (default, Nov 21 2011, 17:25:27)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.exit(-11)
$ echo $?
245

[0] http://docs.python.org/library/subprocess.html#subprocess.Popen.returncode