-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ldoce5viewer failed to create index #33
Comments
Removing python-whoosh 2.7.0 and installing python-whoosh 2.5.7 works for me ( ubuntu with python 2.7) |
I ran into the same error with Python 2.7.9 and whoosh 2.7.0. Fixed it by wrapping the corresponding lines in diff --git a/ldoce5viewer/qtgui/indexer.py b/ldoce5viewer/qtgui/indexer.py
index 0fedba6..582e99f 100644
--- a/ldoce5viewer/qtgui/indexer.py
+++ b/ldoce5viewer/qtgui/indexer.py
@@ -352,8 +352,12 @@ class IndexingThread(QThread):
i += 1
if i % 10000 == 0:
self._message('{0} items added'.format(i))
- fulltext_hwdphr_maker.add_item(itemtype, content, asfilter,
+
+ try:
+ fulltext_hwdphr_maker.add_item(itemtype, content, asfilter,
label, path, prio, sortkey)
+ except Exception as e:
+ print ("itemtype=", itemtype, "content=", content, "label=", label, "path=", path, e)
self._message('{0} items were added.'.format(i))
self._message('Finalizing...')
@@ -379,8 +383,11 @@ class IndexingThread(QThread):
i += 1
if i % 10000 == 0:
self._message('{0} items added'.format(i))
- fulltext_defexa_maker.add_item(itemtype, content, asfilter,
- label, path, prio, sortkey)
+ try:
+ fulltext_defexa_maker.add_item(itemtype, content, asfilter,
+ label, path, prio, sortkey)
+ except Exception as e:
+ print ("itemtype=", itemtype, "content=", content, "=label", label, "path=", path, e)
self._message('{0} items were added.'.format(i))
self._message('Finalizing...')``` |
@elfua What is the rationale behind the wrapping? Also, have you tested your patch for Python 3? |
@reflectionalist: The rationale behind the wrapping is to capture the indexing errors that happen with certain records, as outlined in the stacktraces you posted. It is a dirty workaround and not the proper way to fix the errors, but at least it allows the program to proceed even if something failed during indexing. I have updated the print statements to be python 3 compatible. Btw, all of the triggered whoosh exceptions are of the type |
To anyone running into the indexing issue: I can confirm that indexing works as expected with whoosh 2.5.7. The Until @ciscorn updates the app to be compatible with whoosh 2.7+ the proper way to fix the indexing error is to downgrade whoosh to 2.5.7. If you installed whoosh via
For Python 3 On Ubuntu |
Thank elFua so much. That works on me. |
I am using Arch Linux system Traceback (most recent call last): |
The error while indexing using whoosh 2.7:
is caused by regression in whoosh files, as described here. Solutions:
|
While creating index, ldoce5viewer failed with the following error message. I have tried both python2 and python3 (and their corresponding versions of lxml and whoosh) on Netrunner (which is Arch/Manjaro-based), indexing failed in both settings.
Error message for python2 setting:
Error message for python3 setting:
The text was updated successfully, but these errors were encountered: