diff options
| author | django-bot <ops@djangoproject.com> | 2025-07-22 20:41:41 -0700 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2025-07-23 20:17:55 -0300 |
| commit | 69a93a88edb56ba47f624dac7a21aacc47ea474f (patch) | |
| tree | f57507a4435d032493cae40e06ecb254790b67b2 /django/http | |
| parent | 55b0cc21310b76ce4018dd793ba50556eaf0af06 (diff) | |
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/multipartparser.py | 7 | ||||
| -rw-r--r-- | django/http/request.py | 27 | ||||
| -rw-r--r-- | django/http/response.py | 3 |
3 files changed, 24 insertions, 13 deletions
diff --git a/django/http/multipartparser.py b/django/http/multipartparser.py index 4ee8401eb6..531f9a0468 100644 --- a/django/http/multipartparser.py +++ b/django/http/multipartparser.py @@ -168,7 +168,8 @@ class MultiPartParser: # Instantiate the parser and stream: stream = LazyStream(ChunkIter(self._input_data, self._chunk_size)) - # Whether or not to signal a file-completion at the beginning of the loop. + # Whether or not to signal a file-completion at the beginning of the + # loop. old_field_name = None counters = [0] * len(handlers) @@ -418,8 +419,8 @@ class LazyStream: The LazyStream wrapper allows one to get and "unget" bytes from a stream. Given a producer object (an iterator that yields bytestrings), the - LazyStream object will support iteration, reading, and keeping a "look-back" - variable in case you need to "unget" some bytes. + LazyStream object will support iteration, reading, and keeping a + "look-back" variable in case you need to "unget" some bytes. """ def __init__(self, producer, length=None): diff --git a/django/http/request.py b/django/http/request.py index ff5974770f..c8adde768d 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -90,7 +90,9 @@ class HttpRequest: @cached_property def accepted_types(self): - """Return a list of MediaType instances, in order of preference (quality).""" + """ + Return a list of MediaType instances, in order of preference (quality). + """ header_value = self.headers.get("Accept", "*/*") return sorted( ( @@ -105,7 +107,8 @@ class HttpRequest: @cached_property def accepted_types_by_precedence(self): """ - Return a list of MediaType instances, in order of precedence (specificity). + Return a list of MediaType instances, in order of precedence + (specificity). """ return sorted( self.accepted_types, @@ -347,7 +350,8 @@ class HttpRequest: @property def upload_handlers(self): if not self._upload_handlers: - # If there are no upload handlers defined, initialize them from settings. + # If there are no upload handlers defined, initialize them from + # settings. self._initialize_handlers() return self._upload_handlers @@ -380,7 +384,8 @@ class HttpRequest: "You cannot access body after reading from request's data stream" ) - # Limit the maximum request data size that will be handled in-memory. + # Limit the maximum request data size that will be handled + # in-memory. if ( settings.DATA_UPLOAD_MAX_MEMORY_SIZE is not None and int(self.META.get("CONTENT_LENGTH") or 0) @@ -404,7 +409,9 @@ class HttpRequest: self._files = MultiValueDict() def _load_post_and_files(self): - """Populate self._post and self._files if the content-type is a form type""" + """ + Populate self._post and self._files if the content-type is a form type + """ if self.method != "POST": self._post, self._files = ( QueryDict(encoding=self._encoding), @@ -543,8 +550,8 @@ class QueryDict(MultiValueDict): By default QueryDicts are immutable, though the copy() method will always return a mutable copy. - Both keys and values set on this class are converted from the given encoding - (DEFAULT_CHARSET by default) to str. + Both keys and values set on this class are converted from the given + encoding (DEFAULT_CHARSET by default) to str. """ # These are both reset in __init__, but is specified here at the class @@ -562,7 +569,8 @@ class QueryDict(MultiValueDict): "max_num_fields": settings.DATA_UPLOAD_MAX_NUMBER_FIELDS, } if isinstance(query_string, bytes): - # query_string normally contains URL-encoded data, a subset of ASCII. + # query_string normally contains URL-encoded data, a subset of + # ASCII. try: query_string = query_string.decode(self.encoding) except UnicodeDecodeError: @@ -747,7 +755,8 @@ class MediaType: return False if bool(self.range_params) == bool(other.range_params): - # If both have params or neither have params, they must be identical. + # If both have params or neither have params, they must be + # identical. result = self.range_params == other.range_params else: # If self has params and other does not, it's a match. diff --git a/django/http/response.py b/django/http/response.py index 6d09bc87e2..40b2d7089d 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -323,7 +323,8 @@ class HttpResponseBase: # See https://docs.python.org/library/io.html#io.IOBase # The WSGI server must call this method upon completion of the request. - # See http://blog.dscpl.com.au/2012/10/obligations-for-calling-close-on.html + # See + # http://blog.dscpl.com.au/2012/10/obligations-for-calling-close-on.html def close(self): for closer in self._resource_closers: try: |
