diff options
Diffstat (limited to 'coverage/config.py')
-rw-r--r-- | coverage/config.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/coverage/config.py b/coverage/config.py index 78a3e86a..6d336d1f 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -72,7 +72,7 @@ class HandyConfigParser(configparser.RawConfigParser): d[opt] = self.get(section, opt) return d - def get(self, section, option, *args, **kwargs): # pylint: disable=arguments-differ + def get(self, section, option, *args, **kwargs): """Get a value, replacing environment variables also. The arguments are the same as `RawConfigParser.get`, but in the found @@ -325,7 +325,7 @@ class CoverageConfig(object): if used: self.config_file = os.path.abspath(filename) - with open(filename) as f: + with open(filename, "rb") as f: self._config_contents = f.read() return used @@ -421,6 +421,10 @@ class CoverageConfig(object): `value` is the new value for the option. """ + # Special-cased options. + if option_name == "paths": + self.paths = value + return # Check all the hard-coded options. for option_spec in self.CONFIG_FILE_OPTIONS: @@ -448,6 +452,10 @@ class CoverageConfig(object): Returns the value of the option. """ + # Special-cased options. + if option_name == "paths": + return self.paths + # Check all the hard-coded options. for option_spec in self.CONFIG_FILE_OPTIONS: attr, where = option_spec[:2] |