edx/ease — pull request #47 by wedaly (2013-12-06 15:39:52+00:00)
Title: Will/tempdir fix

When performing spell-check, `ease` would create a temporary file in the current working directory with the input string.

This caused two problems:

1) In the edx sandbox, the caller did not necessarily have permissions to the current working directory. This would cause grading to fail when opening the temporary file.

2) If multiple processes performed spell-check from the same working directory, they could both write to the same tempfile, corrupting the data.

This PR fixes the issue by using the Python `tempfile` library to create the tempfile. On Linux, this will create the tempfile in /tmp and assign it a unique name, which resolves both the above issues.

@feanil Can I safely assume that /tmp is world-writeable in stage/production?
@nedbat Please review