| Age | Commit message (Collapse) | Author |
|
Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.
https://github.com/psf/black/releases/tag/23.1.0
Backport of 097e3a70c1481ee7b042b2edd91b2be86fb7b5b6 from main
|
|
Accept-Language.
The parsed values of Accept-Language headers are cached in order to
avoid repetitive parsing. This leads to a potential denial-of-service
vector via excessive memory usage if the raw value of Accept-Language
headers is very large.
Accept-Language headers are now limited to a maximum length in order
to avoid this issue.
|
|
Plural value must be an integer.
Regression in 8d67e16493c903adc9d049141028bc0fff43f8c8.
|
|
interval longer than 1 month.
Regression in 8d67e16493c903adc9d049141028bc0fff43f8c8.
|
|
Instead of the separate property, we can just not set self.timezone if
the datetime is ambiguous or imaginary. This ensures that this check
will only ever happen once as it's dependant on the datetime object and
not the format string characters.
|
|
|
|
O() - we should try to avoid calling specifier methods from each other
to avoid extra function call overhead. In addition we end up, in this
case, duplicating the ambiguous/imaginary datetime checks. We're also
going to be looking at simplifying things by having all of these
specifier methods return strings and not an random mix of types.
t() - the value can only be one of 28, 29, 30, or 31. As such, there is
no need to zero-pad to a width of two.
|
|
Avoid extra attribute lookup in specifier methods, etc. by importing
classes from datetime directly.
|
|
This removes redundant get_format() calls and passing a default value
for the format argument.
|
|
|
|
Thanks to Florian Vazelle for initial exploratory work, and to Nick
Pope and Mariusz Felisiak for review.
|
|
Thanks to Mariusz Felisiak for review.
|
|
|
|
|
|
- Updated references to RFC 1123 to RFC 5322
- Only partial as RFC 5322 sort of sub-references RFC 1123.
- Updated references to RFC 2388 to RFC 7578
- Except RFC 2388 Section 5.3 which has no equivalent.
- Updated references to RFC 2396 to RFC 3986
- Updated references to RFC 2616 to RFC 9110
- Updated references to RFC 3066 to RFC 5646
- Updated references to RFC 7230 to RFC 9112
- Updated references to RFC 7231 to RFC 9110
- Updated references to RFC 7232 to RFC 9110
- Updated references to RFC 7234 to RFC 9111
- Tidied up style of text when referring to RFC documents
|
|
Identified using the following command:
$ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
|
|
i18n patterns are used.
|
|
|
|
|
|
This is checked at startup in get_reloader(). The runtime check ties
the implementation to Watchman excessively.
|
|
Node.create() which has a compatible signature with Node.__init__()
takes in a single `children` argument rather than relying in unpacking
*args in Q.__init__() which calls Node.__init__().
In addition, we were often needing to unpack iterables into *args and
can instead pass a list direct to Node.create().
|
|
This allows the copy.copy() usage in the Q._combine() method to finish
sooner, instead of having to fallback to using the __reduce_ex__(4)
method.
Thia also avoids having to fall into copy.copy() at in Q._combine(),
when combining a Q() with another Q().
Co-authored-by: Keryn Knight <keryn@kerynknight.com>
|
|
We can use copy() in Node.add() instead of create() as we don't need the
children to be cloned via [:] subscript in __init__().
|
|
Node._new_instance() was added in
6dd2b5468fa275d53aa60fdcaff8c28bdc5e9c25 to work around Q.__init__()
having an incompatible signature with Node.__init__().
It was intended as a hook that could be overridden if subclasses needed
to change the behaviour of instantiation of their specialised form of
Node. In practice this doesn't ever seem to have been used for this
purpose and there are very few calls to Node._new_instance() with other
code, e.g. Node.__deepcopy__() calling Node and overriding __class__ as
required.
Rename this to Node.create() to make it a more "official" piece of
private API that we can use to simplify a lot of other areas internally.
The docstring and nearby comment have been reworded to read more
clearly.
|
|
DeprecationForHistoricalMigrationMixin."
This reverts commit 57793b47657ace966ce8ce96d801ac0d85e5efc6.
|
|
|
|
Refs Python CVE-2022-0391. Django is not affected, but others who
incorrectly use internal function url_has_allowed_host_and_scheme()
with unsanitized input could be at risk.
|
|
django.utils.html.json_script().
|
|
boundary streams.
This also removes unused parse_header() and _parse_header_params()
helpers in django.http.multipartparser.
|
|
Thank you Daniel Samuels for test project.
|
|
Regression in 659d2421c7adbbcd205604002d521d82d6b0b465.
|
|
@wraps is 10 times more common than @functools.wraps. Standardize to
the most common version.
|
|
All these functions are wrapping another function. They're the wrapper,
while the function they're wrapping is the wrapped.
|
|
|
|
|
|
https://peps.python.org/pep-0594/#cgi
|
|
|
|
|
|
Remaining test case ensures that uses of the alias are mapped
canonically by the migration writer.
|
|
|
|
Co-authored-by: Valz <ahmadahussein0@gmail.com>
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
|
|
locale.getdefaultlocale() was deprecated in Python 3.11, see
https://bugs.python.org/issue46659.
|
|
This avoids an extra __getattribute__() call for self._wrapped.
|
|
Internal usages of this class (e.g. HttpHeaders) provide it with a dict,
so testing for that type first avoids the cost of going through the
potential __instancecheck__ + _abc_instancecheck to establish it's
a Mapping.
Co-authored-by: Nick Pope <nick@nickpope.me.uk>
|
|
|
|
|
|
|
|
|
|
|
|
Regression in 97d7990abde3fe4b525ae83958fd0b52d6a1d13f.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
|