X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7e43a00fd352fa3f43bb9041a0782eff3bf0be0a..de978c9987ddbb6595029b23b5dfd2823fc4ea3f:/munin/nominatim_requests_querylog diff --git a/munin/nominatim_requests_querylog b/munin/nominatim_requests_querylog index 7fe11bd0..aa41a4de 100755 --- a/munin/nominatim_requests_querylog +++ b/munin/nominatim_requests_querylog @@ -40,7 +40,7 @@ class LogFile: """ A query log file, unpacked. """ def __init__(self, filename): - self.fd = open(filename) + self.fd = open(filename, encoding='utf-8', errors='replace') self.len = os.path.getsize(filename) def __del__(self): @@ -121,9 +121,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__':