django1/django/contrib/humanize
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
..
locale Updated contrib translations from Transifex. 2019-04-01 12:22:15 +02:00
templatetags Fixed #27486 -- Fixed Python 3.7 DeprecationWarning in intword and filesizeformat filters. 2019-06-11 20:34:59 +02:00
__init__.py Fixed #21829 -- Added default AppConfigs. 2014-01-25 10:41:56 +01:00
apps.py Converted usage of ugettext* functions to their gettext* aliases 2017-02-07 09:04:04 +01:00