Ticket #10335: tzinfo-getdefaultencoding-only-if-unchanged-fails.patch
File tzinfo-getdefaultencoding-only-if-unchanged-fails.patch, 679 bytes (added by , 16 years ago) |
---|
-
django/utils/tzinfo.py
4 4 import time 5 5 from datetime import timedelta, tzinfo 6 6 from django.utils.encoding import smart_unicode 7 import sys 8 from encodings import codecs 7 9 8 10 try: 9 11 DEFAULT_ENCODING = locale.getdefaultlocale()[1] or 'ascii' 12 try: 13 codecs.getdecoder(DEFAULT_ENCODING) 14 except LookupError: 15 DEFAULT_ENCODING = sys.getdefaultencoding() or 'ascii' 10 16 except: 11 17 # Any problems at all determining the locale and we fallback. See #5846. 12 18 DEFAULT_ENCODING = 'ascii'