Description

setting in wikiconfig.py secrets = u"string" breaks the wiki. Fron the logs:

Traceback (most recent call last):
  File "/home/moin/moin/code/MoinMoin/wsgiapp.py", line 281, in __call__
    context = init(request)
  File "/home/moin/moin/code/MoinMoin/wsgiapp.py", line 51, in init
    context.lang = setup_i18n_preauth(context)
  File "/home/moin/moin/code/MoinMoin/wsgiapp.py", line 233, in setup_i18n_preauth
    i18n.i18n_init(context)
  File "/home/moin/moin/code/MoinMoin/i18n/__init__.py", line 72, in i18n_init
    meta_cache = caching.CacheEntry(request, 'i18n', 'meta', scope='wiki', use_pickle=True)
  File "/home/moin/moin/code/MoinMoin/caching.py", line 71, in __init__
    self.arena_dir = get_arena_dir(request, arena, scope)
  File "/home/moin/moin/code/MoinMoin/caching.py", line 32, in get_arena_dir
    return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
  File "/home/moin/moin/code/MoinMoin/web/contexts.py", line 56, in get
    res = obj.environ.setdefault(self.name, factory(obj))
  File "/home/moin/moin/code/MoinMoin/web/contexts.py", line 128, in cfg
    cfg = multiconfig.getConfig(self.request.url)
  File "/home/moin/moin/code/MoinMoin/config/multiconfig.py", line 193, in getConfig
    cfg = _makeConfig(cfgName)
  File "/home/moin/moin/code/MoinMoin/config/multiconfig.py", line 125, in _makeConfig
    cfg = configClass(name)
  File "/home/moin/moin/code/MoinMoin/config/multiconfig.py", line 429, in __init__
    secret = self.secrets[secret_key_name]
TypeError: string indices must be integers

Steps to reproduce

in wikiconfig.py add

        secrets = u"Randomstring!"

Restart the wiki ==> 500 Internal Server Error.

Workaround

Setting it to

        secrets = 'Randomstring!'

works

Discussion

Plan


CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/1.9.3UnicodeOnSecretsBreaksTheWiki (last edited 2011-07-07 17:57:59 by melmothx)