From 3a8d812b6988ed2258ad219b22a256c29910849b Mon Sep 17 00:00:00 2001
From: Aleksey Lim <alsroot@member.fsf.org>
Date: Wed, 2 Jun 2010 10:31:14 +0000
Subject: Failure to cleanup temporary files after filesystem full errors #1876
diff --git a/bin/sugar-session b/bin/sugar-session
old mode 100644
new mode 100755
index 1582b65..cc8358c
a
|
b
|
import os |
20 | 20 | import sys |
21 | 21 | import time |
22 | 22 | import subprocess |
| 23 | import shutil |
23 | 24 | |
24 | 25 | if os.environ.get('SUGAR_LOGGER_LEVEL', '') == 'debug': |
25 | 26 | print '%r STARTUP: Starting the shell' % time.time() |
… |
… |
def set_fonts(): |
203 | 204 | def main(): |
204 | 205 | try: |
205 | 206 | from sugar import env |
| 207 | # Remove temporary files. See http://bugs.sugarlabs.org/ticket/1876 |
| 208 | data_dir = os.path.join(env.get_profile_path(), 'data') |
| 209 | shutil.rmtree(data_dir, ignore_errors=True) |
| 210 | os.makedirs(data_dir) |
206 | 211 | cleanup_logs(env.get_logs_path()) |
207 | 212 | except OSError, e: |
208 | 213 | # logs cleanup is not critical; it should not prevent sugar from |