See if using python instead of curl bypasses the windows CI failure

This commit is contained in:
Kovid Goyal 2022-10-20 11:15:51 +05:30
parent d924db2fcd
commit 35cb784452
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -69,6 +69,10 @@ def download_securely(url):
# We use curl here as on some OSes (OS X) when bootstrapping calibre,
# python will be unable to validate certificates until after cacerts is
# installed
if os.environ.get('CI') and iswindows:
# curl is failing for wikipedia urls on CI (used for browser_data)
from urllib.request import urlopen
return urlopen(url).read()
if not curl_supports_etags():
return subprocess.check_output(['curl', '-fsSL', url])
url_hash = hashlib.sha1(url.encode('utf-8')).hexdigest()