Skip to content

Commit 996bc85

Browse files
committed
Possible fix for 358.
1 parent a1701dd commit 996bc85

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

StaticAnalyzer/views/shared_func.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,8 @@ def Unzip(APP_PATH, EXT_PATH):
6666
files = []
6767
with zipfile.ZipFile(APP_PATH, "r") as z:
6868
for fileinfo in z.infolist():
69-
dat = z.open(fileinfo.filename, "r")
70-
filename = fileinfo.filename
71-
if not isinstance(filename, unicode):
72-
filename = unicode(fileinfo.filename,
73-
encoding="utf-8", errors="replace")
74-
files.append(filename)
75-
outfile = os.path.join(EXT_PATH, filename)
76-
if not os.path.exists(os.path.dirname(outfile)):
77-
try:
78-
os.makedirs(os.path.dirname(outfile))
79-
except OSError as exc: # Guard against race condition
80-
if exc.errno != errno.EEXIST:
81-
print "\n[WARN] OS Error: Race Condition"
82-
if not outfile.endswith("/"):
83-
with io.open(outfile, mode='wb') as f:
84-
f.write(dat.read())
85-
dat.close()
69+
files.append(fileinfo.filename)
70+
z.extract(fileinfo, EXT_PATH)
8671
return files
8772
except:
8873
PrintException("[ERROR] Unzipping Error")

0 commit comments

Comments
 (0)