[mb-commits] r9790 - lucene_server/trunk/lib

root at musicbrainz.org root at musicbrainz.org
Fri Mar 21 16:54:21 UTC 2008


Author: robert
Date: 2008-03-21 16:54:21 +0000 (Fri, 21 Mar 2008)
New Revision: 9790

Modified:
   lucene_server/trunk/lib/search.py
Log:
Fixed some output bugs


Modified: lucene_server/trunk/lib/search.py
===================================================================
--- lucene_server/trunk/lib/search.py	2008-03-21 15:05:32 UTC (rev 9789)
+++ lucene_server/trunk/lib/search.py	2008-03-21 16:54:21 UTC (rev 9790)
@@ -205,14 +205,14 @@
             try:
                 parsedQuery = PyLucene.MultiFieldQueryParser(fields, self.analyzer).parse(query)
             except Exception, msg:
-                text = unicode(msg)
-                raise QueryError(text)
+                text = str(msg)
+                raise QueryError(text.encode('utf-8'))
         else:
             try:
                 parsedQuery = PyLucene.QueryParser(self.defaultField, self.analyzer).parse(query)
             except Exception, msg:
-                text = unicode(msg)
-                raise QueryError(text)
+                text = str(msg)
+                raise QueryError(text.encode('utf-8'))
 
         hits = []
         err = ''
@@ -220,17 +220,17 @@
             hits = self.index.search(parsedQuery);
         except Exception, msg:
             text = str(msg)
-            raise QueryError(text)
+            raise QueryError(text.encode('utf-8'))
 
         if not hits: raise NoResultsError()
  
         return hits
  
     def log_error(self, msg):
-	log = open("/tmp/slow_queries.txt", "a")
-	if log:
-	    log.write(msg)
-	    log.flush()
+        log = open("/tmp/slow_queries.txt", "a")
+        if log:
+            log.write(msg)
+            log.flush()
             log.close()
  
     def search(self, query, maxHits, offset, type='xml'):




More information about the MusicBrainz-commits mailing list