From 8d8e5738073d1726ace7d19589b9c6529b8b30ad Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 15 Jun 2011 18:53:49 +0200 Subject: fixes some encoding issues --- module/plugins/hooks/MergeFiles.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks') diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 9062cb14c..b4c98df08 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -17,13 +17,15 @@ @author: and9000 """ -from module.plugins.Hook import Hook - import os import re import sys import traceback +from os.path import join +from module.utils import save_join, fs_encode +from module.plugins.Hook import Hook + BUFFER_SIZE = 4096 class MergeFiles(Hook): @@ -55,11 +57,11 @@ class MergeFiles(Hook): download_folder = self.core.config['general']['download_folder'] if self.core.config['general']['folder_per_package']: - download_folder = os.path.join(download_folder, pack.folder.decode(sys.getfilesystemencoding())) + download_folder = save_join(download_folder, pack.folder) for name, file_list in files.iteritems(): self.core.log.info("Starting merging of %s" % name) - final_file = open(os.path.join(download_folder, name), "wb") + final_file = open(join(download_folder, fs_encode(name)), "wb") for splitted_file in file_list: self.core.log.debug("Merging part %s" % splitted_file) -- cgit v1.2.3