From 7e5b8ee22743d7900022df15d0b9e4f6a4273942 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Wed, 02 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 index 1582b65..cc8358c 100644..100755 --- a/bin/sugar-session +++ b/bin/sugar-session @@ -20,6 +20,7 @@ import os import sys import time import subprocess +import shutil if os.environ.get('SUGAR_LOGGER_LEVEL', '') == 'debug': print '%r STARTUP: Starting the shell' % time.time() @@ -203,6 +204,10 @@ def set_fonts(): def main(): try: from sugar import env + # Remove temporary files. See http://bugs.sugarlabs.org/ticket/1876 + data_dir = os.path.join(env.get_profile_path(), 'data') + shutil.rmtree(data_dir, ignore_errors=True) + os.makedirs(data_dir) cleanup_logs(env.get_logs_path()) except OSError, e: # logs cleanup is not critical; it should not prevent sugar from -- cgit v0.9.1