mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #11944 -- Improved exception handling for the filesizeformat filter. Thanks to rfk for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12426 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -799,7 +799,7 @@ def filesizeformat(bytes):
|
||||
"""
|
||||
try:
|
||||
bytes = float(bytes)
|
||||
except TypeError:
|
||||
except (TypeError,ValueError,UnicodeDecodeError):
|
||||
return u"0 bytes"
|
||||
|
||||
if bytes < 1024:
|
||||
|
||||
Reference in New Issue
Block a user