Bug 255 fixed
[mediagoblin.git] / mediagoblin / storage / filestorage.py
index 00d6335ef8ece3a9a3429a6035117ba6fd5b2879..1252a3f57f7ff8a6e979ed6796909e11f1c4c0c4 100644 (file)
@@ -64,7 +64,12 @@ class BasicFileStorage(StorageInterface):
     def delete_file(self, filepath):
         # TODO: Also delete unused directories if empty (safely, with
         # checks to avoid race conditions).
-        os.remove(self._resolve_filepath(filepath))
+        try:
+            os.remove(self._resolve_filepath(filepath))
+        except OSError:
+            # the file do not exists!
+            # This should fix bug #255
+            pass
 
     def file_url(self, filepath):
         if not self.base_url: