aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/tornado/tornado-4
diff options
context:
space:
mode:
authormaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 12:29:46 +0300
committermaxim-yurchuk <maxim-yurchuk@yandex-team.com>2024-10-09 13:14:22 +0300
commit9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch)
treea8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/tornado/tornado-4
parenta44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff)
downloadydb-9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80.tar.gz
publishFullContrib: true for ydb
<HIDDEN_URL> commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/tornado/tornado-4')
-rw-r--r--contrib/python/tornado/tornado-4/.yandex_meta/yamaker.yaml4
-rw-r--r--contrib/python/tornado/tornado-4/patches/01-arcadia.patch32
-rw-r--r--contrib/python/tornado/tornado-4/patches/02-support-python-3.10.patch24
-rw-r--r--contrib/python/tornado/tornado-4/patches/03-unknown.patch12
-rw-r--r--contrib/python/tornado/tornado-4/patches/04-support-python-3.12.patch14
5 files changed, 86 insertions, 0 deletions
diff --git a/contrib/python/tornado/tornado-4/.yandex_meta/yamaker.yaml b/contrib/python/tornado/tornado-4/.yandex_meta/yamaker.yaml
new file mode 100644
index 0000000000..98ed28dfe1
--- /dev/null
+++ b/contrib/python/tornado/tornado-4/.yandex_meta/yamaker.yaml
@@ -0,0 +1,4 @@
+requirements:
+- certifi # because of ca bundle
+- backports-abc
+- singledispatch
diff --git a/contrib/python/tornado/tornado-4/patches/01-arcadia.patch b/contrib/python/tornado/tornado-4/patches/01-arcadia.patch
new file mode 100644
index 0000000000..739219ea19
--- /dev/null
+++ b/contrib/python/tornado/tornado-4/patches/01-arcadia.patch
@@ -0,0 +1,32 @@
+--- contrib/python/tornado/tornado-4/tornado/curl_httpclient.py (index)
++++ contrib/python/tornado/tornado-4/tornado/curl_httpclient.py (working tree)
+@@ -364,7 +364,17 @@ class CurlAsyncHTTPClient(AsyncHTTPClient):
+ curl.setopt(pycurl.SSL_VERIFYPEER, 0)
+ curl.setopt(pycurl.SSL_VERIFYHOST, 0)
+ if request.ca_certs is not None:
+- curl.setopt(pycurl.CAINFO, request.ca_certs)
++ cafile, capath, cadata = None, None, None
++ if callable(request.ca_certs):
++ cafile, capath, cadata = request.ca_certs()
++ else:
++ cafile = request.ca_certs
++ if cafile is not None:
++ curl.setopt(pycurl.CAINFO, cafile)
++ if capath is not None:
++ curl.setopt(pycurl.CAPATH, capath)
++ if cadata is not None:
++ curl.set_ca_certs(cadata)
+ else:
+ # There is no way to restore pycurl.CAINFO to its default value
+ # (Using unsetopt makes it reject all certificates).
+--- contrib/python/tornado/tornado-4/tornado/netutil.py (index)
++++ contrib/python/tornado/tornado-4/tornado/netutil.py (working tree)
+@@ -64,6 +64,8 @@ if hasattr(ssl, 'SSLContext'):
+ # of a context is to authentiate the opposite side of the connection.
+ _client_ssl_defaults = ssl.create_default_context(
+ ssl.Purpose.SERVER_AUTH)
++ # load ca certs bundled with binary
++ _client_ssl_defaults.load_verify_locations(certifi.where())
+ _server_ssl_defaults = ssl.create_default_context(
+ ssl.Purpose.CLIENT_AUTH)
+ else:
diff --git a/contrib/python/tornado/tornado-4/patches/02-support-python-3.10.patch b/contrib/python/tornado/tornado-4/patches/02-support-python-3.10.patch
new file mode 100644
index 0000000000..d95d168093
--- /dev/null
+++ b/contrib/python/tornado/tornado-4/patches/02-support-python-3.10.patch
@@ -0,0 +1,24 @@
+--- contrib/python/tornado/tornado-4/tornado/httputil.py (index)
++++ contrib/python/tornado/tornado-4/tornado/httputil.py (working tree)
+@@ -31,6 +31,11 @@ import numbers
+ import re
+ import time
+
++try:
++ from collections.abc import MutableMapping
++except ImportError:
++ from collections import MutableMapping
++
+ from tornado.escape import native_str, parse_qs_bytes, utf8
+ from tornado.log import gen_log
+ from tornado.util import ObjectDict, PY3
+@@ -103,7 +108,7 @@ class _NormalizedHeaderCache(dict):
+ _normalized_headers = _NormalizedHeaderCache(1000)
+
+
+-class HTTPHeaders(collections.MutableMapping):
++class HTTPHeaders(MutableMapping):
+ """A dictionary that maintains ``Http-Header-Case`` for all keys.
+
+ Supports multiple values per key via a pair of new methods,
+ END()
diff --git a/contrib/python/tornado/tornado-4/patches/03-unknown.patch b/contrib/python/tornado/tornado-4/patches/03-unknown.patch
new file mode 100644
index 0000000000..dfac16dddd
--- /dev/null
+++ b/contrib/python/tornado/tornado-4/patches/03-unknown.patch
@@ -0,0 +1,12 @@
+--- contrib/python/tornado/tornado-4/tornado/gen.py (index)
++++ contrib/python/tornado/tornado-4/tornado/gen.py (working tree)
+@@ -914,7 +914,8 @@ def with_timeout(timeout, future, io_loop=None, quiet_exceptions=()):
+ future, exc_info=True)
+
+ def timeout_callback():
+- result.set_exception(TimeoutError("Timeout"))
++ if not result.done():
++ result.set_exception(TimeoutError("Timeout"))
+ # In case the wrapped future goes on to fail, log it.
+ future.add_done_callback(error_callback)
+ timeout_handle = io_loop.add_timeout(
diff --git a/contrib/python/tornado/tornado-4/patches/04-support-python-3.12.patch b/contrib/python/tornado/tornado-4/patches/04-support-python-3.12.patch
new file mode 100644
index 0000000000..5ebbbc662a
--- /dev/null
+++ b/contrib/python/tornado/tornado-4/patches/04-support-python-3.12.patch
@@ -0,0 +1,14 @@
+--- contrib/python/tornado/tornado-4/tornado/netutil.py (index)
++++ contrib/python/tornado/tornado-4/tornado/netutil.py (working tree)
+@@ -47,7 +47,10 @@ except ImportError:
+ if PY3:
+ xrange = range
+
+-if hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+
++if sys.version_info >= (3, 12):
++ ssl_match_hostname = lambda cert, hostname: True
++ SSLCertificateError = ssl.CertificateError
++elif hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+
+ ssl_match_hostname = ssl.match_hostname
+ SSLCertificateError = ssl.CertificateError
+ elif ssl is None: