Description

When using the new cool "moin maint cleansession" script addition (development code), the code throws an exception with old sessions.

Steps to reproduce

  1. Have a wiki with MoinMoin 1.9.0 and the http://hg.moinmo.in/moin/1.9/rev/bd55be7c3886 changeset .

  2. Have old session files.
  3. Use the command with ( example: python /opt/moin/lib/python2.6/site-packages/MoinMoin/script/moin.py --config-dir=/srv/www/wiki --wiki-url=http://test/wiki maint cleansessions )

  4. The script throws an exception if it finds any "old" session without an expires value.

Example

Traceback:

python /opt/moin/lib/python2.6/site-packages/MoinMoin/script/moin.py --config-dir=/srv/www/wiki --wiki-url=http://wiki.asta.uni-ulm.de/test maint cleansessions
2010-01-17 13:45:37,053 WARNING MoinMoin.log:139 using logging configuration read from built-in fallback in MoinMoin.log module!
2010-01-17 13:45:37,314 INFO MoinMoin.config.multiconfig:93 using farm config: /srv/www/wiki/farmconfig.pyc
2010-01-17 13:45:37,388 INFO MoinMoin.config.multiconfig:127 using wiki config: /srv/www/wiki/test.pyc
Traceback (most recent call last):
  File "/opt/moin/lib/python2.6/site-packages/MoinMoin/script/moin.py", line 24, in <module>
    run()
  File "/opt/moin/lib/python2.6/site-packages/MoinMoin/script/moin.py", line 15, in run
    MoinScript().run(showtime=0)
  File "/opt/moin/lib/python2.6/site-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/opt/moin/lib/python2.6/site-packages/MoinMoin/script/__init__.py", line 253, in mainloop
    plugin_class(args[2:], self.options).run() # all starts again there
  File "/opt/moin/lib/python2.6/site-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/opt/moin/lib/python2.6/site-packages/MoinMoin/script/maint/cleansessions.py", line 70, in mainloop
    killit = killit and check(session)
  File "/opt/moin/lib/python2.6/site-packages/MoinMoin/script/maint/cleansessions.py", line 53, in <lambda>
    checks.append(lambda session: session['expires'] < now)
KeyError: 'expires'

Component selection

Details

MoinMoin Version

1.9.0 with http://hg.moinmo.in/moin/1.9/rev/bd55be7c3886

OS and Version

Python Version

Server Setup

Server Details

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

Workaround

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/190WithMaintCleansessionsChangesetUncomfortable (last edited 2010-01-18 14:41:30 by p5B1762F3)