1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00
django/django/template
Jon Dufresne 9e38ed0536 Fixed #27486 -- Fixed Python 3.7 DeprecationWarning in intword and filesizeformat filters.
intword and filesizeformat passed floats to ngettext() which is
deprecated in Python 3.7. The rationale for this warning is documented
in BPO-28692: https://bugs.python.org/issue28692.

For filesizeformat, the filesize value is expected to be an int -- it
fills %d string formatting placeholders. It was likely coerced to a
float to ensure floating point division on Python 2. Python 3 always
does floating point division, so coerce to an int instead of a float to
fix the warning.

For intword, the number may contain a decimal component. In English, a
decimal component makes the noun plural. A helper function,
round_away_from_one(), was added to convert the float to an integer that
is appropriate for ngettext().
2019-06-11 20:34:59 +02:00
..
backends Refs #27753 -- Favored SafeString over SafeText. 2019-02-06 14:12:06 -05:00
loaders Removed template_cache attribute from cached template loader. 2019-01-18 18:35:00 -05:00
__init__.py
base.py Removed unnecessary line in DebugLexer.tokenize(). 2019-05-07 13:34:05 +02:00
context_processors.py Replaced temporary lists used for passing arguments with iterables. 2017-04-26 10:54:20 -04:00
context.py Simplified BaseContext.__iter__(). 2018-07-11 09:12:50 -04:00
defaultfilters.py Fixed #27486 -- Fixed Python 3.7 DeprecationWarning in intword and filesizeformat filters. 2019-06-11 20:34:59 +02:00
defaulttags.py Used 4 space hanging indent for dictionaries. 2019-01-02 18:18:19 -05:00
engine.py Fixed #29791 -- Made Engine.render_to_string() honor autoescape. 2019-03-25 17:59:07 -04:00
exceptions.py
library.py Fixed #30453 -- Fixed crash of simple_tag() and inclusion_tag() when function is wrapped. 2019-05-17 09:53:24 +02:00
loader_tags.py Merged startswith() calls. 2017-09-25 09:18:29 -04:00
loader.py
response.py Removed unnecessary assignments in various code. 2019-04-24 13:09:29 +02:00
smartif.py
utils.py Fixed #30159 -- Removed unneeded use of OrderedDict. 2019-02-06 13:48:39 -05:00