[sabayon] fixed potential exception in storage.py
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [sabayon] fixed potential exception in storage.py
- Date: Fri, 23 Oct 2009 22:08:39 +0000 (UTC)
commit a1d995eff4697c5dbe344917b42b31bc6a206171
Author: Scott Balneaves <sbalneav ltsp org>
Date: Fri Sep 4 12:58:17 2009 -0500
fixed potential exception in storage.py
lib/storage.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/lib/storage.py b/lib/storage.py
index e5c6fc0..6d9aad4 100755
--- a/lib/storage.py
+++ b/lib/storage.py
@@ -481,8 +481,10 @@ class ProfileStorage:
raise err
if got_stat:
- os.unlink (dest) # FIXME: this could fail, but that would be because the parent
- # directory is not writable. Then we have bigger problems, anyway.
+ try:
+ os.unlink (dest)
+ except OSError, err:
+ raise ProfileStorageException (_("Couldn't unlink file '%s'") % dest)
# FIXME: we lose the "original" permissions, mtime, etc. with ZIP files.
shutil.copy2 (src, dest)
@@ -638,7 +640,6 @@ class ProfileStorage:
except:
if backup:
failsafe_rename (backup, self.path)
- raise
if backup:
os.remove (backup)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]