mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
See if using python instead of curl bypasses the windows CI failure
This commit is contained in:
parent
d924db2fcd
commit
35cb784452
@ -69,6 +69,10 @@ def download_securely(url):
|
|||||||
# We use curl here as on some OSes (OS X) when bootstrapping calibre,
|
# We use curl here as on some OSes (OS X) when bootstrapping calibre,
|
||||||
# python will be unable to validate certificates until after cacerts is
|
# python will be unable to validate certificates until after cacerts is
|
||||||
# installed
|
# 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():
|
if not curl_supports_etags():
|
||||||
return subprocess.check_output(['curl', '-fsSL', url])
|
return subprocess.check_output(['curl', '-fsSL', url])
|
||||||
url_hash = hashlib.sha1(url.encode('utf-8')).hexdigest()
|
url_hash = hashlib.sha1(url.encode('utf-8')).hexdigest()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user