From 58fa25be32687e17af457a891882252967624119 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 17 Jun 2010 18:11:11 +0000 Subject: file desc. leak patch (#2051) --- (limited to 'journal.py') diff --git a/journal.py b/journal.py index a2f21e7..3668aaa 100644 --- a/journal.py +++ b/journal.py @@ -331,7 +331,7 @@ class JournalInteraction(): gtk.threads_enter() act_root = environ['SUGAR_ACTIVITY_ROOT'] tmp_dir = join(act_root, 'data') - file_path = str(tempfile.mkstemp(dir=tmp_dir)[1]) + tmp_fd, file_path = tempfile.mkstemp(dir=tmp_dir) ###TODO: This is such a crappy way to write a file to the journal ### Ideally to be implemented with write_file and read_file methods os.chmod(file_path, 0777) @@ -366,6 +366,7 @@ class JournalInteraction(): jobject.destroy() del jobject finally: + os.close(tmp_fd) os.remove(file_path) gtk.threads_leave() -- cgit v0.9.1