From 28bc471a19fb31f0665eef6d648265bf203c4707 Mon Sep 17 00:00:00 2001 From: "St.Huang" Date: Thu, 2 Aug 2018 15:26:42 +0800 Subject: [PATCH] bug fixes --- addons/fastwq/libs/ankihub.py | 7 +++++-- addons21/fastwq/libs/ankihub.py | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/fastwq/libs/ankihub.py b/addons/fastwq/libs/ankihub.py index 716e013..f34977f 100644 --- a/addons/fastwq/libs/ankihub.py +++ b/addons/fastwq/libs/ankihub.py @@ -98,7 +98,10 @@ def installZipFile(data, fname): # folder; ignore continue # write - z.extract(n, base) + try: + z.extract(n, base) + except: + print(n) return True @@ -121,7 +124,7 @@ def updateSingle(repositories, path, data): urlthread.join() response = urlthread.response#urllib2.urlopen(code) meta = response.info() - file_size = int(meta.get("Content-Length")) + file_size = int(meta.getheaders("Content-Length")[0]) except: appendHtml('Downloading file error!
') return diff --git a/addons21/fastwq/libs/ankihub.py b/addons21/fastwq/libs/ankihub.py index 11f0284..e5fd9df 100644 --- a/addons21/fastwq/libs/ankihub.py +++ b/addons21/fastwq/libs/ankihub.py @@ -98,7 +98,10 @@ def installZipFile(data, fname): # folder; ignore continue # write - z.extract(n, base) + try: + z.extract(n, base) + except: + print(n) return True