Description
When using the new cool "moin maint cleansession" script addition (development code), the code throws an exception with old sessions.
Steps to reproduce
Have a wiki with MoinMoin 1.9.0 and the http://hg.moinmo.in/moin/1.9/rev/bd55be7c3886 changeset .
- Have old session files.
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 )
- 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
- MoinMoin/script/maint/cleansessions.py
Details
MoinMoin Version |
|
OS and Version |
|
Python Version |
|
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
- Don't use bleeding edge code.
- Delete all old sessions once before usage.
Discussion
- Sorry, for reporting about development code. I wanted to give feedback nevertheless.
- It would be nice to add the usage information to the standard usage output.
- Tested: works nicely for me. I still would like to see the usage info when calling moin.py, but I guess that this will be done when the feature is stable and released.
Plan
- Priority:
- Assigned to:
Status: please try http://hg.moinmo.in/moin/1.9/rev/709089f30164