diff --git a/pbr/tests/util.py b/pbr/tests/util.py index de5a7401..e8477460 100644 --- a/pbr/tests/util.py +++ b/pbr/tests/util.py @@ -51,7 +51,7 @@ except ImportError: @contextlib.contextmanager def open_config(filename): - cfg = configparser.ConfigParser() + cfg = configparser.SafeConfigParser() cfg.read(filename) yield cfg with open(filename, 'w') as fp: diff --git a/pbr/util.py b/pbr/util.py index c7d34026..63566eb2 100644 --- a/pbr/util.py +++ b/pbr/util.py @@ -201,7 +201,7 @@ def cfg_to_args(path='setup.cfg'): """ # The method source code really starts here. - parser = configparser.RawConfigParser() + parser = configparser.SafeConfigParser() if not os.path.exists(path): raise DistutilsFileError("file '%s' does not exist" % os.path.abspath(path))