Fix urllib.request import
This commit is contained in:
parent
b7a1b3b8b5
commit
4e93f235f6
@ -9,7 +9,7 @@ import re
|
|||||||
import shutil
|
import shutil
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import sys
|
import sys
|
||||||
import urllib
|
import urllib.request
|
||||||
import zipfile
|
import zipfile
|
||||||
from genericpath import exists
|
from genericpath import exists
|
||||||
from itertools import product
|
from itertools import product
|
||||||
@ -1236,7 +1236,7 @@ def extract_all_from_zip_url(zip_url, tmp_zip, folder):
|
|||||||
zip_filename: Temporary zip file to save from url.
|
zip_filename: Temporary zip file to save from url.
|
||||||
folder: Extract all files inside this folder.
|
folder: Extract all files inside this folder.
|
||||||
"""
|
"""
|
||||||
with urllib.urlopen(zip_url) as response, open(tmp_zip.strpath, 'wb') as out_file:
|
with urllib.request.urlopen(zip_url) as response, open(tmp_zip.strpath, 'wb') as out_file:
|
||||||
shutil.copyfileobj(response, out_file)
|
shutil.copyfileobj(response, out_file)
|
||||||
zip_obj = zipfile.ZipFile(tmp_zip.strpath)
|
zip_obj = zipfile.ZipFile(tmp_zip.strpath)
|
||||||
zip_obj.extractall(path=folder.strpath)
|
zip_obj.extractall(path=folder.strpath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user