Description

After upgrading from 1.5.3 to 1.9.2 and then to 1.9.3 error 500 shows up, mostly from:

File "/usr/lib/pymodules/python2.6/MoinMoin/theme/__init__.py", line 1553, in ui_lang_attr
    return ' lang="%s" dir="%s"' % (lang, i18n.getDirection(lang))
File "/usr/lib/pymodules/python2.6/MoinMoin/i18n/__init__.py", line 257, in getDirection
    return languages[lang]['x-direction']
TypeError: 'NoneType' object is unsubscriptable

Looks like ['x-direction'] doesn't exist.

Steps to reproduce

  1. Install python-moinmoin (1.9.3) from Ubuntu natty/maverick repository on lucid (10.04) system - you have to do it manually (dpkg -i) because in lucid repo there is only python-moinmoin 1.9.2 version available
  2. Set up wikifarm with apache and WSGI mod
  3. Doesn't matter if language_default = 'en' or language_ignore_browser = True are set. Rest of settings is rather default.

Example

Internal server error 500

Component selection

Details

MoinMoin Version

1.9.3

OS and Version

Linux Ubuntu 10.04 (lucid) server amd64

Python Version

2.6.5

Server Setup

wikifarm on Apache + mod_wsgi

Server Details

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

'en'

Workaround

In /usr/lib/pymodules/python2.6/MoinMoin/i18n/__init__.py

def getDirection(lang):
    """ Return the text direction for a language, either 'ltr' or 'rtl'. """
    #return languages[lang]['x-direction']
    return 'ltr'

Discussion

en.po has the X-Direction metadata. So likely languages is still None. Maybe stop moin, clear the caches, start moin.

Once the language cache is initialized properly, it won't happen again.

data/cache/i18n/*

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/1.9.3getDirectionNone (last edited 2011-02-16 21:46:00 by ThomasWaldmann)