diff options
author | Jeremy Stanley <fungi@yuggoth.org> | 2015-04-23 18:42:16 +0000 |
---|---|---|
committer | Jeremy Stanley <fungi@yuggoth.org> | 2015-04-23 18:42:16 +0000 |
commit | 52fcd502bf9d23aac88dae2b4b34d36f7aa26ea8 (patch) | |
tree | fe621bdee998853d2de6da61b50e948707cefd2b | |
parent | d6b0ca31a1e284fb7875e314b4e46777264a602a (diff) | |
download | pbr-52fcd502bf9d23aac88dae2b4b34d36f7aa26ea8.tar.gz |
Be safe, don't let friends use RawConfigParser
Replace uses of ConfigParser() and RawConfigParser() with
SafeConfigParser().
Change-Id: I78395eae381e1b911ab6b48c572665f4601ec315
-rw-r--r-- | pbr/tests/util.py | 2 | ||||
-rw-r--r-- | pbr/util.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pbr/tests/util.py b/pbr/tests/util.py index de5a740..e847746 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 c7d3402..63566eb 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)) |