Be safe, don't let friends use RawConfigParser
Replace uses of ConfigParser() and RawConfigParser() with SafeConfigParser(). Change-Id: I78395eae381e1b911ab6b48c572665f4601ec315
This commit is contained in:
		| @@ -51,7 +51,7 @@ except ImportError: | |||||||
|  |  | ||||||
| @contextlib.contextmanager | @contextlib.contextmanager | ||||||
| def open_config(filename): | def open_config(filename): | ||||||
|     cfg = configparser.ConfigParser() |     cfg = configparser.SafeConfigParser() | ||||||
|     cfg.read(filename) |     cfg.read(filename) | ||||||
|     yield cfg |     yield cfg | ||||||
|     with open(filename, 'w') as fp: |     with open(filename, 'w') as fp: | ||||||
|   | |||||||
| @@ -201,7 +201,7 @@ def cfg_to_args(path='setup.cfg'): | |||||||
|     """ |     """ | ||||||
|  |  | ||||||
|     # The method source code really starts here. |     # The method source code really starts here. | ||||||
|     parser = configparser.RawConfigParser() |     parser = configparser.SafeConfigParser() | ||||||
|     if not os.path.exists(path): |     if not os.path.exists(path): | ||||||
|         raise DistutilsFileError("file '%s' does not exist" % |         raise DistutilsFileError("file '%s' does not exist" % | ||||||
|                                  os.path.abspath(path)) |                                  os.path.abspath(path)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jeremy Stanley
					Jeremy Stanley