From c0096a7c52d03ffba353cc4ef2903101f7b1dbd5 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Wed, 2 Nov 2016 21:24:07 +0100 Subject: [PATCH] Read logs as utf-8 --- tsstats/log.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsstats/log.py b/tsstats/log.py index f3f4ce1..fc37f65 100644 --- a/tsstats/log.py +++ b/tsstats/log.py @@ -2,6 +2,7 @@ import logging import re +from codecs import open from collections import namedtuple from datetime import datetime from glob import glob @@ -115,7 +116,7 @@ def _parse_details(log_path, ident_map=None, clients=None, online_dc=True): ''' if clients is None: clients = Clients(ident_map) - log_file = open(log_path) + log_file = open(log_path, encoding='utf-8') # process lines logger.debug('Started parsing of %s', log_file.name) for line in log_file: