copus path problem

Issue #1 wontfix
Anonymous created an issue


after configuring and launching the marasca I was continually getting "Unable to open configuration file" error message when trying to execute any query. After a moment of debugging I've found, that the quietly ignores the path configuration setting from Corpus class.

For some reasons I can't attach a patch as a file, so I paste it below:

---    2012-10-12 13:53:04.000000000 +0200
+++    2012-10-12 16:01:32.000000000 +0200
@@ -16,6 +16,7 @@
 import contextlib
 import sys
 import time
 +import os.path

 import django.conf
 import django.core.mail
@@ -140,7 +141,7 @@
     return info

 def run_query(connection, settings, corpus, query, l, r):
-    connection.open_corpus(
+    connection.open_corpus(os.path.join(corpus.path,
         connection.make_query(query, force=settings.need_query_remake())
     except poliqarp.InvalidQuery, ex:

Comments (2)

  1. Jakub Wilk repo owner

    Thanks for reporting the issue.

    The current behavior is intentional. The client assumes that poliqarpd is configured in such a way it's possible to open a corpus using an identifier (rather than full path). I would recommend such a setup anyway, both for performance reasons and as a security hardening measure.

    I can't apply your patch as-is, as it would break existing maraca installations. Perhaps we could make the behaviour conditional upon a configuration option, though.

  2. Log in to comment