01-arcadia.patch 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. --- contrib/python/requests/py3/requests/adapters.py (index)
  2. +++ contrib/python/requests/py3/requests/adapters.py (working tree)
  3. @@ -259,7 +259,7 @@ 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 OSError(
  9. f"Could not find a suitable TLS CA certificate bundle, "
  10. f"invalid path: {cert_loc}"
  11. @@ -267,7 +267,7 @@ class HTTPAdapter(BaseAdapter):
  12. conn.cert_reqs = "CERT_REQUIRED"
  13. - if not os.path.isdir(cert_loc):
  14. + if not isinstance(cert_loc, basestring) or not os.path.isdir(cert_loc):
  15. conn.ca_certs = cert_loc
  16. else:
  17. conn.ca_cert_dir = cert_loc
  18. --- contrib/python/requests/py3/requests/utils.py (index)
  19. +++ contrib/python/requests/py3/requests/utils.py (working tree)
  20. @@ -260,7 +260,7 @@ def extract_zipped_paths(path):
  21. archive with the location of an extracted copy of the target, or else
  22. just return the provided path unchanged.
  23. """
  24. - if os.path.exists(path):
  25. + if callable(path) or os.path.exists(path):
  26. # this is already a valid path, no need to do anything further
  27. return path