From e0947836dcd7aca50ad2501c30f5eee7e0c69923 Mon Sep 17 00:00:00 2001 From: mokashang Date: Mon, 11 May 2026 23:49:55 -0700 Subject: [PATCH] docs: fix typos in comments and documentation Corrects nine misspellings found in source code comments, docstrings, and Sphinx documentation. No runtime behavior is changed. - docs/guide/intro.rst: implementions -> implementations - docs/guide/structure.rst: asynchronus -> asynchronous - tornado/auth.py: verfication -> verification - tornado/escape.py: Equvalent -> Equivalent; entites -> entities - tornado/httputil.py: vaildation -> validation - tornado/platform/asyncio.py: presense -> presence - tornado/test/httputil_test.py: unamed -> unnamed - tornado/web.py: presense -> presence --- docs/guide/intro.rst | 2 +- docs/guide/structure.rst | 2 +- tornado/auth.py | 2 +- tornado/escape.py | 4 ++-- tornado/httputil.py | 2 +- tornado/platform/asyncio.py | 2 +- tornado/test/httputil_test.py | 2 +- tornado/web.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/guide/intro.rst b/docs/guide/intro.rst index 2684c3890e..324fdd7041 100644 --- a/docs/guide/intro.rst +++ b/docs/guide/intro.rst @@ -13,7 +13,7 @@ Tornado can be roughly divided into three major components: * A web framework (including `.RequestHandler` which is subclassed to create web applications, and various supporting classes). -* Client- and server-side implementions of HTTP (`.HTTPServer` and +* Client- and server-side implementations of HTTP (`.HTTPServer` and `.AsyncHTTPClient`). * An asynchronous networking library including the classes `.IOLoop` and `.IOStream`, which serve as the building blocks for the HTTP diff --git a/docs/guide/structure.rst b/docs/guide/structure.rst index 100ad6bb5f..f3c23996c2 100644 --- a/docs/guide/structure.rst +++ b/docs/guide/structure.rst @@ -50,7 +50,7 @@ Python.) When the ``main`` function returns, the program exits, so most of the time for a web server ``main`` should run forever. Waiting on an `asyncio.Event` whose -``set()`` method is never called is a convenient way to make an asynchronus +``set()`` method is never called is a convenient way to make an asynchronous function run forever. (and if you wish to have ``main`` exit early as a part of a graceful shutdown procedure, you can call ``shutdown_event.set()`` to make it exit). diff --git a/tornado/auth.py b/tornado/auth.py index 977433211e..94a6c50c14 100644 --- a/tornado/auth.py +++ b/tornado/auth.py @@ -855,7 +855,7 @@ class GoogleOAuth2Mixin(OAuth2Mixin): * Select a project, or create a new one. * Depending on permissions required, you may need to set your app to "testing" mode and add your account as a test user, or go through - a verfication process. You may also need to use the "Enable + a verification process. You may also need to use the "Enable APIs and Services" command to enable specific services. * In the sidebar on the left, select Credentials. * Click CREATE CREDENTIALS and click OAuth client ID. diff --git a/tornado/escape.py b/tornado/escape.py index a75aff11ff..1241c9f92f 100644 --- a/tornado/escape.py +++ b/tornado/escape.py @@ -99,7 +99,7 @@ def json_encode(value: Any) -> str: def json_decode(value: str | bytes) -> Any: """Returns Python objects for the given JSON string. - Supports both `str` and `bytes` inputs. Equvalent to `json.loads`. + Supports both `str` and `bytes` inputs. Equivalent to `json.loads`. """ return json.loads(value) @@ -393,7 +393,7 @@ def make_link(m: typing.Match) -> str: return f'{url}' # First HTML-escape so that our strings are all safe. - # The regex is modified to avoid character entites other than & so + # The regex is modified to avoid character entities other than & so # that we won't pick up ", etc. text = _unicode(xhtml_escape(text)) return _URL_RE.sub(make_link, text) diff --git a/tornado/httputil.py b/tornado/httputil.py index 2936e61b71..d91a7c176e 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -73,7 +73,7 @@ class _ABNF: """ # RFC 3986 (URI) - # The URI hostname ABNF is both complex (including detailed vaildation of IPv4 and IPv6 + # The URI hostname ABNF is both complex (including detailed validation of IPv4 and IPv6 # literals) and not strict enough (a lot of punctuation is allowed by the ABNF even though # it is not allowed by DNS). We simplify it by allowing square brackets and colons in any # position, not only for their use in IPv6 literals. diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py index dbbd92de5f..b7b63d199a 100644 --- a/tornado/platform/asyncio.py +++ b/tornado/platform/asyncio.py @@ -533,7 +533,7 @@ async def _thread_manager(self) -> typing.AsyncGenerator[None, None]: self._thread.start() self._start_select() try: - # The presense of this yield statement means that this coroutine + # The presence of this yield statement means that this coroutine # is actually an asynchronous generator, which has a special # shutdown protocol. We wait at this yield point until the # event loop's shutdown_asyncgens method is called, at which point diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index cca2933ba5..8732fee28a 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -666,7 +666,7 @@ def test_invalid_cookies(self): "django_language", parse_cookie("abc=def; unnamed; django_language=en").keys(), ) - # Even a double quote may be an unamed value. + # Even a double quote may be an unnamed value. self.assertEqual(parse_cookie('a=b; "; c=d'), {"a": "b", "": '"', "c": "d"}) # Spaces in names and values, and an equals sign in values. self.assertEqual( diff --git a/tornado/web.py b/tornado/web.py index 39a060f685..b572beac06 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -720,7 +720,7 @@ def set_cookie( # Note change from _ to -. morsel["max-age"] = str(max_age) if httponly: - # Note that SimpleCookie ignores the value here. The presense of an + # Note that SimpleCookie ignores the value here. The presence of an # httponly (or secure) key is treated as true. morsel["httponly"] = True if secure: