mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 23:26:43 +00:00
Improve error reporting for '#' characters in config entries. refs #2128
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
87df9d218d
commit
efc223ad1f
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user