Permalink
Browse files

Merge branch 'hotfix/0.5.1' into develop

  • Loading branch information...
2 parents 948c3e5 + fe7d4e3 commit 7ac92ba2eeb7aa26cbf3c91b46a2f98bcf7a7292 @flupke flupke committed Dec 21, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/fsfield/fields.py
@@ -112,7 +112,13 @@ def write_data(sender, instance, created, raw, using, **kwargs):
full_path = self.storage.path(path)
directory = op.dirname(full_path)
if not op.exists(directory):
- os.makedirs(directory)
+ try:
+ os.makedirs(directory)
+ except OSError, err:
+ # Another thread may have created the directory since
+ # the check
+ if err.errno == 17:
+ pass
fp = self.storage.open(path, "wb")
if fs_storage:
locks.lock(fp.file, locks.LOCK_EX)

0 comments on commit 7ac92ba

Please sign in to comment.