Closed wedaly closed 10 years ago
@wedaly Yes it is safe to assume that /tmp is world-writeable in stage and prod.
@nedbat Done
I am giving this a reluctant :+1:. It will spell-check without collision from multiple threads and processes. But there are so many better ways to accomplish much of what it does.... :(
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