diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-13 14:44:07 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-02-13 14:44:07 +0000 |
| commit | 166405b2e4197fba7d5638ee732f2170f8647f62 (patch) | |
| tree | bdc69d1cf37e925c7d66a7b371afce945588745f /django | |
| parent | f30a4b368cd6a03dfbbfd2145d06f747664ece86 (diff) | |
[1.1.X] Fixed #11944 -- Improved exception handling for the filesizeformat filter. Thanks to rfk for the report and patch.
Backport of r12426 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12428 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/template/defaultfilters.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/template/defaultfilters.py b/django/template/defaultfilters.py index a8c25670f6..03a294bc28 100644 --- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -792,7 +792,7 @@ def filesizeformat(bytes): """ try: bytes = float(bytes) - except TypeError: + except (TypeError,ValueError,UnicodeDecodeError): return u"0 bytes" if bytes < 1024: |
