Commits

Waldemar Kornewald  committed 3eedab2

fixed deletion of blobstore folder. contributed by Wilfred Hughes. thanks!

  • Participants
  • Parent commits b37a6c1

Comments (0)

Files changed (1)

 from google.appengine.api.namespace_manager import set_namespace
 import logging
 import os
+import shutil
 
 DATASTORE_PATHS = {
     'datastore_path': os.path.join(DATA_ROOT, 'datastore'),
         if not path:
             continue
         try:
-            os.remove(path)
+            if os.path.isdir(path):
+                shutil.rmtree(path)
+            else:
+                os.remove(path)
         except OSError, error:
             if error.errno != 2:
                 logging.error("Failed to clear datastore: %s" % error)