Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 2dbb08e5dc7fe97d912855de530713a4ff7e42c0 1 parent d5d2072
@malcolmt malcolmt authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 django/utils/tzinfo.py
View
6 django/utils/tzinfo.py
@@ -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."

0 comments on commit 2dbb08e

Please sign in to comment.
Something went wrong with that request. Please try again.