diff options
author | Walter Bender <walter@sugarlabs.org> | 2010-06-17 18:11:11 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2010-06-17 18:11:11 (GMT) |
commit | 58fa25be32687e17af457a891882252967624119 (patch) | |
tree | c18f9c6337ac2adb569c52c06c89ac219ca18346 /journal.py | |
parent | f2ac4e4583339bcfa1d7894ee6b8b8d2e10f79a3 (diff) |
file desc. leak patch (#2051)
Diffstat (limited to 'journal.py')
-rw-r--r-- | journal.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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() |