From 868359a4a4f95c2164760273b7f3fe086b373266 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 18 Jun 2011 13:27:21 -0400 Subject: [PATCH] libsaria: Catch errors when writing cache files The user doesn't want to see these... --- libsaria/storage/cache.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libsaria/storage/cache.py b/libsaria/storage/cache.py index 9982ab5b..4f9128f8 100644 --- a/libsaria/storage/cache.py +++ b/libsaria/storage/cache.py @@ -27,9 +27,12 @@ def make_cache_path(artist, album, file): def fill_cache(artist, album, title, cache_func, cache_path): text = cache_func(artist, album, title) if text != None: - f = open(cache_path, 'w') - f.write(text) - f.close() + try: + f = open(cache_path, 'w') + f.write(text) + f.close() + except: + pass return True return False