From b6152b023af22fa28e8a64d400b9496602dab959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Sat, 15 Dec 2012 16:59:00 -0300 Subject: [PATCH] ActivityBundle: don't wrap the temporal icon path in a TempFilePath - SL #4276 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/sugar3/bundle/activitybundle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sugar3/bundle/activitybundle.py b/src/sugar3/bundle/activitybundle.py index 38956734..53c9da65 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"""