summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/PluginThread.py10
-rw-r--r--module/network/HTTPRequest.py2
2 files changed, 8 insertions, 4 deletions
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()
diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py
index 68626a7d0..88f75c828 100644
--- a/module/network/HTTPRequest.py
+++ b/module/network/HTTPRequest.py
@@ -30,7 +30,7 @@ def myquote(url):
return quote(url, safe="%/:=&?~#+!$,;'@()*[]")
class BadHeader(Exception):
- def __init__(self, code, content):
+ def __init__(self, code, content=""):
Exception.__init__(self, "Bad server response: %s"% code)
self.code = code
self.content = content