From 81028d4d09322ca7f17fd7b9b0499969c58f94be Mon Sep 17 00:00:00 2001 From: rembo10 Date: Fri, 23 Mar 2012 17:58:54 +0000 Subject: [PATCH] Added try/except to the file moving to catch already-exists errors --- headphones/postprocessor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 673dd704..ed484e32 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -366,8 +366,11 @@ def moveFiles(albumpath, release, tracks): for r,d,f in os.walk(albumpath): for files in f: - shutil.move(os.path.join(r, files), destination_path) - + try: + shutil.move(os.path.join(r, files), destination_path) + except shutil.Error, e: + logger.warn('Error moving file %s: %s' % (files, e)) + # Chmod the directories using the folder_format (script courtesy of premiso!) folder_list = folder.split('/')