Skip to content

Commit

Permalink
Fixed #5846 -- Bullet-proofed the default timezone encoding test.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7184 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Feb 29, 2008
1 parent d5d2072 commit 2dbb08e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion django/utils/tzinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
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."
Expand Down

0 comments on commit 2dbb08e

Please sign in to comment.