Description

When starting MoinMoin 1.9.0 (using Apache and FastCGI), I get the following exception:

Traceback (most recent call last):
   File "/home/jbw/www/moinmoin/MoinMoin/wsgiapp.py", line 250, in __call__
     context = init(request)
   File "/home/jbw/www/moinmoin/MoinMoin/wsgiapp.py", line 33, in init
     context.lang = setup_i18n_preauth(context)
   File "/home/jbw/www/moinmoin/MoinMoin/wsgiapp.py", line 224, in setup_i18n_preauth
     if lang is None and cfg.language_default in i18n.languages:
 TypeError: argument of type 'NoneType' is not iterable

This is the code that fails:

   1 def setup_i18n_preauth(context):
   2     """ Determine language for the request in absence of any user info. """
   3     if i18n.languages is None:
   4         i18n.i18n_init(context)
   5 
   6     cfg = context.cfg
   7     lang = None
   8     if i18n.languages and not cfg.language_ignore_browser:
   9         for l in context.request.accept_languages:
  10             if l in i18n.languages:
  11                 lang = l
  12                 break
  13     if lang is None and cfg.language_default in i18n.languages:
  14         lang = cfg.language_default
  15     else:
  16         lang = 'en'
  17     return lang

In line 13, i18n.languages is not defined.

Steps to reproduce

Well... install a fresh MoinMoin 1.9.0, try to get it working with Apache2, access the front page. I've attached all the config files that I'm using.

Details

MoinMoin Version

1.9.0

OS and Version

Debian Lenny

Python Version

2.5.4

Server Setup

Apache2 with mod_fcgi

Server Details

2.2.14-3

Language you are using the wiki in (set in the browser/UserPreferences)

English?

Discussion

That browser language detection was broken also in other ways and was fixed already, please test.

Plan

Confirmed status. Works like a charm now! Thanks!


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/I18nLanguagesNotSetInSetupI18nPreauth (last edited 2009-12-19 17:12:34 by 112-116)