mozilla/zamboni — pull request #731 by ngokevin (2013-04-22 21:56:43+00:00)
Title: prevent race condition in file storage open (bug 861234)

Related to a Celery task saving persona images.

```
save_persona_image.delay(src=header,
full_dst=os.path.join(dst_root, 'header.png')) save_persona_image.delay(src=footer,
full_dst=os.path.join(dst_root, 'footer.png'))
```

- Image1 checks if directory exists, does not exist.
- Image2 checks if directory exists, does not exist.
- Image2 creates directory.
- Image1 tries to create directory, throws OSError.

[Relevant stackoverflow](http://stackoverflow.com/questions/273192/python-best-way-to-create-directory-if-it-doesnt-exist-for-file-write)