From 751bc317ea89514b0e3641f362d0aa9fb2ec4fbd Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sun, 25 Nov 2012 23:30:13 +0000 Subject: [PATCH] Fix #2201 : auth fails if auth file has extra newlines --- deluge/core/authmanager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deluge/core/authmanager.py b/deluge/core/authmanager.py index 771043e8b..f8cffbb7c 100644 --- a/deluge/core/authmanager.py +++ b/deluge/core/authmanager.py @@ -236,10 +236,10 @@ class AuthManager(component.Component): f = open(auth_file, "r").readlines() for line in f: - if line.startswith("#"): - # This is a comment line - continue line = line.strip() + if line.startswith("#") or not line: + # This line is a comment or empty + continue try: lsplit = line.split(":") except Exception, e: