From a3bf19246e589390b6793d3a5041c3a348078dd1 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Wed, 23 Oct 2019 22:44:45 +0200 Subject: Read datafile by specifying encoding This makes the script Python 3 only. --- munin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/munin.py b/munin.py index b39de83..a784228 100644 --- a/munin.py +++ b/munin.py @@ -59,7 +59,7 @@ def get_info(): """Return a description of all the graphs.""" data = defaultdict(dict) # parse the datafile and group by graph - with open(os.path.join(MUNIN_DBDIR, 'datafile'), 'rt') as f: + with open(os.path.join(MUNIN_DBDIR, 'datafile'), 'rt', encoding='utf-8') as f: for line in f: if ':' in line: source, line = line.split(':', 1) -- cgit v1.2.3