Created
November 20, 2016 10:05
-
-
Save HelloZeroNet/b03479e404836728faa8f1acc4ccf781 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zipfile, time | |
import cStringIO as StringIO | |
data = StringIO.StringIO() | |
req = open("archive.zip@ref=master", "rb") | |
while True: | |
buff = req.read(1024) | |
if not buff: | |
break | |
data.write(buff) | |
data.seek(0) | |
try: | |
zipdata = zipfile.ZipFile(data) | |
print ".", | |
except Exception, err: | |
print "-", | |
data.seek(0, 2) | |
s = time.time() | |
zipdata = zipfile.ZipFile(data) | |
print time.time() - s | |
print zipdata.testzip() | |
print time.time() - s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment