From 91a2716ca4685e581c8a38de0524d422d5d2a6bf Mon Sep 17 00:00:00 2001 From: Remy Date: Fri, 19 Aug 2011 20:06:44 -0700 Subject: [PATCH] changed unicode encoding for destination path --- headphones/postprocessor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index f1f869c5..7f78f84c 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -316,13 +316,13 @@ def moveFiles(albumpath, release, tracks): if folder.endswith('.'): folder = folder.replace(folder[len(folder)-1], '_') - destination_path = os.path.normpath(os.path.join(headphones.DESTINATION_DIR, folder)) + destination_path = os.path.normpath(os.path.join(headphones.DESTINATION_DIR, folder)).encode(headphones.SYS_ENCODING) if os.path.exists(destination_path): i = 1 while True: newfolder = folder + '[%i]' % i - destination_path = os.path.normpath(os.path.join(headphones.DESTINATION_DIR, newfolder)) + destination_path = os.path.normpath(os.path.join(headphones.DESTINATION_DIR, newfolder)).encode(headphones.SYS_ENCODING) if os.path.exists(destination_path): i += 1 else: @@ -331,8 +331,6 @@ def moveFiles(albumpath, release, tracks): logger.info('Moving files from %s to %s' % (unicode(albumpath, headphones.SYS_ENCODING, errors="replace"), destination_path)) - destination_path = destination_path.encode(headphones.SYS_ENCODING) - try: os.makedirs(destination_path)