From 3803ee3560f8ccaadef4d95facbc4ef37ee69682 Mon Sep 17 00:00:00 2001 From: robot-piglet <robot-piglet@yandex-team.com> Date: Thu, 6 Feb 2025 20:34:10 +0300 Subject: Intermediate changes commit_hash:24c62f23164ce9c621538d8c097b568a8a9d89fc --- .../python/requests/py3/patches/01-arcadia.patch | 24 ++++++---------------- .../requests/py3/patches/02-hack-for-gevent.patch | 12 +++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 contrib/python/requests/py3/patches/02-hack-for-gevent.patch (limited to 'contrib/python/requests/py3/patches') diff --git a/contrib/python/requests/py3/patches/01-arcadia.patch b/contrib/python/requests/py3/patches/01-arcadia.patch index 30b2617ba9..999df2aaa6 100644 --- a/contrib/python/requests/py3/patches/01-arcadia.patch +++ b/contrib/python/requests/py3/patches/01-arcadia.patch @@ -1,23 +1,11 @@ --- contrib/python/requests/py3/requests/adapters.py (index) +++ contrib/python/requests/py3/requests/adapters.py (working tree) -@@ -259,7 +259,7 @@ class HTTPAdapter(BaseAdapter): - if not cert_loc: - cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) - -- if not cert_loc or not os.path.exists(cert_loc): -+ if not cert_loc or isinstance(cert_loc, basestring) and not os.path.exists(cert_loc): - raise OSError( - f"Could not find a suitable TLS CA certificate bundle, " - f"invalid path: {cert_loc}" -@@ -267,7 +267,7 @@ class HTTPAdapter(BaseAdapter): - - conn.cert_reqs = "CERT_REQUIRED" - -- if not os.path.isdir(cert_loc): -+ if not isinstance(cert_loc, basestring) or not os.path.isdir(cert_loc): - conn.ca_certs = cert_loc - else: - conn.ca_cert_dir = cert_loc +@@ -259,1 +259,1 @@ class HTTPAdapter(BaseAdapter): +- if not os.path.exists(cert_loc): ++ if isinstance(cert_loc, str) and not os.path.exists(cert_loc): +@@ -267,1 +267,1 @@ class HTTPAdapter(BaseAdapter): +- if not os.path.isdir(cert_loc): ++ if not isinstance(cert_loc, str) or not os.path.isdir(cert_loc): --- contrib/python/requests/py3/requests/utils.py (index) +++ contrib/python/requests/py3/requests/utils.py (working tree) @@ -260,7 +260,7 @@ def extract_zipped_paths(path): diff --git a/contrib/python/requests/py3/patches/02-hack-for-gevent.patch b/contrib/python/requests/py3/patches/02-hack-for-gevent.patch new file mode 100644 index 0000000000..b7eea5be8b --- /dev/null +++ b/contrib/python/requests/py3/patches/02-hack-for-gevent.patch @@ -0,0 +1,12 @@ +--- contrib/python/requests/py3/requests/adapters.py (index) ++++ contrib/python/requests/py3/requests/adapters.py (working tree) +@@ -76,7 +76,8 @@ DEFAULT_POOL_TIMEOUT = None + + try: + import ssl # noqa: F401 +- ++ import urllib3.util.ssl_ ++ urllib3.util.ssl_.SSLContext = ssl.SSLContext + _preloaded_ssl_context = create_urllib3_context() + _preloaded_ssl_context.load_verify_locations( + extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH) -- cgit v1.2.3