Description
Built-in spell checker ignores cache_dir config parameter.
Current 1.9.4 code is as follows:
./action/SpellCheck.py: cachename = os.path.join(request.cfg.data_dir, 'cache', 'spellchecker.dict')
thus bypassing attempts to redirect caches to non-default location.
If this is fixed then scope of cache needs to be thought about. Any global dict/words file could and should be cached on the farm level and local words on the instance level? Global dict/words is currently read from the source code directory (site-packages/MoinMoin/dict), it might make sense to be able to directly configure that to be something different (like /usr/dict/words) instead of having to copy dictionaries to into more protected source dir.
Steps to reproduce
- See code snippet above
Example
Component selection
- Spell Checker
Details
MoinMoin Version |
1.9.4 |
OS and Version |
|
Python Version |
2.6 |
Server Setup |
|
Server Details |
|
Language you are using the wiki in (set in the browser/UserPreferences) |
|
Workaround
Discussion
I do have a farmwiki and on a single one I always see in the edit window the option "spell check", if I use this feature I got the following error:
ERROR 2013-06-20 22:17:34,699 MoinMoin.wsgiapp:273 An exception has occurred [http://www.heavy.ch/wiki/Informationen]. Traceback (most recent call last): File "/home/lotek/lib/python2.6/MoinMoin/wsgiapp.py", line 256, in __call__ response = run(context) File "/home/lotek/lib/python2.6/MoinMoin/wsgiapp.py", line 88, in run response = dispatch(request, context, action_name) File "/home/lotek/lib/python2.6/MoinMoin/wsgiapp.py", line 136, in dispatch response = handle_action(context, pagename, action_name) File "/home/lotek/lib/python2.6/MoinMoin/wsgiapp.py", line 195, in handle_action handler(context.page.page_name, context) File "/home/lotek/lib/python2.6/MoinMoin/action/edit.py", line 152, in execute pg.sendEditor(preview=savetext, comment=comment) File "/home/lotek/lib/python2.6/MoinMoin/PageGraphicalEditor.py", line 405, in sendEditor badwords, badwords_re, msg = SpellCheck.checkSpelling(self, request, own_form=0) File "/home/lotek/lib/python2.6/MoinMoin/action/SpellCheck.py", line 131, in checkSpelling wordsdict = _loadDict(request) File "/home/lotek/lib/python2.6/MoinMoin/action/SpellCheck.py", line 88, in _loadDict wordsdict = dbhash.open(cachename, 'n') File "/usr/lib64/python2.6/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/usr/lib64/python2.6/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBNoSuchFileError: (2, 'No such file or directory')
Strange is, that in another wiki (on the same farm) I do not even see this "spell check" button. I use the cache_dir to move my caches to a separate location for the whole farm. This BUG could be maybe the reason for my error, but I'm not sure. Any hints? -- MarcelHäfner 2013-06-20 22:21:26
Plan
- Priority:
- Assigned to:
- Status: