summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-08-31 20:16:07 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-08-31 20:16:07 +0200
commit0dddcf50a6ab466c47c600b2eed1f7b6de6e1d6c (patch)
tree8d2440fc0bb262b4f69dac7637f57bffd9908fec
parentclosed #357, #384 (diff)
downloadpyload-0dddcf50a6ab466c47c600b2eed1f7b6de6e1d6c.tar.xz
fixes new debug reports, bad header detection
-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