Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/journal.py
diff options
context:
space:
mode:
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()