Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/journal.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-06-17 18:11:11 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-06-17 18:11:11 (GMT)
commit58fa25be32687e17af457a891882252967624119 (patch)
treec18f9c6337ac2adb569c52c06c89ac219ca18346 /journal.py
parentf2ac4e4583339bcfa1d7894ee6b8b8d2e10f79a3 (diff)
file desc. leak patch (#2051)
Diffstat (limited to 'journal.py')
-rw-r--r--journal.py3
1 files changed, 2 insertions, 1 deletions
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()