diff --git a/src/allmydata/node.py b/src/allmydata/node.py index 24addd3cd..1aa28a378 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -184,7 +184,7 @@ def read_config(basedir, portnumfile, generated_files=[], _valid_config=None): # (try to) read the main config file config_fname = os.path.join(basedir, "tahoe.cfg") - parser = configparser.SafeConfigParser() + parser = configparser.ConfigParser() try: parser = configutil.get_config(config_fname) except EnvironmentError as e: @@ -207,7 +207,7 @@ def config_from_string(basedir, portnumfile, config_str, _valid_config=None): _valid_config = _common_valid_config() # load configuration from in-memory string - parser = configparser.SafeConfigParser() + parser = configparser.ConfigParser() if isinstance(config_str, bytes): config_str = config_str.decode("utf-8") parser.read_string(config_str) diff --git a/src/allmydata/util/configutil.py b/src/allmydata/util/configutil.py index 287620c2f..a80921972 100644 --- a/src/allmydata/util/configutil.py +++ b/src/allmydata/util/configutil.py @@ -16,7 +16,7 @@ if PY2: # On Python 2 we use the backport package; that means we always get unicode # out. -from configparser import SafeConfigParser +from configparser import ConfigParser import attr @@ -30,11 +30,11 @@ class UnknownConfigError(Exception): def get_config(tahoe_cfg): - """Load the config, returning a SafeConfigParser. + """Load the config, returning a ConfigParser. Configuration is returned as native strings. """ - config = SafeConfigParser(strict=False) + config = ConfigParser(strict=False) # Byte Order Mark is an optional garbage byte you sometimes get at the # start of UTF-8 encoded files. Especially on Windows. Skip it by using # utf-8-sig. https://en.wikipedia.org/wiki/Byte_order_mark