From c0bf133ab8e867b1bae79935dee8354d345e2a59 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 11 Dec 2008 09:31:37 +0000 Subject: [PATCH] Add an error check when reading the auth file --- deluge/ui/common.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/ui/common.py b/deluge/ui/common.py index 24decb5f4..6e2eecc9d 100644 --- a/deluge/ui/common.py +++ b/deluge/ui/common.py @@ -131,7 +131,12 @@ def get_localhost_auth_uri(uri): if os.path.exists(auth_file): u = urlparse.urlsplit(uri) for line in open(auth_file): - username, password = line.split(":") + try: + username, password = line.split(":") + except ValueError, e: + log.error("Error with auth entry %s", line) + continue + if username == "localclient": # We use '127.0.0.1' in place of 'localhost' just incase this isn't defined properly hostname = u.hostname.replace("localhost", "127.0.0.1")