01-arcadia.patch 1.3 KB

1234567891011121314151617181920212223242526272829
  1. --- contrib/python/requests/py2/requests/adapters.py (index)
  2. +++ contrib/python/requests/py2/requests/adapters.py (working tree)
  3. @@ -224,13 +224,13 @@ class HTTPAdapter(BaseAdapter):
  4. if not cert_loc:
  5. cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
  6. - if not cert_loc or not os.path.exists(cert_loc):
  7. + if not cert_loc or isinstance(cert_loc, basestring) and not os.path.exists(cert_loc):
  8. raise IOError("Could not find a suitable TLS CA certificate bundle, "
  9. "invalid path: {}".format(cert_loc))
  10. conn.cert_reqs = 'CERT_REQUIRED'
  11. - if not os.path.isdir(cert_loc):
  12. + if not isinstance(cert_loc, basestring) or not os.path.isdir(cert_loc):
  13. conn.ca_certs = cert_loc
  14. else:
  15. conn.ca_cert_dir = cert_loc
  16. --- contrib/python/requests/py2/requests/utils.py (index)
  17. +++ contrib/python/requests/py2/requests/utils.py (working tree)
  18. @@ -246,7 +246,7 @@ def extract_zipped_paths(path):
  19. archive with the location of an extracted copy of the target, or else
  20. just return the provided path unchanged.
  21. """
  22. - if os.path.exists(path):
  23. + if callable(path) or os.path.exists(path):
  24. # this is already a valid path, no need to do anything further
  25. return path