From: Ben Darnell Date: Sat, 14 Oct 2023 01:27:20 +0000 (-0400) Subject: docs: Update intersphinx references for python 3.12 X-Git-Tag: v6.4.0b1~4^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a60c488cd90210f251b1ad3cf4e0c0597886846;p=thirdparty%2Ftornado.git docs: Update intersphinx references for python 3.12 Intersphinx links are currently an unpinned dependency, so when a new version of python is released it's possible (although relatively rare) for it to break our links. 3.12 removed a few members of the ssl module. --- diff --git a/docs/releases/v3.0.1.rst b/docs/releases/v3.0.1.rst index 4511838c8..4d289f500 100644 --- a/docs/releases/v3.0.1.rst +++ b/docs/releases/v3.0.1.rst @@ -11,7 +11,7 @@ Apr 8, 2013 * The `tornado.testing.gen_test` decorator will no longer be recognized as a (broken) test by ``nose``. * Work around a bug in Ubuntu 13.04 betas involving an incomplete backport - of the `ssl.match_hostname` function. + of the ``ssl.match_hostname`` function. * `tornado.websocket.websocket_connect` now fails cleanly when it attempts to connect to a non-websocket url. * ``tornado.testing.LogTrapTestCase`` once again works with byte strings diff --git a/docs/releases/v5.0.0.rst b/docs/releases/v5.0.0.rst index dd0bd0243..950b2e173 100644 --- a/docs/releases/v5.0.0.rst +++ b/docs/releases/v5.0.0.rst @@ -27,7 +27,7 @@ Backwards-compatibility notes longer supported. (The `ssl` module was updated in version 2.7.9, although in some distributions the updates are present in builds with a lower version number. Tornado requires `ssl.SSLContext`, - `ssl.create_default_context`, and `ssl.match_hostname`) + `ssl.create_default_context`, and ``ssl.match_hostname``) - Versions of Python 3.5 prior to 3.5.2 are no longer supported due to a change in the async iterator protocol in that version. - The ``trollius`` project (`asyncio` backported to Python 2) is no diff --git a/tornado/httpserver.py b/tornado/httpserver.py index 77dc541e9..757f711b2 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -74,7 +74,7 @@ class HTTPServer(TCPServer, Configurable, httputil.HTTPServerConnectionDelegate) To make this server serve SSL traffic, send the ``ssl_options`` keyword argument with an `ssl.SSLContext` object. For compatibility with older versions of Python ``ssl_options`` may also be a dictionary of keyword - arguments for the `ssl.wrap_socket` method.:: + arguments for the `ssl.SSLContext.wrap_socket` method.:: ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_ctx.load_cert_chain(os.path.join(data_dir, "mydomain.crt"), diff --git a/tornado/iostream.py b/tornado/iostream.py index a408be59c..0305370a8 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -1217,7 +1217,7 @@ class IOStream(BaseIOStream): The ``ssl_options`` argument may be either an `ssl.SSLContext` object or a dictionary of keyword arguments for the - `ssl.wrap_socket` function. The ``server_hostname`` argument + `ssl.SSLContext.wrap_socket` function. The ``server_hostname`` argument will be used for certificate validation unless disabled in the ``ssl_options``. @@ -1322,7 +1322,7 @@ class SSLIOStream(IOStream): If the socket passed to the constructor is already connected, it should be wrapped with:: - ssl.wrap_socket(sock, do_handshake_on_connect=False, **kwargs) + ssl.SSLContext(...).wrap_socket(sock, do_handshake_on_connect=False, **kwargs) before constructing the `SSLIOStream`. Unconnected sockets will be wrapped when `IOStream.connect` is finished. @@ -1333,7 +1333,7 @@ class SSLIOStream(IOStream): def __init__(self, *args: Any, **kwargs: Any) -> None: """The ``ssl_options`` keyword argument may either be an `ssl.SSLContext` object or a dictionary of keywords arguments - for `ssl.wrap_socket` + for `ssl.SSLContext.wrap_socket` """ self._ssl_options = kwargs.pop("ssl_options", _client_ssl_defaults) super().__init__(*args, **kwargs) diff --git a/tornado/netutil.py b/tornado/netutil.py index 04db085ab..be7b55373 100644 --- a/tornado/netutil.py +++ b/tornado/netutil.py @@ -594,7 +594,7 @@ def ssl_options_to_context( `~ssl.SSLContext` object. The ``ssl_options`` dictionary contains keywords to be passed to - `ssl.wrap_socket`. In Python 2.7.9+, `ssl.SSLContext` objects can + ``ssl.SSLContext.wrap_socket``. In Python 2.7.9+, `ssl.SSLContext` objects can be used instead. This function converts the dict form to its `~ssl.SSLContext` equivalent, and may be used when a component which accepts both forms needs to upgrade to the `~ssl.SSLContext` version @@ -652,9 +652,7 @@ def ssl_wrap_socket( ``ssl_options`` may be either an `ssl.SSLContext` object or a dictionary (as accepted by `ssl_options_to_context`). Additional - keyword arguments are passed to ``wrap_socket`` (either the - `~ssl.SSLContext` method or the `ssl` module function as - appropriate). + keyword arguments are passed to `ssl.SSLContext.wrap_socket`. .. versionchanged:: 6.2 diff --git a/tornado/tcpserver.py b/tornado/tcpserver.py index deab8f2ad..02c0ca0cc 100644 --- a/tornado/tcpserver.py +++ b/tornado/tcpserver.py @@ -61,7 +61,7 @@ class TCPServer(object): To make this server serve SSL traffic, send the ``ssl_options`` keyword argument with an `ssl.SSLContext` object. For compatibility with older versions of Python ``ssl_options`` may also be a dictionary of keyword - arguments for the `ssl.wrap_socket` method.:: + arguments for the `ssl.SSLContext.wrap_socket` method.:: ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) ssl_ctx.load_cert_chain(os.path.join(data_dir, "mydomain.crt"),