summaryrefslogtreecommitdiff
path: root/python/downloadprovider.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2018-10-04 17:41:45 -0400
committerPeter LaFosse <peter@vector35.com>2018-10-05 14:46:17 -0400
commitd6d42735ecc95b73d1f7d2b3705c2f5c92dfada5 (patch)
tree40da3613a6bcec4ef33b32658564d8a30b820bfa /python/downloadprovider.py
parent9027abc0c2a905c85387ad8f2ffed487ee9efffc (diff)
Force use of requests on Windows to avoid cert issues on some installs
Diffstat (limited to 'python/downloadprovider.py')
-rw-r--r--python/downloadprovider.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/downloadprovider.py b/python/downloadprovider.py
index 10f9dee1..b619b40c 100644
--- a/python/downloadprovider.py
+++ b/python/downloadprovider.py
@@ -153,7 +153,7 @@ class DownloadProvider(with_metaclass(_DownloadProviderMetaclass, object)):
return DownloadInstance(self, handle = result)
-if sys.version_info >= (2, 7, 9):
+if (sys.platform != "win32") and (sys.version_info >= (2, 7, 9)):
try:
from urllib.request import urlopen, build_opener, install_opener, ProxyHandler
from urllib.error import URLError
@@ -216,7 +216,8 @@ if sys.version_info >= (2, 7, 9):
else:
try:
import requests
- from requests import pyopenssl
+ if sys.platform != "win32":
+ from requests import pyopenssl
class PythonDownloadInstance(DownloadInstance):
def __init__(self, provider):
super(PythonDownloadInstance, self).__init__(provider)
@@ -268,7 +269,9 @@ else:
PythonDownloadProvider().register()
except ImportError:
if sys.platform == "win32":
- log.log_error("Provided Python version is too old! Only Python 2.7.10 and above are known to work on Windows!")
+ log.log_error("The pip requests package is required for network connectivity!")
+ log.log_error("Please install the requests package into the selected Python environment:")
+ log.log_error(" python -m pip install requests")
else:
log.log_error("On Python versions below 2.7.9, the pip requests[security] package is required for network connectivity!")
log.log_error("On an Ubuntu 14.04 install, the following three commands are sufficient to enable networking for the current user:")