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
This commit is contained in:
Malcolm Tredinnick 2008-02-29 17:13:20 +00:00
parent d5d2072bbf
commit 2dbb08e5dc
1 changed files with 5 additions and 1 deletions

View File

@ -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."