Ticket #10335: tzinfo-getdefaultencoding.patch

File tzinfo-getdefaultencoding.patch, 565 bytes (added by Gunnlaugur Þór Briem, 16 years ago)

Patch for simplest possible change, getdefaultencoding() instead of getdefaultlocale()[1]

  • django/utils/tzinfo.py

     
    44import time
    55from datetime import timedelta, tzinfo
    66from django.utils.encoding import smart_unicode
     7import sys
    78
    89try:
    9     DEFAULT_ENCODING = locale.getdefaultlocale()[1] or 'ascii'
     10    DEFAULT_ENCODING = sys.getdefaultencoding() or 'ascii'
    1011except:
    1112    # Any problems at all determining the locale and we fallback. See #5846.
    1213    DEFAULT_ENCODING = 'ascii'
Back to Top