From 97a00e65bab3536fee2806cc7e3e129947e501a4 Mon Sep 17 00:00:00 2001 From: Remy Date: Sat, 20 Aug 2011 19:50:15 -0700 Subject: [PATCH 1/2] Fixed unicode error on chmod --- headphones/postprocessor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 353e60b4..e488435b 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -344,8 +344,8 @@ def moveFiles(albumpath, release, tracks): temp_f = headphones.DESTINATION_DIR for f in folder_list: - temp_f = os.path.join(temp_f, f).encode(headphones.SYS_ENCODING) - os.chmod(temp_f, int(headphones.FOLDER_PERMISSIONS, 8)) + temp_f = os.path.join(temp_f, f) + os.chmod(os.path.normpath(temp_f).encode(headphones.SYS_ENCODING), int(headphones.FOLDER_PERMISSIONS, 8)) try: shutil.rmtree(albumpath) @@ -497,7 +497,7 @@ def forcePostProcess(): # Parse the folder names to get artist album info for folder in folders: - folder = unicode(folder) + folder = unicode(folder, headphones.SYS_ENCODING, errors="replace") albumpath = os.path.join(download_dir, folder) From 4198fd4a0b6ed9152c517575bb7953ef736227c4 Mon Sep 17 00:00:00 2001 From: Remy Date: Sat, 20 Aug 2011 20:17:17 -0700 Subject: [PATCH 2/2] Fixed unicode bug when querying mb for a release id in postprocessor --- headphones/postprocessor.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index e488435b..2ed34315 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -496,8 +496,6 @@ def forcePostProcess(): # Parse the folder names to get artist album info for folder in folders: - - folder = unicode(folder, headphones.SYS_ENCODING, errors="replace") albumpath = os.path.join(download_dir, folder)