From f221ae53eb34398ecd61c42891b6086b3b135fa5 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Mon, 9 May 2016 16:40:02 +0100 Subject: [PATCH] [#2832] [UI] Skip blank lines in auth file --- deluge/ui/common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/deluge/ui/common.py b/deluge/ui/common.py index e3fbb44b3..a4a6974dd 100644 --- a/deluge/ui/common.py +++ b/deluge/ui/common.py @@ -410,10 +410,11 @@ def get_localhost_auth(): auth_file = deluge.configmanager.get_config_dir("auth") if os.path.exists(auth_file): for line in open(auth_file): - if line.startswith("#"): - # This is a comment line - continue line = line.strip() + if line.startswith("#") or not line: + # This is a comment or blank line + continue + try: lsplit = line.split(":") except Exception, e: