setup.py: retrieve cacert.pem from requests package. Create application compressed archive. Added a fix for requests to support cacert.pem in different locations.

This commit is contained in:
Jose Manuel Delicado
2016-05-08 00:08:40 +02:00
parent 7ad5e6fa37
commit 7fab6bcf54
5 changed files with 28 additions and 4971 deletions

View File

@@ -4,9 +4,10 @@ import sys
import fix_arrow # A few new locales for Three languages in arrow.
import fix_urllib3_warnings # Avoiding some SSL warnings related to Twython.
import fix_win32com
import fix_requests #fix cacert.pem location for TWBlue binary copies
def setup():
fix_arrow.fix()
if hasattr(sys, "frozen"):
fix_win32com.fix()
fix_requests.fix()
fix_urllib3_warnings.fix()

10
src/fixes/fix_requests.py Normal file
View File

@@ -0,0 +1,10 @@
from requests import certs, utils, adapters
import paths
def patched_where():
return paths.app_path(u"cacert.pem")
def fix():
certs.where=patched_where
utils.DEFAULT_CA_BUNDLE_PATH=patched_where()
adapters.DEFAULT_CA_BUNDLE_PATH=patched_where()