From 69b0736fad1d1f0197409ca025b7bcdf5666ae62 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 18 Oct 2021 17:06:00 +0100 Subject: [PATCH] Refs #32956 -- Changed docs to treat the acronym HTTP phonetically. --- django/core/handlers/asgi.py | 2 +- django/shortcuts.py | 6 +++--- django/test/client.py | 2 +- docs/internals/contributing/writing-documentation.txt | 3 +++ docs/ref/class-based-views/base.txt | 4 ++-- docs/ref/exceptions.txt | 2 +- docs/ref/settings.txt | 2 +- docs/releases/1.3.txt | 2 +- docs/topics/class-based-views/mixins.txt | 2 +- docs/topics/testing/tools.txt | 2 +- tests/generic_views/test_base.py | 5 +++-- tests/get_object_or_404/tests.py | 6 +++--- tests/servers/tests.py | 2 +- 13 files changed, 22 insertions(+), 18 deletions(-) diff --git a/django/core/handlers/asgi.py b/django/core/handlers/asgi.py index 2b8cc8b76e..9d84efc964 100644 --- a/django/core/handlers/asgi.py +++ b/django/core/handlers/asgi.py @@ -176,7 +176,7 @@ class ASGIHandler(base.BaseHandler): await self.send_response(response, send) async def read_body(self, receive): - """Reads a HTTP body from an ASGI connection.""" + """Reads an HTTP body from an ASGI connection.""" # Use the tempfile that auto rolls-over to a disk file as it fills up. body_file = tempfile.SpooledTemporaryFile(max_size=settings.FILE_UPLOAD_MAX_MEMORY_SIZE, mode='w+b') while True: diff --git a/django/shortcuts.py b/django/shortcuts.py index d810471640..9d213bc1ff 100644 --- a/django/shortcuts.py +++ b/django/shortcuts.py @@ -13,7 +13,7 @@ from django.utils.functional import Promise def render(request, template_name, context=None, content_type=None, status=None, using=None): """ - Return a HttpResponse whose content is filled with the result of calling + Return an HttpResponse whose content is filled with the result of calling django.template.loader.render_to_string() with the passed arguments. """ content = loader.render_to_string(template_name, context, request, using=using) @@ -56,7 +56,7 @@ def _get_queryset(klass): def get_object_or_404(klass, *args, **kwargs): """ - Use get() to return an object, or raise a Http404 exception if the object + Use get() to return an object, or raise an Http404 exception if the object does not exist. klass may be a Model, Manager, or QuerySet object. All other passed @@ -80,7 +80,7 @@ def get_object_or_404(klass, *args, **kwargs): def get_list_or_404(klass, *args, **kwargs): """ - Use filter() to return a list of objects, or raise a Http404 exception if + Use filter() to return a list of objects, or raise an Http404 exception if the list is empty. klass may be a Model, Manager, or QuerySet object. All other passed diff --git a/django/test/client.py b/django/test/client.py index c65e07ce7e..560f994876 100644 --- a/django/test/client.py +++ b/django/test/client.py @@ -117,7 +117,7 @@ def conditional_content_removal(request, response): class ClientHandler(BaseHandler): """ - A HTTP Handler that can be used for testing purposes. Use the WSGI + An HTTP Handler that can be used for testing purposes. Use the WSGI interface to compose requests, but return the raw HttpResponse object with the originating WSGIRequest attached to its ``wsgi_request`` attribute. """ diff --git a/docs/internals/contributing/writing-documentation.txt b/docs/internals/contributing/writing-documentation.txt index e409b7fcc7..9ea20d0095 100644 --- a/docs/internals/contributing/writing-documentation.txt +++ b/docs/internals/contributing/writing-documentation.txt @@ -146,6 +146,9 @@ documentation: * **email** -- no hyphen. +* **HTTP** -- the expected pronunciation is "Aitch Tee Tee Pee" and therefore + should be preceded by "an" and not "a". + * **MySQL**, **PostgreSQL**, **SQLite** * **SQL** -- when referring to SQL, the expected pronunciation should be diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt index e64fc03555..324a28fcd3 100644 --- a/docs/ref/class-based-views/base.txt +++ b/docs/ref/class-based-views/base.txt @@ -86,7 +86,7 @@ MRO is an acronym for Method Resolution Order. .. method:: dispatch(request, *args, **kwargs) The ``view`` part of the view -- the method that accepts a ``request`` - argument plus arguments, and returns a HTTP response. + argument plus arguments, and returns an HTTP response. The default implementation will inspect the HTTP method and attempt to delegate to a method that matches the HTTP method; a ``GET`` will be @@ -99,7 +99,7 @@ MRO is an acronym for Method Resolution Order. .. method:: http_method_not_allowed(request, *args, **kwargs) - If the view was called with a HTTP method it doesn't support, this + If the view was called with an HTTP method it doesn't support, this method is called instead. The default implementation returns ``HttpResponseNotAllowed`` with a diff --git a/docs/ref/exceptions.txt b/docs/ref/exceptions.txt index 0355dd5280..5bd856e8ca 100644 --- a/docs/ref/exceptions.txt +++ b/docs/ref/exceptions.txt @@ -177,7 +177,7 @@ list of errors. .. exception:: RequestAborted - The :exc:`RequestAborted` exception is raised when a HTTP body being read + The :exc:`RequestAborted` exception is raised when an HTTP body being read in by the handler is cut off midstream and the client connection closes, or when the client does not send data and hits a timeout where the server closes the connection. diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 8acd42afe6..2a6f082842 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -2343,7 +2343,7 @@ already have it. Default: ``None`` -A tuple representing a HTTP header/value combination that signifies a request +A tuple representing an HTTP header/value combination that signifies a request is secure. This controls the behavior of the request object's ``is_secure()`` method. diff --git a/docs/releases/1.3.txt b/docs/releases/1.3.txt index 3d381ca8ac..6bc723ec02 100644 --- a/docs/releases/1.3.txt +++ b/docs/releases/1.3.txt @@ -81,7 +81,7 @@ Django 1.3 adds framework-level support for Python's ``logging`` module. This means you can now easily configure and control logging as part of your Django project. A number of logging handlers and logging calls have been added to Django's own code as well -- most -notably, the error emails sent on a HTTP 500 server error are now +notably, the error emails sent on an HTTP 500 server error are now handled as a logging activity. See :doc:`the documentation on Django's logging interface ` for more details. diff --git a/docs/topics/class-based-views/mixins.txt b/docs/topics/class-based-views/mixins.txt index 7b193ea7f0..08a1ec1af9 100644 --- a/docs/topics/class-based-views/mixins.txt +++ b/docs/topics/class-based-views/mixins.txt @@ -653,7 +653,7 @@ same behavior -- except for the format of the response. If you want to be really adventurous, you could even mix a :class:`~django.views.generic.detail.DetailView` subclass that is able to return *both* HTML and JSON content, depending on some property of -the HTTP request, such as a query argument or a HTTP header. Mix in both the +the HTTP request, such as a query argument or an HTTP header. Mix in both the ``JSONResponseMixin`` and a :class:`~django.views.generic.detail.SingleObjectTemplateResponseMixin`, and override the implementation of diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt index 40789b98fa..3d955503b1 100644 --- a/docs/topics/testing/tools.txt +++ b/docs/topics/testing/tools.txt @@ -717,7 +717,7 @@ A subclass of :class:`unittest.TestCase` that adds this functionality: * Verifying that a template :meth:`has/hasn't been used to generate a given response content `. * Verifying that two :meth:`URLs ` are equal. - * Verifying a HTTP :meth:`redirect ` is + * Verifying an HTTP :meth:`redirect ` is performed by the app. * Robustly testing two :meth:`HTML fragments ` for equality/inequality or :meth:`containment `. diff --git a/tests/generic_views/test_base.py b/tests/generic_views/test_base.py index 5872ecf3db..661b9941ea 100644 --- a/tests/generic_views/test_base.py +++ b/tests/generic_views/test_base.py @@ -89,7 +89,8 @@ class ViewTest(SimpleTestCase): def test_pathological_http_method(self): """ - The edge case of a http request that spoofs an existing method name is caught. + The edge case of an http request that spoofs an existing method name is + caught. """ self.assertEqual(SimpleView.as_view()( self.rf.get('/', REQUEST_METHOD='DISPATCH') @@ -140,7 +141,7 @@ class ViewTest(SimpleTestCase): def test_invalid_keyword_argument(self): """ View arguments must be predefined on the class and can't - be named like a HTTP method. + be named like an HTTP method. """ msg = ( 'The method name %s is not accepted as a keyword argument to ' diff --git a/tests/get_object_or_404/tests.py b/tests/get_object_or_404/tests.py index 075f9a08e1..71815d34ef 100644 --- a/tests/get_object_or_404/tests.py +++ b/tests/get_object_or_404/tests.py @@ -10,7 +10,7 @@ class GetObjectOr404Tests(TestCase): a1 = Author.objects.create(name="Brave Sir Robin") a2 = Author.objects.create(name="Patsy") - # No Articles yet, so we should get a Http404 error. + # No Articles yet, so we should get an Http404 error. with self.assertRaises(Http404): get_object_or_404(Article, title="Foo") @@ -28,7 +28,7 @@ class GetObjectOr404Tests(TestCase): article ) - # No articles containing "Camelot". This should raise a Http404 error. + # No articles containing "Camelot". This should raise an Http404 error. with self.assertRaises(Http404): get_object_or_404(a1.article_set, title__contains="Camelot") @@ -50,7 +50,7 @@ class GetObjectOr404Tests(TestCase): with self.assertRaises(Author.MultipleObjectsReturned): get_object_or_404(Author.objects.all()) - # Using an empty QuerySet raises a Http404 error. + # Using an empty QuerySet raises an Http404 error. with self.assertRaises(Http404): get_object_or_404(Article.objects.none(), title__contains="Run") diff --git a/tests/servers/tests.py b/tests/servers/tests.py index c4b8298fd8..8f21f85918 100644 --- a/tests/servers/tests.py +++ b/tests/servers/tests.py @@ -173,7 +173,7 @@ class LiveServerViews(LiveServerBase): def test_closes_connection_without_content_length(self): """ - A HTTP 1.1 server is supposed to support keep-alive. Since our + An HTTP 1.1 server is supposed to support keep-alive. Since our development server is rather simple we support it only in cases where we can detect a content length from the response. This should be doable for all simple views and streaming responses where an iterable with