From b6152b023af22fa28e8a64d400b9496602dab959 Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Sat, 15 Dec 2012 19:59:00 +0000 Subject: ActivityBundle: don't wrap the temporal icon path in a TempFilePath - SL #4276 In the Journal, CellRendererActivityIcon is calling its do_render method after the temporal file is removed. This is because we wrap the icon path in a TempFilePath to control its deletion, but as we don't maintain any reference to it, its __del__ method deletes the temporal file. Note that returning the path directly has one disadventage: the temporal file is left in /tmp . As a comment in the get_icon method of ActivityBundle say, ideally we should return the icon data. But that implies a major change in the Journal model and views, and in the CellRendererIcon class. Signed-off-by: Manuel QuiƱones Acked-by: Simon Schampijer --- diff --git a/src/sugar3/bundle/activitybundle.py b/src/sugar3/bundle/activitybundle.py index 3895673..53c9da6 100644 --- a/src/sugar3/bundle/activitybundle.py +++ b/src/sugar3/bundle/activitybundle.py @@ -213,7 +213,7 @@ class ActivityBundle(Bundle): suffix='.svg') os.write(temp_file, icon_data) os.close(temp_file) - return util.TempFilePath(temp_file_path) + return temp_file_path def get_activity_version(self): """Get the activity version""" -- cgit v0.9.1