From 0dddcf50a6ab466c47c600b2eed1f7b6de6e1d6c Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 31 Aug 2011 20:16:07 +0200 Subject: fixes new debug reports, bad header detection --- module/PluginThread.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'module/PluginThread.py') diff --git a/module/PluginThread.py b/module/PluginThread.py index ffc866a3a..ceeb0dfc5 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -33,9 +33,9 @@ from pycurl import error from PyFile import PyFile from plugins.Plugin import Abort, Fail, Reconnect, Retry, SkipDownload from common.packagetools import parseNames +from utils import save_join from remote.thriftbackend.thriftgen.pyload.ttypes import OnlineStatus - class PluginThread(Thread): """abstract base class for thread types""" @@ -77,9 +77,13 @@ class PluginThread(Thread): zip = zipfile.ZipFile(dump_name, "w") for f in listdir(join("tmp", pyfile.pluginname)): - zip.write(join("tmp", pyfile.pluginname, f), join(pyfile.pluginname, f)) + try: + # avoid encoding errors + zip.write(join("tmp", pyfile.pluginname, f), save_join(pyfile.pluginname, f)) + except: + pass - zip.writestr(join(pyfile.pluginname, "debug_Report.txt"), self.writeDebugFile(pyfile)) + zip.writestr(save_join(pyfile.pluginname, "debug_Report.txt"), self.writeDebugFile(pyfile)) zip.close() -- cgit v1.2.3