From 04b38cf52afb613e7435b6b13208c6ab0f195fd8 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 4 Nov 2021 10:26:02 +0100 Subject: [PATCH] Fixed /etc/os-release parsing. fix #399 --- modoboa_installer/utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modoboa_installer/utils.py b/modoboa_installer/utils.py index 982a105..8a793af 100644 --- a/modoboa_installer/utils.py +++ b/modoboa_installer/utils.py @@ -79,11 +79,10 @@ def dist_info(): if os.path.exists(path): info = {} with open(path) as fp: - while True: - l = fp.readline() - if not l: - break - key, value = l.split("=") + for line in fp.readlines(): + if line == '\n': + continue + key, value = line.split("=") value = value.rstrip('"\n') value = value.strip('"') info[key] = value