From 7f00113ee56253604af1d5f6df75a960bb8bf898 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Wed, 17 May 2017 22:38:58 +0100 Subject: [PATCH] Fix trailing space in gamestats secret keys --- gamestats_server_http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gamestats_server_http.py b/gamestats_server_http.py index fb6bc3a..07c9e11 100644 --- a/gamestats_server_http.py +++ b/gamestats_server_http.py @@ -132,10 +132,10 @@ def parse_key_file(self, filename="gamestats.cfg"): with open(filename) as config_file: for line in config_file.readlines(): - if "#" in line: - line = line[:line.index('#')] + line, sep, comment = line.partition("#") - s = line.split('\t') + # Skip whitespaces (i.e. ' ', '\t', '\n') + s = line.split(None) if len(s) != 3: continue