From cc90747da1c6c2bd0db532295571099e7329da91 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Wed, 31 Aug 2016 16:24:28 +0800 Subject: [PATCH] Improve namecoin init error handling - partially addresses #896 --- src/namecoin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/namecoin.py b/src/namecoin.py index 87436c30..5b50bb67 100644 --- a/src/namecoin.py +++ b/src/namecoin.py @@ -273,9 +273,9 @@ def ensureNamecoinOptions (): # Try to read user/password from .namecoin configuration file. defaultUser = "" defaultPass = "" + nmcFolder = lookupNamecoinFolder () + nmcConfig = nmcFolder + "namecoin.conf" try: - nmcFolder = lookupNamecoinFolder () - nmcConfig = nmcFolder + "namecoin.conf" nmc = open (nmcConfig, "r") while True: @@ -295,7 +295,8 @@ def ensureNamecoinOptions (): shared.namecoinDefaultRpcPort = val nmc.close () - + except IOError: + logger.error("%s unreadable or missing, Namecoin support deactivated", nmcConfig) except Exception as exc: logger.warning("Error processing namecoin.conf", exc_info=True)