praekelt/vumi — pull request #630 by hodgestar (2013-10-21 09:38:00+00:00)
Title: Fix sandbox_rlimiter's logic for looking up its own filename.

The sandbox rlimiter needs to exec a Python instance that runs itself as a script to avoid importing parts of Twisted that get unhappy when closing filehandles. Currently the script does something like `python __file__` but `__file__` may be a `.pyc` file. This is ordinarily fine but if the `.py` file has just been updated the `.pyc` file will be invalid and this will fail.

This manifests as an error fro the sandbox that looks like:

```
[2013-10-21T08:03:08.550038, ERROR] /ve/bin/python: can't open file '/ve/src/vumi/vumi/application/sandbox_rlimiter.pyc': [Errno 2] No such file or directory
```

The fix is to replace the `.pyc` or `.pyo` with `.py`.