[issue2551123] Validate indexer_language in config module rather than in indexer_xapian.py

John Rouillard <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from John Rouillard:

In hg 6353:9d209d2b34ae the value of the config
main.indexer_language setting is validated in
indexer_xapian.py.

A bad language setting results in an error when loading any web
page (and probably a failure from the email gateway).
It should probably be validated in configuration.py.

To do this, we need:

 1) determine if the xapian indexer is being used.
 2) determine if the language is valid by calling:
    xapian.Stem(language). A xapian.InvalidArgumentError
    indicates a bad language.
 3) report to the user the error and the list of good languages.
    See current implementation in backends/indexer_xapian.py.

1 is tricky. If [main] indexer is unset or set to xapian, we need
to test the config value. But there is no guarantee that
the [main] indexer definition will be available when we need to
validate the indexer_language.

----------
components: Database
messages: 7149
nosy: rouilj
severity: normal
status: new
title: Validate indexer_language in config module rather than in indexer_xapian.py
type: behavior
versions: 2.0.1, devel

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551123>
_________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.