From 27c4ad6ee268c8a7a90f8f035e3a661747fec5c5 Mon Sep 17 00:00:00 2001 From: Patrick Speiser Date: Sat, 13 Oct 2012 09:53:51 +0200 Subject: [PATCH 1/2] Fix post processing file renaming for some (all?) releases with unicode characters --- headphones/postprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index a78e753e..33caeda9 100644 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -676,7 +676,7 @@ def renameFiles(albumpath, downloaded_track_list, release): logger.debug("Renaming for: " + downloaded_track.decode(headphones.SYS_ENCODING) + " is not neccessary") continue - logger.debug('Renaming %s ---> %s' % (downloaded_track.decode(headphones.SYS_ENCODING), new_file_name.decode(headphones.SYS_ENCODING))) + logger.debug('Renaming %s ---> %s' % (downloaded_track.decode(headphones.SYS_ENCODING,'replace'), new_file_name.decode(headphones.SYS_ENCODING,'replace'))) try: os.rename(downloaded_track, new_file) except Exception, e: From 2614d0140be816c0642981658459e31dca77f5b7 Mon Sep 17 00:00:00 2001 From: Patrick Speiser Date: Sat, 13 Oct 2012 12:18:03 +0200 Subject: [PATCH 2/2] Write configuration as UTF-8 ,allows unicode characters in configuration settings --- headphones/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/headphones/__init__.py b/headphones/__init__.py index a9f9223e..30fa5902 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -584,7 +584,7 @@ def launch_browser(host, port, root): def config_write(): - new_config = ConfigObj() + new_config = ConfigObj(encoding="UTF-8") new_config.filename = CONFIG_FILE new_config['General'] = {}