diff options
author | Sascha Silbe <sascha@silbe.org> | 2009-12-20 12:54:00 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-12-20 12:54:00 (GMT) |
commit | 71f000a02583edd0cac5a59b3228204c49f8412a (patch) | |
tree | 25a368065ced30424d34093ec1d5f993009619b4 | |
parent | 4118839fc65b790908f02d5fda722fb5b834df69 (diff) |
fix file descriptor leak in filestore.retrieve()
Fix file descriptor leak in filestore.retrieve().
Minimally invasive version.
Signed-off-by: Sascha Silbe <sascha@silbe.org>
-rw-r--r-- | src/carquinyol/filestore.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/carquinyol/filestore.py b/src/carquinyol/filestore.py index f88c531..06d3b64 100644 --- a/src/carquinyol/filestore.py +++ b/src/carquinyol/filestore.py @@ -110,10 +110,9 @@ class FileStore(object): attempt = 1 while os.path.exists(destination_path): if attempt > 10: - fd_, destination_path = tempfile.mkstemp(prefix=uid, - suffix=extension, - dir=destination_dir) - del fd_ + fd, destination_path = tempfile.mkstemp(prefix=uid, + suffix=extension, dir=destination_dir) + os.close(fd) os.unlink(destination_path) break else: |