Skip to content
Snippets Groups Projects
Commit ea168353 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

tools/scanner: use urllib3 streaming

parent 79b9c483
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ def check_dl(fname, url): ...@@ -74,7 +74,7 @@ def check_dl(fname, url):
if os.path.isfile(fname): if os.path.isfile(fname):
return return
print('downloading', url) print('downloading', url)
ghandle = gzip.GzipFile(fileobj=http.request('GET', url, headers={'User-Agent': 'Mozilla/5.0'})) ghandle = gzip.GzipFile(fileobj=http.request('GET', url, headers={'User-Agent': 'Mozilla/5.0'}, preload_content=False))
with open(fname, 'wb') as out: with open(fname, 'wb') as out:
for line in ghandle: for line in ghandle:
out.write(line) out.write(line)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment