From: Daira Hopwood Date: Mon, 5 May 2014 22:14:48 +0000 (+0100) Subject: Improve error reporting for '#' characters in config entries. refs #2128 X-Git-Tag: allmydata-tahoe-1.10.1a1~181 X-Git-Url: https://git.rkrishnan.org/vdrive/%5B/%5D%20/install.html?a=commitdiff_plain;h=efc223ad1fdefd39827b5516a37b7b5822532bbc;p=tahoe-lafs%2Ftahoe-lafs.git Improve error reporting for '#' characters in config entries. refs #2128 Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 47c8ac3b..1a6bb94f 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -58,7 +58,7 @@ class OldConfigOptionError(Exception): class UnescapedHashError(Exception): def __str__(self): return ("The configuration entry %s contained an unescaped '#' character." - % quote_output(self.args[0])) + % quote_output("[%s]%s = %s" % self.args)) class Node(service.MultiService): @@ -124,7 +124,7 @@ class Node(service.MultiService): item = self.config.get(section, option) if option.endswith(".furl") and self._contains_unescaped_hash(item): - raise UnescapedHashError(item) + raise UnescapedHashError(section, option, item) return item except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):