]> git.openstreetmap.org Git - nominatim.git/blobdiff - munin/nominatim_query_speed_querylog
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / munin / nominatim_query_speed_querylog
index 1959e38e42e1a6cd4662213ec0cc783721fb20af..4bbeac6896da6e724452976e37e2a92318fe72b1 100755 (executable)
@@ -4,7 +4,7 @@
 #
 # Uses the query log.
 #
-# Parameters: 
+# Parameters:
 #
 #       config   (required)
 #       autoconf (optional - used by munin-config)
@@ -47,7 +47,7 @@ class LogFile:
     """ A query log file, unpacked. """
 
     def __init__(self, filename):
-        self.fd = open(filename, encoding='utf-8')
+        self.fd = open(filename, encoding='utf-8', errors='replace')
         self.len = os.path.getsize(filename)
 
     def __del__(self):
@@ -128,9 +128,8 @@ class LogFile:
     def loglines(self):
         for l in self.fd:
             e = ENTRY_REGEX.match(l)
-            if e is None:
-                raise ValueError("Invalid log line:", l)
-            yield e.groupdict()
+            if e is not None:
+                yield e.groupdict()
 
 
 if __name__ == '__main__':