Opened 8 years ago

Closed 8 years ago

#22409 closed Bug (duplicate)

Adding custom locale throws NoneType error

Reported by: mbhagya@… Owned by: nobody
Component: Translations Version: 1.5
Severity: Normal Keywords:
Cc: dikumar@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I have installed a language in the settings bundle:

LANG_INFO.update({'zh-hk': {'bidi': False,
                            'code': 'zh-hk',
                            'name': u'Traditional Chinese',
                            'name_local': '\u7e41\u9ad4\u4e2d\u6587',}

LANGUAGES += (('zh-hk', gettext_noop('Traditional Chinese')), )
LOCALE_PATHS += (C_SERVER_DIR + 'appC/locale',)

When I start the server and set "Accept-Language" to zh-hk, the server works fine.
But when I start the server, first send a "zh-tw" request and then send a "zh-hk" request, the server throws 500 with the following stack trace:

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/core/handlers/", line 92, in get_response
    response = middleware_method(request)
  File "/Library/Python/2.7/site-packages/django/middleware/", line 24, in process_request
  File "/Library/Python/2.7/site-packages/django/utils/translation/", line 90, in activate
    return _trans.activate(language)
  File "/Library/Python/2.7/site-packages/django/utils/translation/", line 183, in activate
    _active.value = translation(language)
  File "/Library/Python/2.7/site-packages/django/utils/translation/", line 173, in translation
    current_translation = _fetch(language, fallback=default_translation)
  File "/Library/Python/2.7/site-packages/django/utils/translation/", line 141, in _fetch
    res._info = res._info.copy()
AttributeError: 'NoneType' object has no attribute '_info'

Change History (1)

comment:1 Changed 8 years ago by Tim Graham

Resolution: duplicate
Status: newclosed

Looks like a duplicate of #21055

Note: See TracTickets for help on using tickets.
Back to Top