diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-02-29 17:13:20 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-02-29 17:13:20 +0000 |
| commit | 2dbb08e5dc7fe97d912855de530713a4ff7e42c0 (patch) | |
| tree | fafcf68a4a09fb604c3b09628147eef9a9f662b9 | |
| parent | d5d2072bbfc38015a93d6e13136c3f1dbf125d87 (diff) | |
Fixed #5846 -- Bullet-proofed the default timezone encoding test.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7184 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/utils/tzinfo.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/utils/tzinfo.py b/django/utils/tzinfo.py index 7d5ead9290..d8bdee390a 100644 --- a/django/utils/tzinfo.py +++ b/django/utils/tzinfo.py @@ -5,7 +5,11 @@ import time from datetime import timedelta, tzinfo from django.utils.encoding import smart_unicode -DEFAULT_ENCODING = locale.getdefaultlocale()[1] or 'ascii' +try: + DEFAULT_ENCODING = locale.getdefaultlocale()[1] or 'ascii' +except: + # Any problems at all determining the locale and we fallback. See #5846. + DEFAULT_ENCODING = 'ascii' class FixedOffset(tzinfo): "Fixed offset in minutes east from UTC." |
