Skip to content

Commit ed15db5

Browse files
whuaegeanseahojnnes
authored andcommitted
Fix error of using urllib to download eigen from gitlab (colmap#1194)
Co-authored-by: Johannes Schönberger <joschonb@microsoft.com>
1 parent 22526dd commit ed15db5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/python/build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import zipfile
4040
import hashlib
4141
import ssl
42-
import urllib.request
42+
import requests
4343
import subprocess
4444
import multiprocessing
4545

@@ -185,7 +185,9 @@ def check_md5_hash(path, md5_hash):
185185

186186
def download_zipfile(url, archive_path, unzip_path, md5_hash):
187187
if not os.path.exists(archive_path):
188-
urllib.request.urlretrieve(url, archive_path)
188+
r = requests.get(url)
189+
with open(archive_path, 'wb') as outfile:
190+
outfile.write(r.content)
189191
check_md5_hash(archive_path, md5_hash)
190192
with zipfile.ZipFile(archive_path, "r") as fid:
191193
fid.extractall(unzip_path)

0 commit comments

Comments
 (0)