Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2008-10-21 14:49:22 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2008-10-21 14:49:22 (GMT)
commitbbca5fb32995e48285f59267b8fc3499d94456ba (patch)
tree3143e85c561386fd704cf38ea4482b761f2d81bf
parent2ce1fe63b612c7a3a6bd97f25330fc1804aeaa7b (diff)
tempfile.mkstemp() returns a tuple
-rw-r--r--src/olpc/datastore/filestore.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/olpc/datastore/filestore.py b/src/olpc/datastore/filestore.py
index c7dd936..0ed2b56 100644
--- a/src/olpc/datastore/filestore.py
+++ b/src/olpc/datastore/filestore.py
@@ -100,8 +100,10 @@ class FileStore(object):
attempt = 1
while os.path.exists(destination_path):
if attempt > 10:
- destination_path = tempfile.mkstemp(prefix=uid,
- dir=destination_dir)
+ fd, destination_path = tempfile.mkstemp(prefix=uid,
+ dir=destination_dir)
+ del fd
+ break
else:
file_name = '%s_%s' % (uid, attempt)
destination_path = os.path.join(destination_dir, file_name)